--- a/hgext3rd/evolve/__init__.py Sun Jul 23 06:11:33 2017 +0200
+++ b/hgext3rd/evolve/__init__.py Sun Jul 23 06:14:09 2017 +0200
@@ -2110,22 +2110,6 @@
finally:
lockmod.release(wlock)
-def _deletebookmark(repo, repomarks, bookmarks):
- wlock = lock = tr = None
- try:
- wlock = repo.wlock()
- lock = repo.lock()
- tr = repo.transaction('prune')
- bmchanges = []
- for bookmark in bookmarks:
- bmchanges.append((bookmark, None))
- compat.bookmarkapplychanges(repo, tr, bmchanges)
- tr.close()
- for bookmark in sorted(bookmarks):
- repo.ui.write(_("bookmark '%s' deleted\n") % bookmark)
- finally:
- lockmod.release(tr, lock, wlock)
-
def _getmetadata(**opts):
metadata = {}
date = opts.get('date')
@@ -2192,7 +2176,7 @@
repomarks, revs = reachablefrombookmark(repo, revs, bookmarks)
if not revs:
# no revisions to prune - delete bookmark immediately
- _deletebookmark(repo, repomarks, bookmarks)
+ rewriteutil.deletebookmark(repo, repomarks, bookmarks)
if not revs:
raise error.Abort(_('nothing to prune'))
@@ -2295,7 +2279,7 @@
# update bookmarks
if bookmarks:
- _deletebookmark(repo, repomarks, bookmarks)
+ rewriteutil.deletebookmark(repo, repomarks, bookmarks)
# create markers
obsolete.createmarkers(repo, relations, metadata=metadata)
--- a/hgext3rd/evolve/rewriteutil.py Sun Jul 23 06:11:33 2017 +0200
+++ b/hgext3rd/evolve/rewriteutil.py Sun Jul 23 06:14:09 2017 +0200
@@ -72,6 +72,22 @@
raise error.Abort(msg, hint=hint)
return root, head
+def deletebookmark(repo, repomarks, bookmarks):
+ wlock = lock = tr = None
+ try:
+ wlock = repo.wlock()
+ lock = repo.lock()
+ tr = repo.transaction('prune')
+ bmchanges = []
+ for bookmark in bookmarks:
+ bmchanges.append((bookmark, None))
+ compat.bookmarkapplychanges(repo, tr, bmchanges)
+ tr.close()
+ for bookmark in sorted(bookmarks):
+ repo.ui.write(_("bookmark '%s' deleted\n") % bookmark)
+ finally:
+ lockmod.release(tr, lock, wlock)
+
def presplitupdate(repo, ui, prev, ctx):
"""prepare the working directory for a split (for topic hooking)
"""