Patchwork D7998: merge: replace a repo.lookup('.') by more typical repo['.'].node()

login
register
mail settings
Submitter phabricator
Date Jan. 25, 2020, 12:18 a.m.
Message ID <differential-rev-PHID-DREV-yag33xcbz4wzrl3yqj25-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44647/
State Superseded
Headers show

Comments

phabricator - Jan. 25, 2020, 12:18 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The `repo.lookup('.')` form comes from b3311e26f94f <https://phab.mercurial-scm.org/rHGb3311e26f94f69eeb0e7df4fc3d7b743f3d86969> (merge: fix
  --preview to show all nodes that will be merged (issue2043).,
  2010-02-15). I don't know why that commit changed from `repo['.']`,
  but I don't think there's any reason to do that. Note that performance
  should not be a reason (anymore?), because repo.lookup() is
  implemented by first creating a context object.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4878,7 +4878,7 @@ 
 
     if opts.get(b'preview'):
         # find nodes that are ancestors of p2 but not of p1
-        p1 = repo.lookup(b'.')
+        p1 = repo[b'.'].node()
         p2 = node
         nodes = repo.changelog.findmissing(common=[p1], heads=[p2])