Mercurial > public > mercurial-scm > hg-stable
diff mercurial/exchange.py @ 49876:4188e75af983
bundleoperation: optionnaly record the `remote` that produced the bundle
We have the information at hand, and the peer now have knownledge of its `path` object, which constaints useful behavior configuration.
So the simpler seems to be to pass that object around so it can be used if
needed.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Dec 2022 01:16:22 +0100 |
parents | 04cdb442a892 |
children | 58adcabc295f |
line wrap: on
line diff
--- a/mercurial/exchange.py Mon Dec 05 03:23:46 2022 +0100 +++ b/mercurial/exchange.py Sat Dec 03 01:16:22 2022 +0100 @@ -1183,7 +1183,12 @@ trgetter = None if pushback: trgetter = pushop.trmanager.transaction - op = bundle2.processbundle(pushop.repo, reply, trgetter) + op = bundle2.processbundle( + pushop.repo, + reply, + trgetter, + remote=pushop.remote, + ) except error.BundleValueError as exc: raise error.RemoteError(_(b'missing support for %s') % exc) except bundle2.AbortFromPart as exc: @@ -1903,10 +1908,18 @@ try: op = bundle2.bundleoperation( - pullop.repo, pullop.gettransaction, source=b'pull' + pullop.repo, + pullop.gettransaction, + source=b'pull', + remote=pullop.remote, ) op.modes[b'bookmarks'] = b'records' - bundle2.processbundle(pullop.repo, bundle, op=op) + bundle2.processbundle( + pullop.repo, + bundle, + op=op, + remote=pullop.remote, + ) except bundle2.AbortFromPart as exc: pullop.repo.ui.error(_(b'remote: abort: %s\n') % exc) raise error.RemoteError(_(b'pull failed on remote'), hint=exc.hint) @@ -1995,7 +2008,12 @@ ).result() bundleop = bundle2.applybundle( - pullop.repo, cg, tr, b'pull', pullop.remote.url() + pullop.repo, + cg, + tr, + b'pull', + pullop.remote.url(), + remote=pullop.remote, ) pullop.cgresult = bundle2.combinechangegroupresults(bundleop)