mozhg: access active bookmark properly (
bug 1241615); r?dminor
Mercurial 3.7 changed the API yet again. It looks like
repo._activebookmark is the most appropriate way to access the active
bookmark, so just use that if it is defined.
--- a/pylib/mozhg/mozhg/rewrite.py
+++ b/pylib/mozhg/mozhg/rewrite.py
@@ -13,18 +13,21 @@ import mercurial.hg as hg
import mercurial.lock as lockmod
import mercurial.obsolete as obsolete
import mercurial.phases as phases
import mercurial.repair as repair
import mercurial.util as util
# Mercurial 3.5 renamed readcurrent to readactive.
+# Mercurial 3.7 renamed readactive to _readactive.
def activebookmark(repo):
- if hasattr(bookmarks, 'readactive'):
+ if hasattr(repo, '_activebookmark'):
+ return repo._activebookmark
+ elif hasattr(bookmarks, 'readactive'):
return bookmarks.readactive(repo)
else:
return bookmarks.readcurrent(repo)
def newparents(repo, ctx, revmap):
"""Obtain the parent nodes of a potentially rewritten changeset.