Changeset 852 in tailor
- Timestamp:
- 09/27/05 23:01:30 (8 years ago)
- Hash name:
- 20050927210130-97f81-631fb1bfd4a04fd079182d4588b1a98ba4e576ca
- Location:
- vcpx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vcpx/hg.py
r850 r852 89 89 90 90 from os.path import join, isdir 91 from os import walk92 from dualwd import IGNORED_METADIRS93 91 94 92 cmd = self.repository.command("rename", "--after") … … 96 94 if isdir(join(self.basedir, newname)): 97 95 # Given lack of support for directories in current HG, 98 # loop over all files under the new directory and 99 # do a copy on them. 100 skip = len(self.basedir)+len(newname)+2 101 for dir, subdirs, files in walk(join(self.basedir, newname)): 102 prefix = dir[skip:] 103 104 for excd in IGNORED_METADIRS: 105 if excd in subdirs: 106 subdirs.remove(excd) 107 108 for f in files: 109 copy.execute(join(oldname, prefix, f), 110 join(newname, prefix, f)) 96 # loop over all files presented by "hg manifest" under the 97 # old directory and do a copy on them. 98 cmd = self.repository.command("manifest") 99 manifest = ExternalCommand(cwd=self.basedir, command=cmd) 100 output = manifest.execute(stdout=PIPE)[0] 101 for row in output: 102 sha, mode, oldpath = row[:-1].split(' ') 103 if oldpath.startswith(oldname): 104 tail = oldpath[len(oldname)+2:] 105 copy.execute(oldpath, join(newname, tail)) 111 106 if copy.exit_status: 112 107 raise ChangesetReplayFailure("Could not rename %r " -
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.
