diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1790,7 +1790,7 @@ def amend(ui, repo, commitfunc, old, ext finally: if newid is None: repo.dirstate.invalidate() - lockmod.release(wlock, lock) + lockmod.release(lock, wlock) return newid def commiteditor(repo, ctx, subs):