--- a/hgext/evolve.py Thu Dec 10 15:34:34 2015 -0800
+++ b/hgext/evolve.py Thu Dec 10 15:55:07 2015 -0800
@@ -86,7 +86,7 @@
# Flags for enabling optional parts of evolve
commandopt = 'allnewcommands'
-from mercurial import bookmarks
+from mercurial import bookmarks as bookmarksmod
from mercurial import cmdutil
from mercurial import commands
from mercurial import context
@@ -1018,14 +1018,14 @@
### bookmarks api compatibility layer ###
def bmdeactivate(repo):
try:
- return bookmarks.deactivate(repo)
+ return bookmarksmod.deactivate(repo)
except AttributeError:
- return bookmarks.unsetcurrent(repo)
+ return bookmarksmod.unsetcurrent(repo)
def bmactivate(repo, book):
try:
- return bookmarks.activate(repo, book)
+ return bookmarksmod.activate(repo, book)
except AttributeError:
- return bookmarks.setcurrent(repo, book)
+ return bookmarksmod.setcurrent(repo, book)
def bmactive(repo):
try:
@@ -2208,46 +2208,46 @@
return 1
return result
-def _reachablefrombookmark(repo, revs, mark):
+def _reachablefrombookmark(repo, revs, bookmark):
"""filter revisions and bookmarks reachable from the given bookmark
yoinked from mq.py
"""
- marks = repo._bookmarks
- if mark not in marks:
- raise error.Abort(_("bookmark '%s' not found") % mark)
+ repomarks = repo._bookmarks
+ if bookmark not in repomarks:
+ raise error.Abort(_("bookmark '%s' not found") % bookmark)
# If the requested bookmark is not the only one pointing to a
# a revision we have to only delete the bookmark and not strip
# anything. revsets cannot detect that case.
uniquebm = True
- for m, n in marks.iteritems():
- if m != mark and n == repo[mark].node():
+ for m, n in repomarks.iteritems():
+ if m != bookmark and n == repo[bookmark].node():
uniquebm = False
break
if uniquebm:
if util.safehasattr(repair, 'stripbmrevset'):
- rsrevs = repair.stripbmrevset(repo, mark)
+ rsrevs = repair.stripbmrevset(repo, bookmark)
else:
rsrevs = repo.revs("ancestors(bookmark(%s)) - "
"ancestors(head() and not bookmark(%s)) - "
"ancestors(bookmark() and not bookmark(%s)) - "
"obsolete()",
- mark, mark, mark)
+ bookmark, bookmark, bookmark)
revs = set(revs)
revs.update(set(rsrevs))
revs = sorted(revs)
- return marks, revs
-
-def _deletebookmark(repo, marks, mark):
+ return repomarks, revs
+
+def _deletebookmark(repo, repomarks, bookmark):
wlock = lock = tr = None
try:
wlock = repo.wlock()
lock = repo.lock()
tr = repo.transaction('prune')
- del marks[mark]
- marks.recordchange(tr)
+ del repomarks[bookmark]
+ repomarks.recordchange(tr)
tr.close()
- repo.ui.write(_("bookmark '%s' deleted\n") % mark)
+ repo.ui.write(_("bookmark '%s' deleted\n") % bookmark)
finally:
lockmod.release(tr, lock, wlock)
@@ -2314,10 +2314,10 @@
raise error.Abort(_("can only specify one of %s") % ', '.join(options))
if bookmark:
- marks, revs = _reachablefrombookmark(repo, revs, bookmark)
+ repomarks, revs = _reachablefrombookmark(repo, revs, bookmark)
if not revs:
# no revisions to prune - delete bookmark immediately
- _deletebookmark(repo, marks, bookmark)
+ _deletebookmark(repo, repomarks, bookmark)
if not revs:
raise error.Abort(_('nothing to prune'))
@@ -2418,7 +2418,7 @@
# update bookmarks
if bookmark:
- _deletebookmark(repo, marks, bookmark)
+ _deletebookmark(repo, repomarks, bookmark)
# create markers
obsolete.createmarkers(repo, relations, metadata=metadata)