Changeset 852 in tailor for vcpx/hglib.py
- Timestamp:
- 09/27/05 23:01:30 (8 years ago)
- Hash name:
- 20050927210130-97f81-631fb1bfd4a04fd079182d4588b1a98ba4e576ca
- File:
-
- 1 edited
-
vcpx/hglib.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/hglib.py
r850 r852 68 68 """Rename an entry""" 69 69 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 73 71 74 72 if isdir(join(self.basedir, newname)): 75 73 # Given lack of support for directories in current HG, 76 # loop over all files under the newdirectory and74 # loop over all files under the old directory and 77 75 # 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]) 90 80 else: 91 81 self._hg.copy(oldname, newname)
Note: See TracChangeset
for help on using the changeset viewer.
