Mercurial > hg
changeset 25445:1457c1f28c92
pull: allow a generic way to pass parameters to the pull operation
We have been feeling the need for this in extensions for quite some time. This
will be used to pass remote bookmark information around in the next changesets.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 02 Jun 2015 00:43:11 -0700 |
parents | 1d1fd5d44f57 |
children | b5311068077e |
files | mercurial/commands.py mercurial/exchange.py |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Jun 01 22:29:49 2015 -0700 +++ b/mercurial/commands.py Tue Jun 02 00:43:11 2015 -0700 @@ -5120,6 +5120,7 @@ opts.get('rev')) + pullopargs = {} if opts.get('bookmark'): if not revs: revs = [] @@ -5152,7 +5153,8 @@ modheads = exchange.pull(repo, other, heads=revs, force=opts.get('force'), - bookmarks=opts.get('bookmark', ())).cgresult + bookmarks=opts.get('bookmark', ()), + opargs=pullopargs).cgresult if checkout: checkout = str(repo.changelog.rev(checkout)) repo._subtoppath = source
--- a/mercurial/exchange.py Mon Jun 01 22:29:49 2015 -0700 +++ b/mercurial/exchange.py Tue Jun 02 00:43:11 2015 -0700 @@ -886,8 +886,11 @@ if self._tr is not None: self._tr.release() -def pull(repo, remote, heads=None, force=False, bookmarks=()): - pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks) +def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None): + if opargs is None: + opargs = {} + pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks, + **opargs) if pullop.remote.local(): missing = set(pullop.remote.requirements) - pullop.repo.supported if missing: