# HG changeset patch # User Alexis S. L. Carvalho # Date 1186030568 10800 # Node ID 47a8ea1eb2c3d045dbc240e614822df2408e6c2b # Parent a11e8a181bd5b8d0797393951678cfb5424113dd del transaction before lock before wlock This way rollbacks happen while the repo is still locked. Deleting lock before wlock is not strictly necessary, but is more consistent with the locking order. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -455,7 +455,7 @@ class queue: repo.dirstate.invalidate() raise finally: - del lock, wlock, tr + del tr, lock, wlock def _apply(self, repo, series, list=False, update_status=True, strict=False, patchdir=None, merge=None, all_files={}): diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1623,7 +1623,7 @@ def import_(ui, repo, patch1, *patches, finally: os.unlink(tmpname) finally: - del wlock, lock + del lock, wlock def incoming(ui, repo, source="default", **opts): """show new changesets found in source diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -544,7 +544,7 @@ class localrepository(repo.repository): else: self.ui.warn(_("no rollback information available\n")) finally: - del wlock, lock + del lock, wlock def invalidate(self): for a in "changelog manifest".split(): @@ -820,7 +820,7 @@ class localrepository(repo.repository): self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2) return n finally: - del lock, wlock, tr + del tr, lock, wlock def walk(self, node=None, files=[], match=util.always, badmatch=None): '''