Show More
@@ -82,8 +82,10 b' Interaction with Mercurial Commands' | |||
|
82 | 82 | ignored. |
|
83 | 83 | |
|
84 | 84 | :addremove: addremove does not recurse into subrepos unless |
|
85 |
-S/--subrepos is specified. |
|
|
86 | will print a warning and continue. | |
|
85 | -S/--subrepos is specified. However, if you specify the full | |
|
86 | path of a directory in a subrepo, addremove will be performed on | |
|
87 | it even without -S/--subrepos being specified. Git and | |
|
88 | Subversion subrepositories will print a warning and continue. | |
|
87 | 89 | |
|
88 | 90 | :archive: archive does not recurse in subrepositories unless |
|
89 | 91 | -S/--subrepos is specified. |
@@ -723,9 +723,17 b' def addremove(repo, matcher, prefix, opt' | |||
|
723 | 723 | ret = 0 |
|
724 | 724 | join = lambda f: os.path.join(prefix, f) |
|
725 | 725 | |
|
726 | def matchessubrepo(matcher, subpath): | |
|
727 | if matcher.exact(subpath): | |
|
728 | return True | |
|
729 | for f in matcher.files(): | |
|
730 | if f.startswith(subpath): | |
|
731 | return True | |
|
732 | return False | |
|
733 | ||
|
726 | 734 | wctx = repo[None] |
|
727 | 735 | for subpath in sorted(wctx.substate): |
|
728 | if opts.get('subrepos'): | |
|
736 | if opts.get('subrepos') or matchessubrepo(m, subpath): | |
|
729 | 737 | sub = wctx.sub(subpath) |
|
730 | 738 | try: |
|
731 | 739 | submatch = matchmod.narrowmatcher(subpath, m) |
@@ -147,9 +147,18 b' Test relative path printing + subrepos' | |||
|
147 | 147 | A sub1/foo |
|
148 | 148 | R sub1/sub2/test.txt |
|
149 | 149 | $ hg update -Cq |
|
150 | $ touch sub1/sub2/folder/bar | |
|
151 | $ hg addremove sub1/sub2 | |
|
152 | adding sub1/sub2/folder/bar (glob) | |
|
153 | $ hg status -S | |
|
154 | A sub1/sub2/folder/bar | |
|
155 | ? foo/bar/abc | |
|
156 | ? sub1/foo | |
|
157 | $ hg update -Cq | |
|
150 | 158 | $ rm sub1/sub2/folder/test.txt |
|
151 | 159 | $ rm sub1/sub2/test.txt |
|
152 | 160 | $ hg ci -ASm "remove test.txt" |
|
161 | adding sub1/sub2/folder/bar (glob) | |
|
153 | 162 | removing sub1/sub2/folder/test.txt (glob) |
|
154 | 163 | removing sub1/sub2/test.txt (glob) |
|
155 | 164 | adding sub1/foo (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now