##// END OF EJS Templates
addremove: support addremove with explicit paths in subrepos...
Matt Harbison -
r23539:cb42050f default
parent child Browse files
Show More
@@ -82,8 +82,10 b' Interaction with Mercurial Commands'
82 ignored.
82 ignored.
83
83
84 :addremove: addremove does not recurse into subrepos unless
84 :addremove: addremove does not recurse into subrepos unless
85 -S/--subrepos is specified. Git and Subversion subrepositories
85 -S/--subrepos is specified. However, if you specify the full
86 will print a warning and continue.
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 :archive: archive does not recurse in subrepositories unless
90 :archive: archive does not recurse in subrepositories unless
89 -S/--subrepos is specified.
91 -S/--subrepos is specified.
@@ -723,9 +723,17 b' def addremove(repo, matcher, prefix, opt'
723 ret = 0
723 ret = 0
724 join = lambda f: os.path.join(prefix, f)
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 wctx = repo[None]
734 wctx = repo[None]
727 for subpath in sorted(wctx.substate):
735 for subpath in sorted(wctx.substate):
728 if opts.get('subrepos'):
736 if opts.get('subrepos') or matchessubrepo(m, subpath):
729 sub = wctx.sub(subpath)
737 sub = wctx.sub(subpath)
730 try:
738 try:
731 submatch = matchmod.narrowmatcher(subpath, m)
739 submatch = matchmod.narrowmatcher(subpath, m)
@@ -147,9 +147,18 b' Test relative path printing + subrepos'
147 A sub1/foo
147 A sub1/foo
148 R sub1/sub2/test.txt
148 R sub1/sub2/test.txt
149 $ hg update -Cq
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 $ rm sub1/sub2/folder/test.txt
158 $ rm sub1/sub2/folder/test.txt
151 $ rm sub1/sub2/test.txt
159 $ rm sub1/sub2/test.txt
152 $ hg ci -ASm "remove test.txt"
160 $ hg ci -ASm "remove test.txt"
161 adding sub1/sub2/folder/bar (glob)
153 removing sub1/sub2/folder/test.txt (glob)
162 removing sub1/sub2/folder/test.txt (glob)
154 removing sub1/sub2/test.txt (glob)
163 removing sub1/sub2/test.txt (glob)
155 adding sub1/foo (glob)
164 adding sub1/foo (glob)
General Comments 0
You need to be logged in to leave comments. Login now