##// END OF EJS Templates
largefiles: enable subrepo support for add...
Matt Harbison -
r23886:5ce8dcd0 default
parent child Browse files
Show More
@@ -242,23 +242,25 b' def decodepath(orig, path):'
242 242
243 243 # -- Wrappers: modify existing commands --------------------------------
244 244
245 # Add works by going through the files that the user wanted to add and
246 # checking if they should be added as largefiles. Then it makes a new
247 # matcher which matches only the normal files and runs the original
248 # version of add.
249 245 def overrideadd(orig, ui, repo, *pats, **opts):
250 246 normal = opts.get('normal')
251 247 if normal:
252 248 if opts.get('large'):
253 249 raise util.Abort(_('--normal cannot be used with --large'))
254 250 return orig(ui, repo, *pats, **opts)
255 matcher = scmutil.match(repo[None], pats, opts)
256 added, bad = addlargefiles(ui, repo, False, matcher, **opts)
257 installnormalfilesmatchfn(repo[None].manifest())
258 result = orig(ui, repo, *pats, **opts)
259 restorematchfn()
251
252 def cmdutiladd(orig, ui, repo, matcher, prefix, explicitonly, **opts):
253 # The --normal flag short circuits this override
254 if opts.get('normal'):
255 return orig(ui, repo, matcher, prefix, explicitonly, **opts)
260 256
261 return (result == 1 or bad) and 1 or 0
257 ladded, lbad = addlargefiles(ui, repo, False, matcher, **opts)
258 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(),
259 ladded)
260 bad = orig(ui, repo, normalmatcher, prefix, explicitonly, **opts)
261
262 bad.extend(f for f in lbad)
263 return bad
262 264
263 265 def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos):
264 266 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest())
@@ -33,6 +33,7 b' def uisetup(ui):'
33 33 # and in the process of handling commit -A (issue3542)
34 34 entry = extensions.wrapfunction(scmutil, 'addremove',
35 35 overrides.scmutiladdremove)
36 extensions.wrapfunction(cmdutil, 'add', overrides.cmdutiladd)
36 37 extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove)
37 38 extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget)
38 39
@@ -214,7 +214,7 b' verify that large files in subrepos hand'
214 214 A .hgsub
215 215 ? .hgsubstate
216 216 $ echo "rev 1" > subrepo/large.txt
217 $ hg -R subrepo add --large subrepo/large.txt
217 $ hg add --large subrepo/large.txt
218 218 $ hg sum
219 219 parent: 1:8ee150ea2e9c tip
220 220 add subrepo
@@ -326,19 +326,27 b' Find an exact match to a standin (should'
326 326 $ cat >> $HGRCPATH <<EOF
327 327 > [extensions]
328 328 > largefiles=
329 > [largefiles]
330 > patterns=glob:**.dat
329 331 > EOF
330 332
331 333 Test forget through a deep subrepo with the largefiles extension, both a
332 334 largefile and a normal file. Then a largefile that hasn't been committed yet.
333 335 $ touch sub1/sub2/untracked.txt
336 $ touch sub1/sub2/large.dat
334 337 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
335 338 not removing sub1/sub2/untracked.txt: file is already untracked (glob)
336 339 [1]
337 $ hg add -v --large -R sub1/sub2 sub1/sub2/untracked.txt
340 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
338 341 adding sub1/sub2/untracked.txt as a largefile (glob)
342 $ hg add --large -v sub1/sub2/untracked.txt
343 adding sub1/sub2/untracked.txt as a largefile (glob)
344 $ hg add --normal -v sub1/sub2/large.dat
345 adding sub1/sub2/large.dat (glob)
339 346 $ hg forget -v sub1/sub2/untracked.txt
340 347 removing sub1/sub2/untracked.txt (glob)
341 348 $ hg status -S
349 A sub1/sub2/large.dat
342 350 R sub1/sub2/large.bin
343 351 R sub1/sub2/test.txt
344 352 ? foo/bar/abc
General Comments 0
You need to be logged in to leave comments. Login now