##// END OF EJS Templates
rebase: use bookmarks.recordchange instead of bookmarks.write...
Laurent Charignon -
r27059:405320cd default
parent child Browse files
Show More
@@ -555,14 +555,19 b' def rebase(ui, repo, **opts):'
555 collapsedas = newnode
555 collapsedas = newnode
556 clearrebased(ui, repo, state, skipped, collapsedas)
556 clearrebased(ui, repo, state, skipped, collapsedas)
557
557
558 if True:
558 tr = None
559 try:
560 tr = repo.transaction('bookmark')
559 if currentbookmarks:
561 if currentbookmarks:
560 updatebookmarks(repo, targetnode, nstate, currentbookmarks)
562 updatebookmarks(repo, targetnode, nstate, currentbookmarks, tr)
561 if activebookmark not in repo._bookmarks:
563 if activebookmark not in repo._bookmarks:
562 # active bookmark was divergent one and has been deleted
564 # active bookmark was divergent one and has been deleted
563 activebookmark = None
565 activebookmark = None
566 clearstatus(repo)
567 tr.close()
568 finally:
569 release(tr)
564
570
565 clearstatus(repo)
566 ui.note(_("rebase completed\n"))
571 ui.note(_("rebase completed\n"))
567 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
572 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
568 if skipped:
573 if skipped:
@@ -817,7 +822,7 b' def updatemq(repo, state, skipped, **opt'
817 mq.seriesdirty = True
822 mq.seriesdirty = True
818 mq.savedirty()
823 mq.savedirty()
819
824
820 def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
825 def updatebookmarks(repo, targetnode, nstate, originalbookmarks, tr):
821 'Move bookmarks to their correct changesets, and delete divergent ones'
826 'Move bookmarks to their correct changesets, and delete divergent ones'
822 marks = repo._bookmarks
827 marks = repo._bookmarks
823 for k, v in originalbookmarks.iteritems():
828 for k, v in originalbookmarks.iteritems():
@@ -825,8 +830,7 b' def updatebookmarks(repo, targetnode, ns'
825 # update the bookmarks for revs that have moved
830 # update the bookmarks for revs that have moved
826 marks[k] = nstate[v]
831 marks[k] = nstate[v]
827 bookmarks.deletedivergent(repo, [targetnode], k)
832 bookmarks.deletedivergent(repo, [targetnode], k)
828
833 marks.recordchange(tr)
829 marks.write()
830
834
831 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
835 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
832 external, activebookmark):
836 external, activebookmark):
General Comments 0
You need to be logged in to leave comments. Login now