diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -719,6 +719,12 @@ def update(repo, node, branchmerge, forc "subrepository '%s'") % s) elif not overwrite: + if p1 == p2: # no-op update + # call the hooks and exit early + repo.hook('preupdate', throw=True, parent1=xp2, parent2='') + repo.hook('update', parent1=xp2, parent2='', error=0) + return 0, 0, 0, 0 + if pa not in (p1, p2): # nolinear dirty = wc.dirty(missing=True) if dirty or onode is None: diff --git a/tests/test-empty.t b/tests/test-empty.t --- a/tests/test-empty.t +++ b/tests/test-empty.t @@ -42,8 +42,6 @@ Poke at a clone: 0 files, 0 changesets, 0 total revisions $ ls .hg 00changelog.i - branch - dirstate hgrc requires store diff --git a/tests/test-mq-qpush-exact.t b/tests/test-mq-qpush-exact.t --- a/tests/test-mq-qpush-exact.t +++ b/tests/test-mq-qpush-exact.t @@ -243,6 +243,7 @@ qpush --exact --force with changes to a +cp1 $ hg qpop -aqf patch queue now empty + $ hg forget fp1 $ rm fp1 $ rm fp1.rej