# HG changeset patch # User Pierre-Yves David # Date 1442263714 25200 # Node ID 094b54a72c1d6f5fc2ad6b9bee0b5ca421679f51 # Parent b4dfafda72c2b54a7f8084d1e84819440bd1f243 next/prev: properly lock repo before touching bookmarks diff -r b4dfafda72c2 -r 094b54a72c1d hgext/evolve.py --- a/hgext/evolve.py Thu Sep 10 16:24:50 2015 -0400 +++ b/hgext/evolve.py Mon Sep 14 13:48:34 2015 -0700 @@ -2018,11 +2018,15 @@ else: 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: @@ -2069,11 +2073,15 @@ else: 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: