comparison hgext/evolve.py @ 1335:50a40a8cf7be stable

evolve: current bookmark wrongly moving during prune (issue4559) Before this patch: prune -r <otherbookmark> also moved the current bookmark eventhough it was not related to the pruned changes. This patch fixes it and adds a test to catch regressions.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 13 May 2015 08:47:27 -0700
parents efb75f4d55aa
children f455ce2a3587
comparison
equal deleted inserted replaced
1330:efb75f4d55aa 1335:50a40a8cf7be
861 861
862 def _bookmarksupdater(repo, oldid): 862 def _bookmarksupdater(repo, oldid):
863 """Return a callable update(newid) updating the current bookmark 863 """Return a callable update(newid) updating the current bookmark
864 and bookmarks bound to oldid to newid. 864 and bookmarks bound to oldid to newid.
865 """ 865 """
866 bm = bmactive(repo)
867 def updatebookmarks(newid): 866 def updatebookmarks(newid):
868 dirty = False 867 dirty = False
869 if bm:
870 repo._bookmarks[bm] = newid
871 dirty = True
872 oldbookmarks = repo.nodebookmarks(oldid) 868 oldbookmarks = repo.nodebookmarks(oldid)
873 if oldbookmarks: 869 if oldbookmarks:
874 for b in oldbookmarks: 870 for b in oldbookmarks:
875 repo._bookmarks[b] = newid 871 repo._bookmarks[b] = newid
876 dirty = True 872 dirty = True