##// END OF EJS Templates
narrow: drop unnecessary overrides of patch...
Martin von Zweigbergk -
r39973:84092edd default
parent child Browse files
Show More
@@ -1,86 +1,84 b''
1 1 # __init__.py - narrowhg extension
2 2 #
3 3 # Copyright 2017 Google, Inc.
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7 '''create clones which fetch history data for subset of files (EXPERIMENTAL)'''
8 8
9 9 from __future__ import absolute_import
10 10
11 11 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
12 12 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
13 13 # be specifying the version(s) of Mercurial they are tested with, or
14 14 # leave the attribute unspecified.
15 15 testedwith = 'ships-with-hg-core'
16 16
17 17 from mercurial import (
18 18 extensions,
19 19 localrepo,
20 20 registrar,
21 21 repository,
22 22 verify as verifymod,
23 23 )
24 24
25 25 from . import (
26 26 narrowbundle2,
27 27 narrowcommands,
28 narrowcopies,
29 28 narrowpatch,
30 29 narrowrepo,
31 30 narrowtemplates,
32 31 narrowwirepeer,
33 32 )
34 33
35 34 configtable = {}
36 35 configitem = registrar.configitem(configtable)
37 36 # Narrowhg *has* support for serving ellipsis nodes (which are used at
38 37 # least by Google's internal server), but that support is pretty
39 38 # fragile and has a lot of problems on real-world repositories that
40 39 # have complex graph topologies. This could probably be corrected, but
41 40 # absent someone needing the full support for ellipsis nodes in
42 41 # repositories with merges, it's unlikely this work will get done. As
43 42 # of this writining in late 2017, all repositories large enough for
44 43 # ellipsis nodes to be a hard requirement also enforce strictly linear
45 44 # history for other scaling reasons.
46 45 configitem('experimental', 'narrowservebrokenellipses',
47 46 default=False,
48 47 alias=[('narrow', 'serveellipses')],
49 48 )
50 49
51 50 # Export the commands table for Mercurial to see.
52 51 cmdtable = narrowcommands.table
53 52
54 53 def featuresetup(ui, features):
55 54 features.add(repository.NARROW_REQUIREMENT)
56 55
57 56 def uisetup(ui):
58 57 """Wraps user-facing mercurial commands with narrow-aware versions."""
59 58 localrepo.featuresetupfuncs.add(featuresetup)
60 59 narrowbundle2.setup()
61 60 narrowcommands.setup()
62 61 narrowwirepeer.uisetup()
63 62
64 63 def reposetup(ui, repo):
65 64 """Wraps local repositories with narrow repo support."""
66 65 if not repo.local():
67 66 return
68 67
69 68 if repository.NARROW_REQUIREMENT in repo.requirements:
70 69 narrowrepo.wraprepo(repo)
71 narrowcopies.setup(repo)
72 70 narrowpatch.setup(repo)
73 71 narrowwirepeer.reposetup(repo)
74 72
75 73 def _verifierinit(orig, self, repo, matcher=None):
76 74 # The verifier's matcher argument was desgined for narrowhg, so it should
77 75 # be None from core. If another extension passes a matcher (unlikely),
78 76 # we'll have to fail until matchers can be composed more easily.
79 77 assert matcher is None
80 78 orig(self, repo, repo.narrowmatch())
81 79
82 80 def extsetup(ui):
83 81 extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
84 82
85 83 templatekeyword = narrowtemplates.templatekeyword
86 84 revsetpredicate = narrowtemplates.revsetpredicate
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now