# HG changeset patch # User Pierre-Yves David # Date 1634261308 -7200 # Node ID 7d1e60244561b7f15e5bc7790eee48a112224c11 # Parent 607e9322fc89d96d160ffd5cc9c6a785f46cd23e path: keep the path instance in the `pulloperation` This will allow more pull code to use the path options. Ideally we would modify the peer API to keep the path instance. However that is much more churn that I can deal with for my current goal: adjusting a user facing API for a new feature before we release it in the 6.0 changesets. So I am taking a shortcut that seems reasonable. Differential Revision: https://phab.mercurial-scm.org/D11674 diff -r 607e9322fc89 -r 7d1e60244561 hgext/convert/hg.py --- a/hgext/convert/hg.py Fri Oct 15 02:44:14 2021 +0200 +++ b/hgext/convert/hg.py Fri Oct 15 03:28:28 2021 +0200 @@ -145,7 +145,7 @@ _(b'pulling from %s into %s\n') % (pbranch, branch) ) exchange.pull( - self.repo, prepo, [prepo.lookup(h) for h in heads] + self.repo, prepo, heads=[prepo.lookup(h) for h in heads] ) self.before() diff -r 607e9322fc89 -r 7d1e60244561 mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Fri Oct 15 02:44:14 2021 +0200 +++ b/mercurial/bundlerepo.py Fri Oct 15 03:28:28 2021 +0200 @@ -699,7 +699,9 @@ }, ).result() - pullop = exchange.pulloperation(bundlerepo, peer, heads=reponodes) + pullop = exchange.pulloperation( + bundlerepo, peer, path=None, heads=reponodes + ) pullop.trmanager = bundletransactionmanager() exchange._pullapplyphases(pullop, remotephases) diff -r 607e9322fc89 -r 7d1e60244561 mercurial/commands.py --- a/mercurial/commands.py Fri Oct 15 02:44:14 2021 +0200 +++ b/mercurial/commands.py Fri Oct 15 03:28:28 2021 +0200 @@ -5454,6 +5454,7 @@ modheads = exchange.pull( repo, other, + path=path, heads=nodes, force=opts.get(b'force'), bookmarks=opts.get(b'bookmark', ()), diff -r 607e9322fc89 -r 7d1e60244561 mercurial/exchange.py --- a/mercurial/exchange.py Fri Oct 15 02:44:14 2021 +0200 +++ b/mercurial/exchange.py Fri Oct 15 03:28:28 2021 +0200 @@ -1378,6 +1378,7 @@ self, repo, remote, + path, heads=None, force=False, bookmarks=(), @@ -1391,6 +1392,10 @@ self.repo = repo # repo we pull from self.remote = remote + # path object used to build this remote + # + # Ideally, the remote peer would carry that directly. + self.remote_path = path # revision we try to pull (None is "all") self.heads = heads # bookmark pulled explicitly @@ -1556,6 +1561,7 @@ def pull( repo, remote, + path=None, heads=None, force=False, bookmarks=(), @@ -1611,8 +1617,9 @@ pullop = pulloperation( repo, remote, - heads, - force, + path=path, + heads=heads, + force=force, bookmarks=bookmarks, streamclonerequested=streamclonerequested, includepats=includepats, diff -r 607e9322fc89 -r 7d1e60244561 mercurial/hg.py --- a/mercurial/hg.py Fri Oct 15 02:44:14 2021 +0200 +++ b/mercurial/hg.py Fri Oct 15 03:28:28 2021 +0200 @@ -942,7 +942,7 @@ exchange.pull( local, srcpeer, - revs, + heads=revs, streamclonerequested=stream, includepats=storeincludepats, excludepats=storeexcludepats,