Changeset 1282 in tailor
- Timestamp:
- 09/12/06 23:21:44 (7 years ago)
- Hash name:
- 20060912212144-97f81-be2c97c450f865310b3d1c19fed82f068a756294
- Location:
- vcpx
- Files:
-
- 4 edited
-
repository/cvsps.py (modified) (1 diff)
-
repository/svn.py (modified) (1 diff)
-
dualwd.py (modified) (1 diff)
-
repository/bzr.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/repository/cvsps.py
r1281 r1282 745 745 """ 746 746 747 from os import rename748 from os.path import join749 750 if not self.shared_basedirs:751 oldpath = join(self.repository.basedir, oldname)752 newpath = join(self.repository.basedir, newname)753 try:754 rename(oldpath, newpath)755 except OSError:756 raise ChangesetApplicationFailure(757 'Cannot rename "%s" to "%s"' % (oldpath, newpath))758 759 747 self._removePathnames([oldname]) 760 748 self._addPathnames([newname]) -
vcpx/repository/svn.py
r1281 r1282 615 615 # --force in case the file has been changed and moved in one revision 616 616 cmd = self.repository.command("mv", "--quiet", "--force") 617 618 if self.shared_basedirs: 619 # Subversion does not seem to allow 620 # $ mv a.txt b.txt 621 # $ svn mv a.txt b.txt 622 # Here we are in this situation, since upstream VCS already 623 # moved the item. 624 # It may be better to let subversion do the move itself. For one 625 # thing, svn's cp+rm is different from rm+add (cp preserves 626 # history). 627 # This does not happen when using disjunct basedirs, since tailor 628 # replayes the changeset on untouched sources 629 unmoved = False 630 oldpath = join(self.repository.basedir, oldname) 631 newpath = join(self.repository.basedir, newname) 632 if not exists(oldpath): 633 try: 634 rename(newpath, oldpath) 635 except OSError: 636 raise ChangesetApplicationFailure( 637 'Cannot rename "%s" back to "%s"' % (newpath, oldpath)) 638 unmoved = True 617 # Subversion does not seem to allow 618 # $ mv a.txt b.txt 619 # $ svn mv a.txt b.txt 620 # Here we are in this situation, since upstream VCS already 621 # moved the item. 622 # It may be better to let subversion do the move itself. For one thing, 623 # svn's cp+rm is different from rm+add (cp preserves history). 624 unmoved = False 625 oldpath = join(self.repository.basedir, oldname) 626 newpath = join(self.repository.basedir, newname) 627 if not exists(oldpath): 628 try: 629 rename(newpath, oldpath) 630 except OSError: 631 self.log.critical('Cannot rename %r back to %r', 632 newpath, oldpath) 633 raise 634 unmoved = True 639 635 move = ExternalCommand(cwd=self.repository.basedir, command=cmd) 640 636 out, err = move.execute(oldname, newname, stdout=PIPE, stderr=PIPE) 641 637 if move.exit_status: 642 if self.shared_basedirs andunmoved:638 if unmoved: 643 639 rename(oldpath, newpath) 644 640 raise ChangesetApplicationFailure("%s returned status %d saying\n%s" -
vcpx/dualwd.py
r1281 r1282 103 103 104 104 def replayChangeset(self, changeset): 105 self.target.replayChangeset(changeset)106 105 if not self.shared_basedirs: 107 106 self._syncTargetWithSource() 107 self.target.replayChangeset(changeset) 108 108 109 109 def _syncTargetWithSource(self): -
vcpx/repository/bzr.py
r1281 r1282 304 304 from os.path import join, exists 305 305 306 if self.shared_basedirs:307 # bzr does the rename itself as well308 unmoved = False309 oldpath = join(self.repository.basedir, oldname)310 newpath = join(self.repository.basedir, newname)311 if not exists(oldpath):312 try:313 rename(newpath, oldpath)314 except OSError:315 raise ChangesetApplicationFailure(316 'Cannot rename "%s" back to "%s"' % (newpath, oldpath))317 unmoved = True306 # bzr does the rename itself as well 307 unmoved = False 308 oldpath = join(self.repository.basedir, oldname) 309 newpath = join(self.repository.basedir, newname) 310 if not exists(oldpath): 311 try: 312 rename(newpath, oldpath) 313 except OSError: 314 self.log.critical('Cannot rename %r back to %r', 315 newpath, oldpath) 316 raise 317 unmoved = True 318 318 319 319 self.log.info('Renaming %r to %r...', oldname, newname) … … 321 321 self._working_tree.rename_one(oldname, newname) 322 322 except: 323 if self.shared_basedirs andunmoved:323 if unmoved: 324 324 rename(oldpath, newpath) 325 325 raise
Note: See TracChangeset
for help on using the changeset viewer.
