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