Show More
@@ -56,9 +56,13 b' have this method available in narrowhg p' | |||
|
56 | 56 | > from mercurial import patch |
|
57 | 57 | > from mercurial import util as hgutil |
|
58 | 58 | > |
|
59 | > narrowspecexpanded = False | |
|
59 | 60 | > def expandnarrowspec(ui, repo, newincludes=None): |
|
60 | 61 | > if not newincludes: |
|
61 | 62 | > return |
|
63 | > if getattr(repo, '_narrowspecexpanded', False): | |
|
64 | > return | |
|
65 | > repo._narrowspecexpanded = True | |
|
62 | 66 | > import sys |
|
63 | 67 | > newincludes = set([newincludes]) |
|
64 | 68 | > includes, excludes = repo.narrowpats |
@@ -72,24 +76,14 b' have this method available in narrowhg p' | |||
|
72 | 76 | > for f in repo[b'.'].manifest().walk(added): |
|
73 | 77 | > repo.dirstate.normallookup(f) |
|
74 | 78 | > |
|
75 |
> def |
|
|
76 |
> class expanding |
|
|
77 | > @hgutil.propertycache | |
|
78 | > def _map(self): | |
|
79 | > ret = super(expandingdirstate, self)._map | |
|
79 | > def reposetup(ui, repo): | |
|
80 | > class expandingrepo(repo.__class__): | |
|
81 | > def narrowmatch(self, *args, **kwargs): | |
|
80 | 82 | > with repo.wlock(), repo.lock(), repo.transaction( |
|
81 | 83 | > b'expandnarrowspec'): |
|
82 | 84 | > expandnarrowspec(ui, repo, |
|
83 | 85 | > encoding.environ.get(b'DIRSTATEINCLUDES')) |
|
84 | > return ret | |
|
85 | > ds.__class__ = expandingdirstate | |
|
86 | > return ds | |
|
87 | > | |
|
88 | > def reposetup(ui, repo): | |
|
89 | > class expandingrepo(repo.__class__): | |
|
90 | > def _makedirstate(self): | |
|
91 | > dirstate = super(expandingrepo, self)._makedirstate() | |
|
92 | > return wrapds(ui, repo, dirstate) | |
|
86 | > return super(expandingrepo, self).narrowmatch(*args, **kwargs) | |
|
93 | 87 | > repo.__class__ = expandingrepo |
|
94 | 88 | > |
|
95 | 89 | > def extsetup(unused_ui): |
General Comments 0
You need to be logged in to leave comments.
Login now