comparison hgext/evolve.py @ 1342:16017e1bb2a1 stable

prune: with active bookmark should stay active hg prune with an active bookmark was deactivating the bookmark after the prune. This patch makes sure that if a bookmark was active before a "prune" operation (except prune -B) then the bookmark stays activate afterwards.
author Laurent Charignon <lcharignon@fb.com>
date Mon, 18 May 2015 17:24:38 -0700
parents f455ce2a3587
children 376d3df9f47b 39f2c1ab3a53
comparison
equal deleted inserted replaced
1340:f455ce2a3587 1342:16017e1bb2a1
1806 1806
1807 while newnode.obsolete(): 1807 while newnode.obsolete():
1808 newnode = newnode.parents()[0] 1808 newnode = newnode.parents()[0]
1809 1809
1810 if newnode.node() != wdp.node(): 1810 if newnode.node() != wdp.node():
1811 bookactive = bmactive(repo)
1812 # Active bookmark that we don't want to delete (with -B option)
1813 # we deactivate and move it before the update and reactivate it
1814 # after
1815 movebookmark = bookactive and not bookmark
1816 if movebookmark:
1817 bookmarks.deactivate(repo)
1818 repo._bookmarks[bookactive] = newnode.node()
1819 repo._bookmarks.write()
1811 commands.update(ui, repo, newnode.rev()) 1820 commands.update(ui, repo, newnode.rev())
1812 ui.status(_('working directory now at %s\n') % newnode) 1821 ui.status(_('working directory now at %s\n') % newnode)
1822 if movebookmark:
1823 bookmarks.activate(repo, bookactive)
1824
1813 # update bookmarks 1825 # update bookmarks
1814 if bookmark: 1826 if bookmark:
1815 _deletebookmark(ui, marks, bookmark) 1827 _deletebookmark(ui, marks, bookmark)
1816 for ctx in repo.unfiltered().set('bookmark() and %ld', precs): 1828 for ctx in repo.unfiltered().set('bookmark() and %ld', precs):
1817 # used to be: 1829 # used to be: