Changeset 1282 in tailor


Ignore:
Timestamp:
09/12/06 23:21:44 (7 years ago)
Author:
lele@…
Hash name:
20060912212144-97f81-be2c97c450f865310b3d1c19fed82f068a756294
Message:

UNDO: Fix ticket #75, at least with DisjunctWorkingDirectories
While fixing it with shared basedirs is a tricky business, with disjunct
basedirs it's very simple: first replay the changeset on the target, then
execute rsync to copy updated files.

Location:
vcpx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/cvsps.py

    r1281 r1282  
    745745        """ 
    746746 
    747         from os import rename 
    748         from os.path import join 
    749  
    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  
    759747        self._removePathnames([oldname]) 
    760748        self._addPathnames([newname]) 
  • vcpx/repository/svn.py

    r1281 r1282  
    615615        # --force in case the file has been changed and moved in one revision 
    616616        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 
    639635        move = ExternalCommand(cwd=self.repository.basedir, command=cmd) 
    640636        out, err = move.execute(oldname, newname, stdout=PIPE, stderr=PIPE) 
    641637        if move.exit_status: 
    642             if self.shared_basedirs and unmoved: 
     638            if unmoved: 
    643639                rename(oldpath, newpath) 
    644640            raise ChangesetApplicationFailure("%s returned status %d saying\n%s" 
  • vcpx/dualwd.py

    r1281 r1282  
    103103 
    104104    def replayChangeset(self, changeset): 
    105         self.target.replayChangeset(changeset) 
    106105        if not self.shared_basedirs: 
    107106            self._syncTargetWithSource() 
     107        self.target.replayChangeset(changeset) 
    108108 
    109109    def _syncTargetWithSource(self): 
  • vcpx/repository/bzr.py

    r1281 r1282  
    304304        from os.path import join, exists 
    305305 
    306         if self.shared_basedirs: 
    307             # bzr does the rename itself as well 
    308             unmoved = False 
    309             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 = True 
     306        # 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 
    318318 
    319319        self.log.info('Renaming %r to %r...', oldname, newname) 
     
    321321            self._working_tree.rename_one(oldname, newname) 
    322322        except: 
    323             if self.shared_basedirs and unmoved: 
     323            if unmoved: 
    324324                rename(oldpath, newpath) 
    325325            raise 
Note: See TracChangeset for help on using the changeset viewer.