# HG changeset patch # User Pierre-Yves David # Date 1442263714 25200 # Node ID e8f7e4c5353792aa35a304fd601f6037d420297e # Parent 5c962163f77a0b51c724eb497f7f7cc871948928 next/prev: properly lock repo before touching bookmarks diff -r 5c962163f77a -r e8f7e4c53537 README --- a/README Mon Sep 14 13:23:43 2015 -0700 +++ b/README Mon Sep 14 13:48:34 2015 -0700 @@ -54,6 +54,7 @@ 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 diff -r 5c962163f77a -r e8f7e4c53537 hgext/evolve.py --- a/hgext/evolve.py Mon Sep 14 13:23:43 2015 -0700 +++ b/hgext/evolve.py Mon Sep 14 13:48:34 2015 -0700 @@ -2004,11 +2004,15 @@ shouldmove = opts.get('move_bookmark') and bm is not None ret = hg.update(repo, p.rev()) if not ret: - if shouldmove: - repo._bookmarks[bm] = p.node() - repo._bookmarks.write() - else: - bmdeactivate(repo) + wlock = repo.wlock() + try: + if shouldmove: + repo._bookmarks[bm] = p.node() + repo._bookmarks.write() + else: + bmdeactivate(repo) + finally: + wlock.release() displayer.show(p) return 0 else: @@ -2048,11 +2052,15 @@ shouldmove = opts.get('move_bookmark') and bm is not None ret = hg.update(repo, c.rev()) if not ret: - if shouldmove: - repo._bookmarks[bm] = c.node() - repo._bookmarks.write() - else: - bmdeactivate(repo) + wlock = repo.wlock() + try: + if shouldmove: + repo._bookmarks[bm] = c.node() + repo._bookmarks.write() + else: + bmdeactivate(repo) + finally: + wlock.release() displayer.show(c) result = 0 elif children: