Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 44254:293cab97a766
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Jan 2020 15:18:19 -0800 |
parents | bd4f666b55a7 |
children | d4c1501225c4 |
comparison
equal
deleted
inserted
replaced
44253:bd4f666b55a7 | 44254:293cab97a766 |
---|---|
4879 if node is None: | 4879 if node is None: |
4880 raise error.Abort(_(b'merging with the working copy has no effect')) | 4880 raise error.Abort(_(b'merging with the working copy has no effect')) |
4881 | 4881 |
4882 if opts.get(b'preview'): | 4882 if opts.get(b'preview'): |
4883 # find nodes that are ancestors of p2 but not of p1 | 4883 # find nodes that are ancestors of p2 but not of p1 |
4884 p1 = repo.lookup(b'.') | 4884 p1 = repo[b'.'].node() |
4885 p2 = node | 4885 p2 = node |
4886 nodes = repo.changelog.findmissing(common=[p1], heads=[p2]) | 4886 nodes = repo.changelog.findmissing(common=[p1], heads=[p2]) |
4887 | 4887 |
4888 displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | 4888 displayer = logcmdutil.changesetdisplayer(ui, repo, opts) |
4889 for node in nodes: | 4889 for node in nodes: |