##// END OF EJS Templates
narrow: remove narrowrevlog...
Gregory Szorc -
r39807:a063786c default
parent child Browse files
Show More
@@ -1,30 +1,23 b''
1 Integration with the share extension needs improvement. Right now
1 Integration with the share extension needs improvement. Right now
2 we've seen some odd bugs, and the way we modify the contents of the
2 we've seen some odd bugs, and the way we modify the contents of the
3 .hg/shared file is unfortunate. See wrappostshare() and unsharenarrowspec().
3 .hg/shared file is unfortunate. See wrappostshare() and unsharenarrowspec().
4
4
5 Resolve commentary on narrowrepo.wraprepo.narrowrepository.status
5 Resolve commentary on narrowrepo.wraprepo.narrowrepository.status
6 about the filtering of status being done at an awkward layer. This
6 about the filtering of status being done at an awkward layer. This
7 came up the import to hgext, but nobody's got concrete improvement
7 came up the import to hgext, but nobody's got concrete improvement
8 ideas as of then.
8 ideas as of then.
9
9
10 Fold most (or preferably all) of narrowrevlog.py into core.
10 Address commentary in manifest.excludedmanifestrevlog.add -
11
12 Address commentary in narrowrevlog.excludedmanifestrevlog.add -
13 specifically we should improve the collaboration with core so that
11 specifically we should improve the collaboration with core so that
14 add() never gets called on an excluded directory and we can improve
12 add() never gets called on an excluded directory and we can improve
15 the stand-in to raise a ProgrammingError.
13 the stand-in to raise a ProgrammingError.
16
14
17 Figure out how to correctly produce narrowmanifestrevlog and
18 narrowfilelog instances instead of monkeypatching regular revlogs at
19 runtime to our subclass. Even better, merge the narrowing logic
20 directly into core.
21
22 Reason more completely about rename-filtering logic in
15 Reason more completely about rename-filtering logic in
23 narrowfilelog. There could be some surprises lurking there.
16 narrowfilelog. There could be some surprises lurking there.
24
17
25 Formally document the narrowspec format. Unify with sparse, if at all
18 Formally document the narrowspec format. Unify with sparse, if at all
26 possible. For bonus points, unify with the server-specified narrowspec
19 possible. For bonus points, unify with the server-specified narrowspec
27 format.
20 format.
28
21
29 narrowrepo.setnarrowpats() or narrowspec.save() need to make sure
22 narrowrepo.setnarrowpats() or narrowspec.save() need to make sure
30 they're holding the wlock.
23 they're holding the wlock.
@@ -1,88 +1,86 b''
1 # __init__.py - narrowhg extension
1 # __init__.py - narrowhg extension
2 #
2 #
3 # Copyright 2017 Google, Inc.
3 # Copyright 2017 Google, Inc.
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7 '''create clones which fetch history data for subset of files (EXPERIMENTAL)'''
7 '''create clones which fetch history data for subset of files (EXPERIMENTAL)'''
8
8
9 from __future__ import absolute_import
9 from __future__ import absolute_import
10
10
11 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
11 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
12 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
12 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
13 # be specifying the version(s) of Mercurial they are tested with, or
13 # be specifying the version(s) of Mercurial they are tested with, or
14 # leave the attribute unspecified.
14 # leave the attribute unspecified.
15 testedwith = 'ships-with-hg-core'
15 testedwith = 'ships-with-hg-core'
16
16
17 from mercurial import (
17 from mercurial import (
18 extensions,
18 extensions,
19 localrepo,
19 localrepo,
20 registrar,
20 registrar,
21 repository,
21 repository,
22 verify as verifymod,
22 verify as verifymod,
23 )
23 )
24
24
25 from . import (
25 from . import (
26 narrowbundle2,
26 narrowbundle2,
27 narrowcommands,
27 narrowcommands,
28 narrowcopies,
28 narrowcopies,
29 narrowpatch,
29 narrowpatch,
30 narrowrepo,
30 narrowrepo,
31 narrowrevlog,
32 narrowtemplates,
31 narrowtemplates,
33 narrowwirepeer,
32 narrowwirepeer,
34 )
33 )
35
34
36 configtable = {}
35 configtable = {}
37 configitem = registrar.configitem(configtable)
36 configitem = registrar.configitem(configtable)
38 # Narrowhg *has* support for serving ellipsis nodes (which are used at
37 # Narrowhg *has* support for serving ellipsis nodes (which are used at
39 # least by Google's internal server), but that support is pretty
38 # least by Google's internal server), but that support is pretty
40 # fragile and has a lot of problems on real-world repositories that
39 # fragile and has a lot of problems on real-world repositories that
41 # have complex graph topologies. This could probably be corrected, but
40 # have complex graph topologies. This could probably be corrected, but
42 # absent someone needing the full support for ellipsis nodes in
41 # absent someone needing the full support for ellipsis nodes in
43 # repositories with merges, it's unlikely this work will get done. As
42 # repositories with merges, it's unlikely this work will get done. As
44 # of this writining in late 2017, all repositories large enough for
43 # of this writining in late 2017, all repositories large enough for
45 # ellipsis nodes to be a hard requirement also enforce strictly linear
44 # ellipsis nodes to be a hard requirement also enforce strictly linear
46 # history for other scaling reasons.
45 # history for other scaling reasons.
47 configitem('experimental', 'narrowservebrokenellipses',
46 configitem('experimental', 'narrowservebrokenellipses',
48 default=False,
47 default=False,
49 alias=[('narrow', 'serveellipses')],
48 alias=[('narrow', 'serveellipses')],
50 )
49 )
51
50
52 # Export the commands table for Mercurial to see.
51 # Export the commands table for Mercurial to see.
53 cmdtable = narrowcommands.table
52 cmdtable = narrowcommands.table
54
53
55 def featuresetup(ui, features):
54 def featuresetup(ui, features):
56 features.add(repository.NARROW_REQUIREMENT)
55 features.add(repository.NARROW_REQUIREMENT)
57
56
58 def uisetup(ui):
57 def uisetup(ui):
59 """Wraps user-facing mercurial commands with narrow-aware versions."""
58 """Wraps user-facing mercurial commands with narrow-aware versions."""
60 localrepo.featuresetupfuncs.add(featuresetup)
59 localrepo.featuresetupfuncs.add(featuresetup)
61 narrowrevlog.setup()
62 narrowbundle2.setup()
60 narrowbundle2.setup()
63 narrowcommands.setup()
61 narrowcommands.setup()
64 narrowwirepeer.uisetup()
62 narrowwirepeer.uisetup()
65
63
66 def reposetup(ui, repo):
64 def reposetup(ui, repo):
67 """Wraps local repositories with narrow repo support."""
65 """Wraps local repositories with narrow repo support."""
68 if not repo.local():
66 if not repo.local():
69 return
67 return
70
68
71 if repository.NARROW_REQUIREMENT in repo.requirements:
69 if repository.NARROW_REQUIREMENT in repo.requirements:
72 narrowrepo.wraprepo(repo)
70 narrowrepo.wraprepo(repo)
73 narrowcopies.setup(repo)
71 narrowcopies.setup(repo)
74 narrowpatch.setup(repo)
72 narrowpatch.setup(repo)
75 narrowwirepeer.reposetup(repo)
73 narrowwirepeer.reposetup(repo)
76
74
77 def _verifierinit(orig, self, repo, matcher=None):
75 def _verifierinit(orig, self, repo, matcher=None):
78 # The verifier's matcher argument was desgined for narrowhg, so it should
76 # The verifier's matcher argument was desgined for narrowhg, so it should
79 # be None from core. If another extension passes a matcher (unlikely),
77 # be None from core. If another extension passes a matcher (unlikely),
80 # we'll have to fail until matchers can be composed more easily.
78 # we'll have to fail until matchers can be composed more easily.
81 assert matcher is None
79 assert matcher is None
82 orig(self, repo, repo.narrowmatch())
80 orig(self, repo, repo.narrowmatch())
83
81
84 def extsetup(ui):
82 def extsetup(ui):
85 extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
83 extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
86
84
87 templatekeyword = narrowtemplates.templatekeyword
85 templatekeyword = narrowtemplates.templatekeyword
88 revsetpredicate = narrowtemplates.revsetpredicate
86 revsetpredicate = narrowtemplates.revsetpredicate
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now