diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1167,7 +1167,9 @@ def update(repo, node, branchmerge, forc wlock.release() if not partial: - repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) + def updatehook(parent1=xp1, parent2=xp2, error=stats[3]): + repo.hook('update', parent1=parent1, parent2=parent2, error=error) + repo._afterlock(updatehook) return stats def graft(repo, ctx, pctx, labels): diff --git a/tests/test-hook.t b/tests/test-hook.t --- a/tests/test-hook.t +++ b/tests/test-hook.t @@ -613,7 +613,9 @@ make sure --traceback works on hook impo Issue1827: Hooks Update & Commit not completely post operation -commit and update hooks should run after command completion +commit and update hooks should run after command completion. The largefiles +use demonstrates a recursive wlock, showing the hook doesn't run until the +final release (and dirstate flush). $ echo '[hooks]' > .hg/hgrc $ echo 'commit = hg id' >> .hg/hgrc @@ -621,7 +623,7 @@ commit and update hooks should run after $ echo bb > a $ hg ci -ma 223eafe2750c tip - $ hg up 0 + $ hg up 0 --config extensions.largefiles= cb9a9f314b8b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved