comparison hgext/evolve.py @ 1389:87aceaed5c69 stable

prune: use the bookmark wrapper for 3.4 compatibility
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 18:12:24 -0700
parents b5eaec8a53d0
children 03f202bed47f
comparison
equal deleted inserted replaced
1387:eb044bcf342d 1389:87aceaed5c69
895 def bmdeactivate(repo): 895 def bmdeactivate(repo):
896 try: 896 try:
897 return bookmarks.deactivate(repo) 897 return bookmarks.deactivate(repo)
898 except AttributeError: 898 except AttributeError:
899 return bookmarks.unsetcurrent(repo) 899 return bookmarks.unsetcurrent(repo)
900 def bmactivate(repo, book):
901 try:
902 return bookmarks.activate(repo, book)
903 except AttributeError:
904 return bookmarks.setcurrent(repo, book)
900 905
901 def bmactive(repo): 906 def bmactive(repo):
902 try: 907 try:
903 return repo._activebookmark 908 return repo._activebookmark
904 except AttributeError: 909 except AttributeError:
1830 # Active bookmark that we don't want to delete (with -B option) 1835 # Active bookmark that we don't want to delete (with -B option)
1831 # we deactivate and move it before the update and reactivate it 1836 # we deactivate and move it before the update and reactivate it
1832 # after 1837 # after
1833 movebookmark = bookactive and not bookmark 1838 movebookmark = bookactive and not bookmark
1834 if movebookmark: 1839 if movebookmark:
1835 bookmarks.deactivate(repo) 1840 bmdeactivate(repo)
1836 repo._bookmarks[bookactive] = newnode.node() 1841 repo._bookmarks[bookactive] = newnode.node()
1837 repo._bookmarks.write() 1842 repo._bookmarks.write()
1838 commands.update(ui, repo, newnode.rev()) 1843 commands.update(ui, repo, newnode.rev())
1839 ui.status(_('working directory now at %s\n') % newnode) 1844 ui.status(_('working directory now at %s\n') % newnode)
1840 if movebookmark: 1845 if movebookmark:
1841 bookmarks.activate(repo, bookactive) 1846 bmactivate(repo, bookactive)
1842 1847
1843 # update bookmarks 1848 # update bookmarks
1844 if bookmark: 1849 if bookmark:
1845 _deletebookmark(ui, marks, bookmark) 1850 _deletebookmark(ui, marks, bookmark)
1846 for ctx in repo.unfiltered().set('bookmark() and %ld', precs): 1851 for ctx in repo.unfiltered().set('bookmark() and %ld', precs):