From patchwork Thu Jan 16 01:21:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7898: merge: don't call update hook when using in-memory context From: phabricator X-Patchwork-Id: 44405 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Thu, 16 Jan 2020 01:21:53 +0000 martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm pretty sure many hook implementors will assume that they can inspect the working copy and/or dirstate parents when the hook is called, so I don't think we should call the hook when using an in-memory context. The new behavior matches that of the preupdate hook. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7898 AFFECTED FILES mercurial/merge.py CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -2574,7 +2574,7 @@ if not branchmerge: sparse.prunetemporaryincludes(repo) - if not partial: + if updatedirstate: repo.hook( b'update', parent1=xp1, parent2=xp2, error=stats.unresolvedcount )