Mercurial > public > mercurial-scm > hg-stable
diff hgext/fetch.py @ 44454:2f290136b7d6
merge: make hg.merge() take a context instead of a node
Many callers already have a repo, so we might as well pass
that. `merge.update()` will look up the context object later. This
patch is part of making it so we pass around the context object all
the way down instead.
I also removed the `repo` argument since it can be retrieved from the
context.
Differential Revision: https://phab.mercurial-scm.org/D7999
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Jan 2020 15:28:37 -0800 |
parents | 8ff1ecfadcd1 |
children | 89a2afe31e82 |
line wrap: on
line diff
--- a/hgext/fetch.py Fri Jan 17 21:22:23 2020 +0300 +++ b/hgext/fetch.py Fri Jan 24 15:28:37 2020 -0800 @@ -171,11 +171,11 @@ % (repo.changelog.rev(firstparent), short(firstparent)) ) hg.clean(repo, firstparent) + p2ctx = repo[secondparent] ui.status( - _(b'merging with %d:%s\n') - % (repo.changelog.rev(secondparent), short(secondparent)) + _(b'merging with %d:%s\n') % (p2ctx.rev(), short(secondparent)) ) - err = hg.merge(repo, secondparent, remind=False) + err = hg.merge(p2ctx, remind=False) if not err: # we don't translate commit messages