git_handler: update for bookmark changes in mercurial 3.5

This commit is contained in:
Sean Farley 2015-05-12 17:05:13 -07:00
parent 09a1dd77d6
commit 057929f2ba

View File

@ -262,7 +262,11 @@ class GitHandler(object):
bms = getattr(self.repo['tip'], 'bookmarks',
lambda: None)()
if bms:
bookmarks.setcurrent(self.repo, bms[0])
try:
bookmarks.activate(self.repo, bms[0])
except AttributeError:
# hg < 3.5
bookmarks.setcurrent(self.repo, bms[0])
self.save_map(self.map_file)
@ -1010,7 +1014,11 @@ class GitHandler(object):
except NameError:
bookmarks.bookmark(self.ui, self.repo, 'master',
rev=tip, force=True)
bookmarks.setcurrent(self.repo, 'master')
try:
bookmarks.activate(self.repo, 'master')
except AttributeError:
# hg < 3.5
bookmarks.setcurrent(self.repo, 'master')
new_refs['refs/heads/master'] = self.map_git_get(tip)
for rev, rev_refs in exportable.iteritems():