##// END OF EJS Templates
pathcopies: give up any optimization based on `introrev`...
pathcopies: give up any optimization based on `introrev` Between 8a0136f69027 and d98fb3f42f33, we sped up the search for the introduction revision during path copies. However, further checking show that finding the introduction revision is still expensive and that we are better off without it. So we simply drop it and only rely on the linkrev optimisation. I ran `perfpathcopies` on 6989 pair of revision in the pypy repository (`hg perfhelper-pathcopies`. The result is massively in favor of dropping this condition. The result of the copy tracing are unchanged. Attempt to use a smaller changes preserving linkrev usage were unsuccessful, it can return wrong result. The following changesets broke test-mv-cp-st-diff.t - if not f.isintroducedafter(limit): + if limit >= 0 and f.linkrev() < limit: return None Here are various numbers (before this changeset/after this changesets) source destination before after saved-time ratio worth cases e66f24650daf 695dfb0f493b 1.062843 1.246369 -0.183526 1.172675 c979853a3b6a 8d60fe293e79 1.036985 1.196414 -0.159429 1.153743 22349fa2fc33 fbb1c9fd86c0 0.879926 1.038682 -0.158756 1.180420 682b98f3e672 a4878080a536 0.909952 1.063801 -0.153849 1.169074 5adabc9b9848 920958a93997 0.993622 1.147452 -0.153830 1.154817 worse 1% dbfbfcf077e9 aea8f2fd3593 1.016595 1.082999 -0.066404 1.065320 worse 5% c95f1ced15f2 7d29d5e39734 0.453694 0.471156 -0.017462 1.038488 worse 10% 3e144ed1d5b7 2aef0e942480 0.035140 0.037535 -0.002395 1.068156 worse 25% 321fc60db035 801748ba582a 0.009267 0.009325 -0.000058 1.006259 median 2088ce763fc2 e6991321d78b 0.000665 0.000651 0.000014 0.978947 best 25% 915631a97de6 385b31354be6 0.040743 0.040363 0.000380 0.990673 best 10% ad495c36a765 19c10384d3e7 0.431658 0.411490 0.020168 0.953278 best 5% d13ae7d283ae 813c99f810ac 1.141404 1.075346 0.066058 0.942126 best 1% 81593cb4a496 99ae11866969 1.833297 0.063823 1.769474 0.034813 best cases c3b14617fbd7 743a0fcaa4eb 1101.811740 2.735970 1099.075770 0.002483 c3b14617fbd7 9ba6ab77fd29 1116.753953 2.800729 1113.953224 0.002508 058b99d6e81f 57e249b7a3ea 1246.128485 3.042762 1243.085723 0.002442 9a8c361aab49 0354a250d371 1253.111894 3.085796 1250.026098 0.002463 442dbbc53c68 3ec1002a818c 1261.786294 3.138607 1258.647687 0.002487 As one can see, the average case is not really impacted. However, the worth case we get after this changeset are much better than the one we had before it. We have 30 pairs where improvements are above 10 minutes. This reflect in the combined time for all pairs before: 26256s after: 1300s (-95%) If we remove these pathological 30 cases, we still see a significant improvements: before: 1631s after: 1245s (-24%)

File last commit:

r43385:4aa72cdf default
r43469:c16fe77e default
Show More
narrowbundle2.py
360 lines | 12.0 KiB | text/x-python | PythonLexer
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # narrowbundle2.py - bundle2 extensions for narrow repository support
#
# Copyright 2017 Google, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import errno
import struct
from mercurial.i18n import _
from mercurial.node import (
bin,
nullid,
)
from mercurial import (
bundle2,
changegroup,
error,
exchange,
Martin von Zweigbergk
narrow: keep bookmarks temporarily stripped for as long as commits are...
r40903 localrepo,
Gregory Szorc
narrowspec: move module into core...
r36178 narrowspec,
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 repair,
util,
Gregory Szorc
wireproto: move gboptsmap to wireprototypes and rename (API)...
r37631 wireprototypes,
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 )
Augie Fackler
formatting: blacken the codebase...
r43346 from mercurial.interfaces import repository
from mercurial.utils import stringutil
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 _NARROWACL_SECTION = b'narrowacl'
_CHANGESPECPART = b'narrow:changespec'
_RESSPECS = b'narrow:responsespec'
_SPECPART = b'narrow:spec'
_SPECPART_INCLUDE = b'include'
_SPECPART_EXCLUDE = b'exclude'
_KILLNODESIGNAL = b'KILL'
_DONESIGNAL = b'DONE'
_ELIDEDCSHEADER = b'>20s20s20sl' # cset id, p1, p2, len(text)
_ELIDEDMFHEADER = b'>20s20s20s20sl' # manifest id, p1, p2, link id, len(text)
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 _CSHEADERSIZE = struct.calcsize(_ELIDEDCSHEADER)
_MFHEADERSIZE = struct.calcsize(_ELIDEDMFHEADER)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
# Serve a changegroup for a client with a narrow clone.
Augie Fackler
formatting: blacken the codebase...
r43346 def getbundlechangegrouppart_narrow(
bundler,
repo,
source,
bundlecaps=None,
b2caps=None,
heads=None,
common=None,
**kwargs
):
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 assert repo.ui.configbool(b'experimental', b'narrowservebrokenellipses')
Gregory Szorc
exchange: move simple narrow changegroup generation from extension...
r38844
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 cgversions = b2caps.get(b'changegroup')
Augie Fackler
formatting: blacken the codebase...
r43346 cgversions = [
v
for v in cgversions
if v in changegroup.supportedoutgoingversions(repo)
]
Pulkit Goyal
narrow: remove unrequired compat code for old versions of hg...
r42557 if not cgversions:
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 raise ValueError(_(b'no common changegroup version'))
Pulkit Goyal
narrow: remove unrequired compat code for old versions of hg...
r42557 version = max(cgversions)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Pulkit Goyal
narrow: factor out logic to build ellipses related b2parts in separate fn...
r42558 oldinclude = sorted(filter(bool, kwargs.get(r'oldincludepats', [])))
oldexclude = sorted(filter(bool, kwargs.get(r'oldexcludepats', [])))
newinclude = sorted(filter(bool, kwargs.get(r'includepats', [])))
newexclude = sorted(filter(bool, kwargs.get(r'excludepats', [])))
Pulkit Goyal
py3: fix test-narrow* which started failing because of recent changes...
r42571 known = {bin(n) for n in kwargs.get(r'known', [])}
Augie Fackler
formatting: blacken the codebase...
r43346 generateellipsesbundle2(
bundler,
repo,
oldinclude,
oldexclude,
newinclude,
newexclude,
version,
common,
heads,
known,
kwargs.get(r'depth', None),
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Augie Fackler
formatting: blacken the codebase...
r43346 def generateellipsesbundle2(
bundler,
repo,
oldinclude,
oldexclude,
newinclude,
newexclude,
version,
common,
heads,
known,
depth,
):
newmatch = narrowspec.match(
repo.root, include=newinclude, exclude=newexclude
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 if depth is not None:
depth = int(depth)
if depth < 1:
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 raise error.Abort(_(b'depth must be positive, got %d') % depth)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
heads = set(heads or repo.heads())
common = set(common or [nullid])
Pulkit Goyal
narrow: factor out logic to build ellipses related b2parts in separate fn...
r42558 if known and (oldinclude != newinclude or oldexclude != newexclude):
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # Steps:
# 1. Send kill for "$known & ::common"
#
# 2. Send changegroup for ::common
#
# 3. Proceed.
#
# In the future, we can send kills for only the specific
# nodes we know should go away or change shape, and then
# send a data stream that tells the client something like this:
#
# a) apply this changegroup
# b) apply nodes XXX, YYY, ZZZ that you already have
# c) goto a
#
# until they've built up the full new state.
# Convert to revnums and intersect with "common". The client should
# have made it a subset of "common" already, but let's be safe.
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 known = set(repo.revs(b"%ln & ::%ln", known, common))
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # TODO: we could send only roots() of this set, and the
# list of nodes in common, and the client could work out
# what to strip, instead of us explicitly sending every
# single node.
deadrevs = known
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def genkills():
for r in deadrevs:
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 yield _KILLNODESIGNAL
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 yield repo.changelog.node(r)
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 yield _DONESIGNAL
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 bundler.newpart(_CHANGESPECPART, data=genkills())
Gregory Szorc
exchange: move _computeellipsis() from narrow...
r38827 newvisit, newfull, newellipsis = exchange._computeellipsis(
Augie Fackler
formatting: blacken the codebase...
r43346 repo, set(), common, known, newmatch
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 if newvisit:
Augie Fackler
formatting: blacken the codebase...
r43346 packer = changegroup.getbundler(
version,
repo,
matcher=newmatch,
ellipses=True,
shallow=depth is not None,
ellipsisroots=newellipsis,
fullnodes=newfull,
)
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
Gregory Szorc
changegroup: inline _packellipsischangegroup...
r38946
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 part = bundler.newpart(b'changegroup', data=cgdata)
part.addparam(b'version', version)
if b'treemanifest' in repo.requirements:
part.addparam(b'treemanifest', b'1')
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Gregory Szorc
exchange: move _computeellipsis() from narrow...
r38827 visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
Augie Fackler
formatting: blacken the codebase...
r43346 repo, common, heads, set(), newmatch, depth=depth
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 repo.ui.debug(b'Found %d relevant revs\n' % len(relevant_nodes))
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 if visitnodes:
Augie Fackler
formatting: blacken the codebase...
r43346 packer = changegroup.getbundler(
version,
repo,
matcher=newmatch,
ellipses=True,
shallow=depth is not None,
ellipsisroots=ellipsisroots,
fullnodes=relevant_nodes,
)
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 cgdata = packer.generate(common, visitnodes, False, b'narrow_widen')
Gregory Szorc
changegroup: inline _packellipsischangegroup...
r38946
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 part = bundler.newpart(b'changegroup', data=cgdata)
part.addparam(b'version', version)
if b'treemanifest' in repo.requirements:
part.addparam(b'treemanifest', b'1')
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE))
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def _handlechangespec_2(op, inpart):
Pulkit Goyal
narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)...
r42393 # XXX: This bundle2 handling is buggy and should be removed after hg5.2 is
# released. New servers will send a mandatory bundle2 part named
# 'Narrowspec' and will send specs as data instead of params.
# Refer to issue5952 and 6019
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 includepats = set(inpart.params.get(_SPECPART_INCLUDE, b'').splitlines())
excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, b'').splitlines())
Gregory Szorc
narrow: validate patterns on incoming bundle2 part...
r39576 narrowspec.validatepatterns(includepats)
narrowspec.validatepatterns(excludepats)
Martin von Zweigbergk
narrow: move requirement constant from changegroup to repository...
r38871 if not repository.NARROW_REQUIREMENT in op.repo.requirements:
op.repo.requirements.add(repository.NARROW_REQUIREMENT)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 op.repo._writerequirements()
Martin von Zweigbergk
narrow: reduce depedence on narrowspec.save()...
r36487 op.repo.setnarrowpats(includepats, excludepats)
Martin von Zweigbergk
narrow: move copytonarrowspec() out of setnarrowpats()...
r41272 narrowspec.copytoworkingcopy(op.repo)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
Augie Fackler
formatting: blacken the codebase...
r43346
Pulkit Goyal
narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)...
r42393 @bundle2.parthandler(_RESSPECS)
def _handlenarrowspecs(op, inpart):
data = inpart.read()
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 inc, exc = data.split(b'\0')
Pulkit Goyal
narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)...
r42393 includepats = set(inc.splitlines())
excludepats = set(exc.splitlines())
narrowspec.validatepatterns(includepats)
narrowspec.validatepatterns(excludepats)
if repository.NARROW_REQUIREMENT not in op.repo.requirements:
op.repo.requirements.add(repository.NARROW_REQUIREMENT)
op.repo._writerequirements()
op.repo.setnarrowpats(includepats, excludepats)
narrowspec.copytoworkingcopy(op.repo)
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 @bundle2.parthandler(_CHANGESPECPART)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def _handlechangespec(op, inpart):
repo = op.repo
cl = repo.changelog
# changesets which need to be stripped entirely. either they're no longer
# needed in the new narrow spec, or the server is sending a replacement
# in the changegroup part.
clkills = set()
# A changespec part contains all the updates to ellipsis nodes
# that will happen as a result of widening or narrowing a
# repo. All the changes that this block encounters are ellipsis
# nodes or flags to kill an existing ellipsis.
chunksignal = changegroup.readexactly(inpart, 4)
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 while chunksignal != _DONESIGNAL:
if chunksignal == _KILLNODESIGNAL:
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # a node used to be an ellipsis but isn't anymore
ck = changegroup.readexactly(inpart, 20)
if cl.hasnode(ck):
clkills.add(ck)
else:
raise error.Abort(
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 _(b'unexpected changespec node chunk type: %s') % chunksignal
Augie Fackler
formatting: blacken the codebase...
r43346 )
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 chunksignal = changegroup.readexactly(inpart, 4)
if clkills:
# preserve bookmarks that repair.strip() would otherwise strip
Martin von Zweigbergk
narrow: keep bookmarks temporarily stripped for as long as commits are...
r40903 op._bookmarksbackup = repo._bookmarks
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 class dummybmstore(dict):
def applychanges(self, repo, tr, changes):
pass
Augie Fackler
formatting: blacken the codebase...
r43346
Martin von Zweigbergk
narrow: keep bookmarks temporarily stripped for as long as commits are...
r40903 localrepo.localrepository._bookmarks.set(repo, dummybmstore())
Augie Fackler
formatting: blacken the codebase...
r43346 chgrpfile = repair.strip(
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 op.ui, repo, list(clkills), backup=True, topic=b'widen'
Augie Fackler
formatting: blacken the codebase...
r43346 )
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 if chgrpfile:
Kyle Lippincott
procutil: correct spelling of uninterruptable -> uninterruptible...
r41106 op._widen_uninterr = repo.ui.uninterruptible()
Augie Fackler
narrowbundle2: when we handle a widen, mark the operation as unsafe...
r38548 op._widen_uninterr.__enter__()
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # presence of _widen_bundle attribute activates widen handler later
op._widen_bundle = chgrpfile
# Set the new narrowspec if we're widening. The setnewnarrowpats() method
# will currently always be there when using the core+narrowhg server, but
# other servers may include a changespec part even when not widening (e.g.
# because we're deepening a shallow repo).
Martin von Zweigbergk
py3: delete b'' prefix from safehasattr arguments...
r43385 if util.safehasattr(repo, 'setnewnarrowpats'):
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 repo.setnewnarrowpats()
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def handlechangegroup_widen(op, inpart):
"""Changegroup exchange handler which restores temporarily-stripped nodes"""
# We saved a bundle with stripped node data we must now restore.
# This approach is based on mercurial/repair.py@6ee26a53c111.
repo = op.repo
ui = op.ui
chgrpfile = op._widen_bundle
del op._widen_bundle
vfs = repo.vfs
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 ui.note(_(b"adding branch\n"))
f = vfs.open(chgrpfile, b"rb")
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 try:
gen = exchange.readbundle(ui, f, chgrpfile, vfs)
narrow: rely on setting `quiet` mode instead of `pushbuffer`...
r43165 # silence internal shuffling chatter
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 override = {(b'ui', b'quiet'): True}
narrow: rely on setting `quiet` mode instead of `pushbuffer`...
r43165 if ui.verbose:
override = {}
with ui.configoverride(override):
if isinstance(gen, bundle2.unbundle20):
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 with repo.transaction(b'strip') as tr:
narrow: rely on setting `quiet` mode instead of `pushbuffer`...
r43165 bundle2.processbundle(repo, gen, lambda: tr)
else:
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 gen.apply(
repo, b'strip', b'bundle:' + vfs.join(chgrpfile), True
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 finally:
f.close()
# remove undo files
for undovfs, undofile in repo.undofiles():
try:
undovfs.unlink(undofile)
except OSError as e:
if e.errno != errno.ENOENT:
Augie Fackler
formatting: blacken the codebase...
r43346 ui.warn(
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 _(b'error removing %s: %s\n')
Augie Fackler
formatting: blacken the codebase...
r43346 % (undovfs.join(undofile), stringutil.forcebytestr(e))
)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
# Remove partial backup only if there were no exceptions
Augie Fackler
narrowbundle2: when we handle a widen, mark the operation as unsafe...
r38548 op._widen_uninterr.__exit__(None, None, None)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 vfs.unlink(chgrpfile)
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def setup():
"""Enable narrow repo support in bundle2-related extension points."""
Gregory Szorc
wireproto: move gboptsmap to wireprototypes and rename (API)...
r37631 getbundleargs = wireprototypes.GETBUNDLE_ARGUMENTS
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 getbundleargs[b'narrow'] = b'boolean'
getbundleargs[b'depth'] = b'plain'
getbundleargs[b'oldincludepats'] = b'csv'
getbundleargs[b'oldexcludepats'] = b'csv'
getbundleargs[b'known'] = b'csv'
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
# Extend changegroup serving to handle requests from narrow clients.
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 origcgfn = exchange.getbundle2partsmapping[b'changegroup']
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def wrappedcgfn(*args, **kwargs):
repo = args[1]
Augie Fackler
narrowbundle2: mark most constants as module-private...
r36104 if repo.ui.has_section(_NARROWACL_SECTION):
Gregory Szorc
exchange: make narrow ACL presence imply narrow=True...
r38843 kwargs = exchange.applynarrowacl(repo, kwargs)
Augie Fackler
formatting: blacken the codebase...
r43346 if kwargs.get(r'narrow', False) and repo.ui.configbool(
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 b'experimental', b'narrowservebrokenellipses'
Augie Fackler
formatting: blacken the codebase...
r43346 ):
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 getbundlechangegrouppart_narrow(*args, **kwargs)
else:
origcgfn(*args, **kwargs)
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 exchange.getbundle2partsmapping[b'changegroup'] = wrappedcgfn
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
# Extend changegroup receiver so client can fixup after widen requests.
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 origcghandler = bundle2.parthandlermapping[b'changegroup']
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 def wrappedcghandler(op, inpart):
origcghandler(op, inpart)
Martin von Zweigbergk
py3: delete b'' prefix from safehasattr arguments...
r43385 if util.safehasattr(op, '_widen_bundle'):
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 handlechangegroup_widen(op, inpart)
Martin von Zweigbergk
py3: delete b'' prefix from safehasattr arguments...
r43385 if util.safehasattr(op, '_bookmarksbackup'):
Augie Fackler
formatting: blacken the codebase...
r43346 localrepo.localrepository._bookmarks.set(
op.repo, op._bookmarksbackup
)
Martin von Zweigbergk
narrow: keep bookmarks temporarily stripped for as long as commits are...
r40903 del op._bookmarksbackup
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 wrappedcghandler.params = origcghandler.params
Augie Fackler
formatting: byteify all mercurial/ and hgext/ string literals...
r43347 bundle2.parthandlermapping[b'changegroup'] = wrappedcghandler