# HG changeset patch # User Alexis S. L. Carvalho # Date 1174342060 10800 # Node ID 89075f10641408fad1249103e5c30e8949039f14 # Parent cc81c512a5316a025f2ca8bb0c1113b5d28b83bb debugsetparents: wlock the repo before updating the dirstate diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -764,7 +764,11 @@ def debugsetparents(ui, repo, rev1, rev2 if not rev2: rev2 = hex(nullid) - repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2)) + wlock = repo.wlock() + try: + repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2)) + finally: + wlock.release() def debugstate(ui, repo): """show the contents of the current dirstate"""