D7898: merge: don't call update hook when using in-memory context

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jan 16 01:21:53 UTC 2020


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

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
         )



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list