##// END OF EJS Templates
test-lfs: dial up the debugging on commands that interact with the server...
test-lfs: dial up the debugging on commands that interact with the server This will be useful to let the client print out the HTTP headers and JSON in a future patch, so we can compare native LFS serving against test-lfs-server behavior. There tends to be a lot of debug stuff that we don't care about here in a push, so I was tempted to print this output with a [devel] config. But this will be useful for field debugging too, so just put up with the extra output here. It would have been nice to be able to set ui.debug once, but issue5815 prevents that.

File last commit:

r36490:d0d5eef5 default
r36943:24e6342d default
Show More
__init__.py
95 lines | 3.2 KiB | text/x-python | PythonLexer
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 # __init__.py - narrowhg extension
#
# 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.
'''create clones which fetch history data for subset of files (EXPERIMENTAL)'''
from __future__ import absolute_import
Augie Fackler
narrow: remove old version-checking logic and declare internal...
r36102 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
# be specifying the version(s) of Mercurial they are tested with, or
# leave the attribute unspecified.
testedwith = 'ships-with-hg-core'
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
from mercurial import (
Martin von Zweigbergk
narrow: move requirement constant to core...
r36482 changegroup,
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 extensions,
hg,
localrepo,
registrar,
verify as verifymod,
)
from . import (
narrowbundle2,
narrowchangegroup,
narrowcommands,
narrowcopies,
narrowdirstate,
narrowmerge,
narrowpatch,
narrowrepo,
narrowrevlog,
narrowtemplates,
narrowwirepeer,
)
configtable = {}
configitem = registrar.configitem(configtable)
# Narrowhg *has* support for serving ellipsis nodes (which are used at
# least by Google's internal server), but that support is pretty
# fragile and has a lot of problems on real-world repositories that
# have complex graph topologies. This could probably be corrected, but
# absent someone needing the full support for ellipsis nodes in
# repositories with merges, it's unlikely this work will get done. As
# of this writining in late 2017, all repositories large enough for
# ellipsis nodes to be a hard requirement also enforce strictly linear
# history for other scaling reasons.
configitem('experimental', 'narrowservebrokenellipses',
default=False,
alias=[('narrow', 'serveellipses')],
)
# Export the commands table for Mercurial to see.
cmdtable = narrowcommands.table
Martin von Zweigbergk
narrow: move requirement constant to core...
r36482 localrepo.localrepository._basesupported.add(changegroup.NARROW_REQUIREMENT)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
def uisetup(ui):
"""Wraps user-facing mercurial commands with narrow-aware versions."""
narrowrevlog.setup()
narrowbundle2.setup()
narrowmerge.setup()
narrowcommands.setup()
narrowchangegroup.setup()
narrowwirepeer.uisetup()
def reposetup(ui, repo):
"""Wraps local repositories with narrow repo support."""
if not isinstance(repo, localrepo.localrepository):
return
Martin von Zweigbergk
narrow: always wrap repo...
r36486 narrowrepo.wraprepo(repo)
Martin von Zweigbergk
narrow: move requirement constant to core...
r36482 if changegroup.NARROW_REQUIREMENT in repo.requirements:
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 narrowcopies.setup(repo)
narrowdirstate.setup(repo)
narrowpatch.setup(repo)
narrowwirepeer.reposetup(repo)
def _verifierinit(orig, self, repo, matcher=None):
# The verifier's matcher argument was desgined for narrowhg, so it should
# be None from core. If another extension passes a matcher (unlikely),
# we'll have to fail until matchers can be composed more easily.
assert matcher is None
Martin von Zweigbergk
narrow: drop safehasattr() checks for always-present repo.narrowmatch...
r36490 orig(self, repo, repo.narrowmatch())
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096
def extsetup(ui):
Augie Fackler
narrow: remove support for old match modules...
r36097 extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
Augie Fackler
narrow: import experimental extension from narrowhg revision cb51d673e9c5...
r36096 extensions.wrapfunction(hg, 'postshare', narrowrepo.wrappostshare)
extensions.wrapfunction(hg, 'copystore', narrowrepo.unsharenarrowspec)
Augie Fackler
narrowtemplates: update to use registrar mechanism...
r36108
templatekeyword = narrowtemplates.templatekeyword
revsetpredicate = narrowtemplates.revsetpredicate