##// END OF EJS Templates
narrowspec: move module into core...
Gregory Szorc -
r36178:9fd8c2a3 default
parent child Browse files
Show More
@@ -24,6 +24,7 b' from mercurial import ('
24 24 error,
25 25 exchange,
26 26 extensions,
27 narrowspec,
27 28 repair,
28 29 util,
29 30 wireproto,
@@ -31,7 +32,6 b' from mercurial import ('
31 32
32 33 from . import (
33 34 narrowrepo,
34 narrowspec,
35 35 )
36 36
37 37 NARROWCAP = 'narrow'
@@ -18,6 +18,7 b' from mercurial import ('
18 18 extensions,
19 19 hg,
20 20 merge,
21 narrowspec,
21 22 node,
22 23 pycompat,
23 24 registrar,
@@ -29,7 +30,6 b' from mercurial import ('
29 30 from . import (
30 31 narrowbundle2,
31 32 narrowrepo,
32 narrowspec,
33 33 )
34 34
35 35 table = {}
@@ -13,11 +13,10 b' from mercurial import ('
13 13 error,
14 14 extensions,
15 15 match as matchmod,
16 narrowspec,
16 17 util as hgutil,
17 18 )
18 19
19 from . import narrowspec
20
21 20 def setup(repo):
22 21 """Add narrow spec dirstate ignore, block changes outside narrow spec."""
23 22
@@ -12,12 +12,12 b' from mercurial import ('
12 12 hg,
13 13 localrepo,
14 14 match as matchmod,
15 narrowspec,
15 16 scmutil,
16 17 )
17 18
18 19 from . import (
19 20 narrowrevlog,
20 narrowspec,
21 21 )
22 22
23 23 # When narrowing is finalized and no longer subject to format changes,
@@ -12,11 +12,10 b' from mercurial import ('
12 12 error,
13 13 extensions,
14 14 hg,
15 narrowspec,
15 16 node,
16 17 )
17 18
18 from . import narrowspec
19
20 19 def uisetup():
21 20 def peersetup(ui, peer):
22 21 # We must set up the expansion before reposetup below, since it's used
@@ -9,8 +9,8 b' from __future__ import absolute_import'
9 9
10 10 import errno
11 11
12 from mercurial.i18n import _
13 from mercurial import (
12 from .i18n import _
13 from . import (
14 14 error,
15 15 hg,
16 16 match as matchmod,
@@ -89,7 +89,7 b' def _validatepattern(pat):'
89 89 # We use newlines as separators in the narrowspec file, so don't allow them
90 90 # in patterns.
91 91 if _numlines(pat) > 1:
92 raise error.Abort('newlines are not allowed in narrowspec paths')
92 raise error.Abort(_('newlines are not allowed in narrowspec paths'))
93 93
94 94 components = pat.split('/')
95 95 if '.' in components or '..' in components:
@@ -51,6 +51,7 b' have this method available in narrowhg p'
51 51 > from mercurial import extensions
52 52 > from mercurial import localrepo
53 53 > from mercurial import match as matchmod
54 > from mercurial import narrowspec
54 55 > from mercurial import patch
55 56 > from mercurial import util as hgutil
56 57 >
@@ -59,14 +60,13 b' have this method available in narrowhg p'
59 60 > return
60 61 > import sys
61 62 > newincludes = set([newincludes])
62 > narrowhg = extensions.find('narrow')
63 63 > includes, excludes = repo.narrowpats
64 > currentmatcher = narrowhg.narrowspec.match(repo.root, includes, excludes)
64 > currentmatcher = narrowspec.match(repo.root, includes, excludes)
65 65 > includes = includes | newincludes
66 66 > if not repo.currenttransaction():
67 67 > ui.develwarn('expandnarrowspec called outside of transaction!')
68 68 > repo.setnarrowpats(includes, excludes)
69 > newmatcher = narrowhg.narrowspec.match(repo.root, includes, excludes)
69 > newmatcher = narrowspec.match(repo.root, includes, excludes)
70 70 > added = matchmod.differencematcher(newmatcher, currentmatcher)
71 71 > for f in repo['.'].manifest().walk(added):
72 72 > repo.dirstate.normallookup(f)
General Comments 0
You need to be logged in to leave comments. Login now