Changeset 1319 in tailor


Ignore:
Timestamp:
02/27/07 02:12:34 (6 years ago)
Author:
John Goerzen <jgoerzen@…>
Hash name:
20070227011234-c2a52-70b7d80b21ab1b080b176c138479bee55bd28764
Message:

Generalize directory filtering and add it to commit
Without this, tailor was crashing whenever it tried to commit a changeset
from darcs that added an empty directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/hg.py

    r1298 r1319  
    242242            entry.old_name = normpath(self.repository.encode(entry.old_name)) 
    243243 
     244    def _removeDirs(self, names): 
     245        from os.path import isdir, join, normpath 
     246        """Remove the names that reference a directory.""" 
     247        return [n for n in names 
     248                if not isdir(join(self.repository.basedir, normpath(n)))] 
     249        return notdirs 
     250 
    244251    def _addPathnames(self, names): 
    245         from os.path import join, isdir, normpath 
    246  
    247         notdirs = [n for n in names 
    248                    if not isdir(join(self.repository.basedir, normpath(n)))] 
     252        from os.path import join 
     253 
     254        notdirs = self._removeDirs(names) 
    249255        if notdirs: 
    250256            self.log.info('Adding %s...', ', '.join(notdirs)) 
     
    275281        opts['user'] = encode(author) 
    276282        opts['date'] =  '%d %d' % (timestamp, -timezone) # note the minus sign! 
    277         self._hgCommand('commit', *[encode(n) for n in names], **opts) 
     283        notdirs = self._removeDirs(names) 
     284        self._hgCommand('commit', *[encode(n) for n in notdirs], **opts) 
    278285 
    279286    def _tag(self, tag): 
Note: See TracChangeset for help on using the changeset viewer.