# HG changeset patch # User Pierre-Yves David # Date 1442262223 25200 # Node ID 5c962163f77a0b51c724eb497f7f7cc871948928 # Parent bc7eec65dfcff71425a6adfc16790d5e15cf1ba1 prune: ensure we prune bookmarks in a transaction diff -r bc7eec65dfcf -r 5c962163f77a README --- a/README Wed Aug 12 10:51:20 2015 -0700 +++ b/README Mon Sep 14 13:23:43 2015 -0700 @@ -51,6 +51,10 @@ Changelog ========= +5.2.1 -- + +- prune: 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) diff -r bc7eec65dfcf -r 5c962163f77a hgext/evolve.py --- a/hgext/evolve.py Wed Aug 12 10:51:20 2015 -0700 +++ b/hgext/evolve.py Mon Sep 14 13:23:43 2015 -0700 @@ -2113,10 +2113,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) @@ -2170,7 +2178,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')) @@ -2264,7 +2272,7 @@ # update bookmarks if bookmark: - _deletebookmark(ui, marks, bookmark) + _deletebookmark(repo, marks, bookmark) # create markers obsolete.createmarkers(repo, relations, metadata=metadata)