Show More
@@ -10,6 +10,7 b' from __future__ import absolute_import' | |||||
10 | from mercurial import ( |
|
10 | from mercurial import ( | |
11 | bundle2, |
|
11 | bundle2, | |
12 | error, |
|
12 | error, | |
|
13 | exchange, | |||
13 | extensions, |
|
14 | extensions, | |
14 | hg, |
|
15 | hg, | |
15 | narrowspec, |
|
16 | narrowspec, | |
@@ -86,6 +87,11 b' def narrow_widen(' | |||||
86 | newincludes = splitpaths(newincludes) |
|
87 | newincludes = splitpaths(newincludes) | |
87 | oldexcludes = splitpaths(oldexcludes) |
|
88 | oldexcludes = splitpaths(oldexcludes) | |
88 | newexcludes = splitpaths(newexcludes) |
|
89 | newexcludes = splitpaths(newexcludes) | |
|
90 | ||||
|
91 | # enforce narrow acl if set | |||
|
92 | if repo.ui.has_section(exchange._NARROWACL_SECTION): | |||
|
93 | exchange.applynarrowacl(repo, {'includepats': newincludes}) | |||
|
94 | ||||
89 | # validate the patterns |
|
95 | # validate the patterns | |
90 | narrowspec.validatepatterns(set(oldincludes)) |
|
96 | narrowspec.validatepatterns(set(oldincludes)) | |
91 | narrowspec.validatepatterns(set(newincludes)) |
|
97 | narrowspec.validatepatterns(set(newincludes)) |
@@ -41,3 +41,39 b' NarrowHG should track f1 and f2' | |||||
41 | $ hg -R narrowclone1 tracked |
|
41 | $ hg -R narrowclone1 tracked | |
42 | I path:f1 |
|
42 | I path:f1 | |
43 | I path:f2 |
|
43 | I path:f2 | |
|
44 | ||||
|
45 | Narrow should not be able to widen to include f3 | |||
|
46 | $ hg -R narrowclone1 tracked --addinclude f3 | |||
|
47 | comparing with http://localhost:$HGPORT1/ | |||
|
48 | searching for changes | |||
|
49 | abort: The following includes are not accessible for test: ['path:f3'] | |||
|
50 | [255] | |||
|
51 | $ ls -A -1 narrowclone1 | sort | |||
|
52 | .hg | |||
|
53 | f1 | |||
|
54 | f2 | |||
|
55 | $ hg -R narrowclone1 tracked | |||
|
56 | I path:f1 | |||
|
57 | I path:f2 | |||
|
58 | ||||
|
59 | Narrow should allow widen to include f2 | |||
|
60 | $ hg -R narrowclone1 tracked --removeinclude f2 > /dev/null | |||
|
61 | $ hg -R narrowclone1 tracked | |||
|
62 | I path:f1 | |||
|
63 | $ ls -A -1 narrowclone1 | sort | |||
|
64 | .hg | |||
|
65 | f1 | |||
|
66 | $ hg -R narrowclone1 tracked --addinclude f2 | |||
|
67 | comparing with http://localhost:$HGPORT1/ | |||
|
68 | searching for changes | |||
|
69 | adding changesets | |||
|
70 | adding manifests | |||
|
71 | adding file changes | |||
|
72 | added 0 changesets with 1 changes to 1 files | |||
|
73 | $ hg -R narrowclone1 tracked | |||
|
74 | I path:f1 | |||
|
75 | I path:f2 | |||
|
76 | $ ls -A -1 narrowclone1 | sort | |||
|
77 | .hg | |||
|
78 | f1 | |||
|
79 | f2 |
General Comments 0
You need to be logged in to leave comments.
Login now