Mercurial > hg-git
diff hggit/git_handler.py @ 1139:8e03a8ba04af
compat: find the right method to set active bookmark once
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Wed, 07 Feb 2018 22:30:17 -0600 |
parents | 7fd9ee0f7b66 |
children | 583ac3ddd54b |
line wrap: on
line diff
--- a/hggit/git_handler.py Wed Feb 07 22:18:35 2018 -0600 +++ b/hggit/git_handler.py Wed Feb 07 22:30:17 2018 -0600 @@ -18,7 +18,6 @@ from mercurial.i18n import _ from mercurial.node import hex, bin, nullid from mercurial import ( - bookmarks, commands, context, encoding, @@ -324,11 +323,7 @@ bms = [rhead + suffix] if bms: - # COMPAT: hg 3.5 - bookmarks.setcurrent renamed to activate - try: - bookmarks.activate(self.repo, bms[0]) - except AttributeError: - bookmarks.setcurrent(self.repo, bms[0]) + compat.activatebookmark(self.repo, bms[0]) self.save_map(self.map_file) @@ -1156,11 +1151,7 @@ tip = hex(tip) commands.bookmark(self.ui, self.repo, 'master', rev=tip, force=True) - # COMPAT: hg 3.5 - bookmarks.setcurrent renamed to activate - try: - bookmarks.activate(self.repo, 'master') - except AttributeError: - bookmarks.setcurrent(self.repo, 'master') + compat.activatebookmark(self.repo, 'master') new_refs['refs/heads/master'] = self.map_git_get(tip) # mapped nodes might be hidden