changeset 1504:415a51ac07a7

merge with stable
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 14 Sep 2015 13:52:34 -0700
parents 094b54a72c1d (current diff) e8f7e4c53537 (diff)
children 53a6dbc33e36
files README hgext/evolve.py
diffstat 2 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)