hgext/rebase.py
branchstable
changeset 17046 4116504d1ec4
parent 17026 f8af57c00a29
child 17059 fba17a64fa49
equal deleted inserted replaced
17045:52ea9ce5b641 17046:4116504d1ec4
   245             targetancestors = set(repo.changelog.ancestors(target))
   245             targetancestors = set(repo.changelog.ancestors(target))
   246             targetancestors.add(target)
   246             targetancestors.add(target)
   247 
   247 
   248         # Keep track of the current bookmarks in order to reset them later
   248         # Keep track of the current bookmarks in order to reset them later
   249         currentbookmarks = repo._bookmarks.copy()
   249         currentbookmarks = repo._bookmarks.copy()
       
   250         activebookmark = repo._bookmarkcurrent
       
   251         if activebookmark:
       
   252             bookmarks.unsetcurrent(repo)
   250 
   253 
   251         sortedstate = sorted(state)
   254         sortedstate = sorted(state)
   252         total = len(sortedstate)
   255         total = len(sortedstate)
   253         pos = 0
   256         pos = 0
   254         for rev in sortedstate:
   257         for rev in sortedstate:
   334         ui.note(_("rebase completed\n"))
   337         ui.note(_("rebase completed\n"))
   335         if os.path.exists(repo.sjoin('undo')):
   338         if os.path.exists(repo.sjoin('undo')):
   336             util.unlinkpath(repo.sjoin('undo'))
   339             util.unlinkpath(repo.sjoin('undo'))
   337         if skipped:
   340         if skipped:
   338             ui.note(_("%d revisions have been skipped\n") % len(skipped))
   341             ui.note(_("%d revisions have been skipped\n") % len(skipped))
       
   342 
       
   343         if (activebookmark and
       
   344             repo['tip'].node() == repo._bookmarks[activebookmark]):
       
   345                 bookmarks.setcurrent(repo, activebookmark)
       
   346 
   339     finally:
   347     finally:
   340         release(lock, wlock)
   348         release(lock, wlock)
   341 
   349 
   342 def checkexternal(repo, state, targetancestors):
   350 def checkexternal(repo, state, targetancestors):
   343     """Check whether one or more external revisions need to be taken in
   351     """Check whether one or more external revisions need to be taken in
   481         mq.seriesdirty = True
   489         mq.seriesdirty = True
   482         mq.savedirty()
   490         mq.savedirty()
   483 
   491 
   484 def updatebookmarks(repo, nstate, originalbookmarks, **opts):
   492 def updatebookmarks(repo, nstate, originalbookmarks, **opts):
   485     'Move bookmarks to their correct changesets'
   493     'Move bookmarks to their correct changesets'
   486     current = repo._bookmarkcurrent
       
   487     for k, v in originalbookmarks.iteritems():
   494     for k, v in originalbookmarks.iteritems():
   488         if v in nstate:
   495         if v in nstate:
   489             if nstate[v] != nullmerge:
   496             if nstate[v] != nullmerge:
   490                 # reset the pointer if the bookmark was moved incorrectly
   497                 # update the bookmarks for revs that have moved
   491                 if k != current:
   498                 repo._bookmarks[k] = nstate[v]
   492                     repo._bookmarks[k] = nstate[v]
       
   493 
   499 
   494     bookmarks.write(repo)
   500     bookmarks.write(repo)
   495 
   501 
   496 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
   502 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
   497                                                                 external):
   503                                                                 external):