Changeset 852 in tailor for vcpx/hglib.py


Ignore:
Timestamp:
09/27/05 23:01:30 (8 years ago)
Author:
lele@…
Hash name:
20050927210130-97f81-631fb1bfd4a04fd079182d4588b1a98ba4e576ca
Message:

Under hg, the rename must walk over old directory contents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/hglib.py

    r850 r852  
    6868        """Rename an entry""" 
    6969 
    70         from os.path import join, isdir 
    71         from os import walk 
    72         from dualwd import IGNORED_METADIRS 
     70        from os.path import join, isdir, normpath 
    7371 
    7472        if isdir(join(self.basedir, newname)): 
    7573            # Given lack of support for directories in current HG, 
    76             # loop over all files under the new directory and 
     74            # loop over all files under the old directory and 
    7775            # do a copy on them. 
    78             skip = len(self.basedir)+len(newname)+2 
    79             for dir, subdirs, files in walk(join(self.basedir, newname)): 
    80                 prefix = dir[skip:] 
    81  
    82                 for excd in IGNORED_METADIRS: 
    83                     if excd in subdirs: 
    84                         subdirs.remove(excd) 
    85  
    86                 for f in files: 
    87                     self._hg.copy(join(oldname, prefix, f), 
    88                                   join(newname, prefix, f)) 
    89                     self._hg.remove([join(oldname, prefix, f)]) 
     76            for src, oldpath in self._hg.dirstate.walk(oldname): 
     77                tail = oldpath[len(oldname)+2:] 
     78                self._hg.copy(oldpath, join(newname, tail)) 
     79                self._hg.remove([oldpath]) 
    9080        else: 
    9181            self._hg.copy(oldname, newname) 
Note: See TracChangeset for help on using the changeset viewer.