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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jan 23 12:24:36 EST 2020


martinvonz added a comment.


  In D7898#117294 <https://phab.mercurial-scm.org/D7898#117294>, @marmoute wrote:
  
  > I don't see any mention of "in-memory" in the current hook documentation. Can you clarify to which section we are thinking about?
  
  Specifically the section about the "update" hook:
  
    $ hg help config.hooks.update
        "hooks.update"
          Run after updating the working directory. The changeset ID of first new
          parent is in "$HG_PARENT1". If updating to a merge, the ID of second new
          parent is in "$HG_PARENT2". If the update succeeded, "$HG_ERROR=0". If
          the update failed (e.g. because conflicts were not resolved),
          "$HG_ERROR=1".
  
  As you can see, the first sentence is "Run after updating the working directory.". Since in-memory rebase doesn't update the working copy, it doesn't make sense to call the hook (just like we don't call the "pre-update" hook).
  
  > Otherwise, yes… we should not call the `update` hook if we are not touching the working directory. Should this hook call be elsewhere ? (for example, at the place where we update the dirstate parents ?
  
  I think it's right after `sparse.prunetemporaryincludes(repo)` on purpose.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7898/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7898

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


More information about the Mercurial-devel mailing list