Changeset 1324 in tailor


Ignore:
Timestamp:
03/05/07 22:26:12 (6 years ago)
Author:
John Goerzen <jgoerzen@…>
Hash name:
20070305212612-c2a52-6a5d2a789e0cdd8fb7e79a77b9aef9fb488cd3e1
Message:

Handle empty changesets in Mercurial
In at least Darcs, it is possible to commit a changesets that doesn't
change anything. Such a changeset still has an author, date, log, etc.

Tailor had been just dropping these changesets, but it could be useful to
have them available -- the log messages could be important to the project,
for instance.

To preserve them, we create a .hgempty file with details of each empty
changeset and commit it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/hg.py

    r1323 r1324  
    283283        opts['date'] =  '%d %d' % (timestamp, -timezone) # note the minus sign! 
    284284        notdirs = self._removeDirs(names) 
     285        if len(notdirs) == 0:  # Empty changeset; make sure we still see it 
     286            empty = open(join(self.repository.basedir, '.hgempty'), 'a') 
     287            empty.write("\nEmpty original changeset by %s:\n" % author) 
     288            empty.write(logmessage + "\n") 
     289            empty.close() 
     290            self._hg.add(['.hgempty']) 
    285291        self._hgCommand('commit', **opts) 
    286292 
     
    425431            ignore.write('$\n') 
    426432        ignore.close() 
    427         self._hg.add('.hgignore') 
     433        self._hg.add(['.hgignore']) 
    428434        self._hgCommit('commit', '-m', 
    429435                       'Tailor preparing to convert repo by adding .hgignore', 
Note: See TracChangeset for help on using the changeset viewer.