Show More
@@ -13,6 +13,7 b' from mercurial import (' | |||
|
13 | 13 | error, |
|
14 | 14 | extensions, |
|
15 | 15 | manifest, |
|
16 | match as matchmod, | |
|
16 | 17 | mdiff, |
|
17 | 18 | node, |
|
18 | 19 | revlog, |
@@ -21,12 +22,19 b' from mercurial import (' | |||
|
21 | 22 | |
|
22 | 23 | def setup(): |
|
23 | 24 | |
|
25 | def _cgmatcher(cgpacker): | |
|
26 | localmatcher = getattr(cgpacker._repo, 'narrowmatch', lambda: None)() | |
|
27 | remotematcher = getattr(cgpacker, '_narrow_matcher', lambda: None)() | |
|
28 | if localmatcher and remotematcher: | |
|
29 | return matchmod.intersectmatchers(localmatcher, remotematcher) | |
|
30 | else: | |
|
31 | return localmatcher or remotematcher | |
|
32 | ||
|
24 | 33 | def prune(orig, self, revlog, missing, commonrevs): |
|
25 | 34 | if isinstance(revlog, manifest.manifestrevlog): |
|
26 |
matcher = |
|
|
27 | getattr(self, '_narrow_matcher', None)) | |
|
28 | if (matcher is not None and | |
|
29 | not matcher().visitdir(revlog._dir[:-1] or '.')): | |
|
35 | matcher = _cgmatcher(self) | |
|
36 | if (matcher and | |
|
37 | not matcher.visitdir(revlog._dir[:-1] or '.')): | |
|
30 | 38 | return [] |
|
31 | 39 | return orig(self, revlog, missing, commonrevs) |
|
32 | 40 | |
@@ -34,11 +42,9 b' def setup():' | |||
|
34 | 42 | |
|
35 | 43 | def generatefiles(orig, self, changedfiles, linknodes, commonrevs, |
|
36 | 44 | source): |
|
37 |
matcher = |
|
|
38 | getattr(self, '_narrow_matcher', None)) | |
|
39 | if matcher is not None: | |
|
40 | narrowmatch = matcher() | |
|
41 | changedfiles = [f for f in changedfiles if narrowmatch(f)] | |
|
45 | matcher = _cgmatcher(self) | |
|
46 | if matcher: | |
|
47 | changedfiles = filter(matcher, changedfiles) | |
|
42 | 48 | if getattr(self, 'is_shallow', False): |
|
43 | 49 | # See comment in generate() for why this sadness is a thing. |
|
44 | 50 | mfdicts = self._mfdicts |
@@ -137,13 +137,12 b' narrow spec' | |||
|
137 | 137 | $ hg pull ssh://user@dummy/narrow2 |
|
138 | 138 | pulling from ssh://user@dummy/narrow2 |
|
139 | 139 | searching for changes |
|
140 | remote: abort: unable to resolve parent while packing 'data/inside2/f.i' 3 for changeset 5 (?) | |
|
141 | 140 | adding changesets |
|
142 | remote: abort: unexpected error: unable to resolve parent while packing 'data/inside2/f.i' 3 for changeset 5 | |
|
143 | transaction abort! | |
|
144 | rollback completed | |
|
145 | abort: pull failed on remote | |
|
146 | [255] | |
|
141 | adding manifests | |
|
142 | adding file changes | |
|
143 | added 1 changesets with 0 changes to 0 files | |
|
144 | new changesets d78a96df731d | |
|
145 | (run 'hg update' to get a working copy) | |
|
147 | 146 | |
|
148 | 147 | Check that the resulting history is valid in the full repo |
|
149 | 148 | |
@@ -204,7 +203,7 b' necessary content to be able to push to ' | |||
|
204 | 203 | $ hg push ssh://user@dummy/narrow2 |
|
205 | 204 | pushing to ssh://user@dummy/narrow2 |
|
206 | 205 | searching for changes |
|
207 | remote has heads on branch 'default' that are not known locally: d78a96df731d | |
|
208 | abort: push creates new remote head 5970befb64ba! | |
|
209 | (pull and merge or see 'hg help push' for details about pushing new heads) | |
|
210 | [255] | |
|
206 | remote: adding changesets | |
|
207 | remote: adding manifests | |
|
208 | remote: adding file changes | |
|
209 | remote: added 1 changesets with 0 changes to 0 files |
General Comments 0
You need to be logged in to leave comments.
Login now