Show More
@@ -2105,6 +2105,13 b' def diff(repo, node1=None, node2=None, m' | |||
|
2105 | 2105 | ctx1 = repo[node1] |
|
2106 | 2106 | ctx2 = repo[node2] |
|
2107 | 2107 | |
|
2108 | relfiltered = False | |
|
2109 | if relroot != '' and match.always(): | |
|
2110 | # as a special case, create a new matcher with just the relroot | |
|
2111 | pats = [relroot] | |
|
2112 | match = scmutil.match(ctx2, pats, default='path') | |
|
2113 | relfiltered = True | |
|
2114 | ||
|
2108 | 2115 | if not changes: |
|
2109 | 2116 | changes = repo.status(ctx1, ctx2, match=match) |
|
2110 | 2117 | modified, added, removed = changes[:3] |
@@ -2123,14 +2130,16 b' def diff(repo, node1=None, node2=None, m' | |||
|
2123 | 2130 | copy = copies.pathcopies(ctx1, ctx2) |
|
2124 | 2131 | |
|
2125 | 2132 | if relroot is not None: |
|
2126 | # XXX this would ideally be done in the matcher, but that is generally | |
|
2127 | # meant to 'or' patterns, not 'and' them. In this case we need to 'and' | |
|
2128 | # all the patterns from the matcher with relroot. | |
|
2133 | if not relfiltered: | |
|
2134 | # XXX this would ideally be done in the matcher, but that is | |
|
2135 | # generally meant to 'or' patterns, not 'and' them. In this case we | |
|
2136 | # need to 'and' all the patterns from the matcher with relroot. | |
|
2129 | 2137 | def filterrel(l): |
|
2130 | 2138 | return [f for f in l if f.startswith(relroot)] |
|
2131 | 2139 | modified = filterrel(modified) |
|
2132 | 2140 | added = filterrel(added) |
|
2133 | 2141 | removed = filterrel(removed) |
|
2142 | relfiltered = True | |
|
2134 | 2143 | # filter out copies where either side isn't inside the relative root |
|
2135 | 2144 | copy = dict(((dst, src) for (dst, src) in copy.iteritems() |
|
2136 | 2145 | if dst.startswith(relroot) |
General Comments 0
You need to be logged in to leave comments.
Login now