merge: replace a repo.lookup('.') by more typical repo['.'].node()
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 24 Jan 2020 15:18:19 -0800
changeset 44254 293cab97a766
parent 44253 bd4f666b55a7
child 44255 d84420232492
merge: replace a repo.lookup('.') by more typical repo['.'].node() The `repo.lookup('.')` form comes from b3311e26f94f (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. Differential Revision: https://phab.mercurial-scm.org/D7998
mercurial/commands.py
--- a/mercurial/commands.py	Fri Jan 24 16:07:42 2020 -0800
+++ b/mercurial/commands.py	Fri Jan 24 15:18:19 2020 -0800
@@ -4881,7 +4881,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])