##// END OF EJS Templates
largefiles: don't print files as both large and normal in addremove dryruns
Matt Harbison -
r23769:bb3ee61c default
parent child Browse files
Show More
@@ -34,10 +34,14 b' def composelargefilematcher(match, manif'
34 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
34 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
35 return m
35 return m
36
36
37 def composenormalfilematcher(match, manifest):
37 def composenormalfilematcher(match, manifest, exclude=None):
38 excluded = set()
39 if exclude is not None:
40 excluded.update(exclude)
41
38 m = copy.copy(match)
42 m = copy.copy(match)
39 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
43 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
40 manifest)
44 manifest or f in excluded)
41 m._files = filter(notlfile, m._files)
45 m._files = filter(notlfile, m._files)
42 m._fmap = set(m._files)
46 m._fmap = set(m._files)
43 m._always = False
47 m._always = False
@@ -1132,11 +1136,11 b' def scmutiladdremove(orig, repo, matcher'
1132 removelargefiles(repo.ui, repo, True, m, **opts)
1136 removelargefiles(repo.ui, repo, True, m, **opts)
1133 # Call into the normal add code, and any files that *should* be added as
1137 # Call into the normal add code, and any files that *should* be added as
1134 # largefiles will be
1138 # largefiles will be
1135 addlargefiles(repo.ui, repo, True, matcher, **opts)
1139 added, bad = addlargefiles(repo.ui, repo, True, matcher, **opts)
1136 # Now that we've handled largefiles, hand off to the original addremove
1140 # Now that we've handled largefiles, hand off to the original addremove
1137 # function to take care of the rest. Make sure it doesn't do anything with
1141 # function to take care of the rest. Make sure it doesn't do anything with
1138 # largefiles by passing a matcher that will ignore them.
1142 # largefiles by passing a matcher that will ignore them.
1139 matcher = composenormalfilematcher(matcher, repo[None].manifest())
1143 matcher = composenormalfilematcher(matcher, repo[None].manifest(), added)
1140 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1144 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1141
1145
1142 # Calling purge with --all will cause the largefiles to be deleted.
1146 # Calling purge with --all will cause the largefiles to be deleted.
@@ -262,7 +262,6 b' Add a normal file to the subrepo, then t'
262 removing subrepo/large.txt
262 removing subrepo/large.txt
263 adding subrepo/normal.txt
263 adding subrepo/normal.txt
264 adding subrepo/renamed-large.txt
264 adding subrepo/renamed-large.txt
265 adding large.dat
266 $ hg status -S
265 $ hg status -S
267 ! subrepo/large.txt
266 ! subrepo/large.txt
268 ? large.dat
267 ? large.dat
@@ -295,7 +294,6 b' Add a normal file to the subrepo, then t'
295 removing subrepo/large.txt
294 removing subrepo/large.txt
296 adding subrepo/normal.txt
295 adding subrepo/normal.txt
297 adding subrepo/renamed-large.txt
296 adding subrepo/renamed-large.txt
298 adding large.dat
299 $ cd statusmatch
297 $ cd statusmatch
300
298
301 $ mv subrepo/renamed-large.txt subrepo/large.txt
299 $ mv subrepo/renamed-large.txt subrepo/large.txt
General Comments 0
You need to be logged in to leave comments. Login now