merge with stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 14 Sep 2015 13:52:34 -0700
changeset 1504 415a51ac07a7
parent 1502 094b54a72c1d (current diff)
parent 1503 e8f7e4c53537 (diff)
child 1505 53a6dbc33e36
merge with stable
README
hgext/evolve.py
--- a/README	Mon Sep 14 13:48:34 2015 -0700
+++ b/README	Mon Sep 14 13:52:34 2015 -0700
@@ -56,6 +56,11 @@
 - split: add a new command to split changesets
 - add some progress data during changesets discovery
 
+5.2.1 --
+
+- prune: fixed possible issue with lock and bookmark
+- next/prev: fixed possible issue with lock and bookmark
+
 5.2.0 -- 2015-06-25
 
 - evolve: gain a --rev option to control what revisions to evolve (issue4391)
--- a/hgext/evolve.py	Mon Sep 14 13:48:34 2015 -0700
+++ b/hgext/evolve.py	Mon Sep 14 13:52:34 2015 -0700
@@ -2142,10 +2142,18 @@
         revs = sorted(revs)
     return marks, revs
 
-def _deletebookmark(ui, marks, mark):
-    del marks[mark]
-    marks.write()
-    ui.write(_("bookmark '%s' deleted\n") % mark)
+def _deletebookmark(repo, marks, mark):
+    wlock = lock = tr = None
+    try:
+        wlock = repo.wlock()
+        lock = repo.lock()
+        tr = repo.transaction('prune')
+        del marks[mark]
+        marks.recordchange(tr)
+        tr.close()
+        repo.ui.write(_("bookmark '%s' deleted\n") % mark)
+    finally:
+        lockmod.release(tr, lock, wlock)
 
 
 
@@ -2211,7 +2219,7 @@
         marks,revs = _reachablefrombookmark(repo, revs, bookmark)
         if not revs:
             # no revisions to prune - delete bookmark immediately
-            _deletebookmark(ui, marks, bookmark)
+            _deletebookmark(repo, marks, bookmark)
 
     if not revs:
         raise util.Abort(_('nothing to prune'))
@@ -2310,7 +2318,7 @@
 
         # update bookmarks
         if bookmark:
-            _deletebookmark(ui, marks, bookmark)
+            _deletebookmark(repo, marks, bookmark)
 
         # create markers
         obsolete.createmarkers(repo, relations, metadata=metadata)