Changeset 1281 in tailor for vcpx/repository/bzr.py


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

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/bzr.py

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