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