Show More
@@ -373,7 +373,8 b' def override_copy(orig, ui, repo, pats, ' | |||||
373 | origcopyfile = util.copyfile |
|
373 | origcopyfile = util.copyfile | |
374 | copiedfiles = [] |
|
374 | copiedfiles = [] | |
375 | def override_copyfile(src, dest): |
|
375 | def override_copyfile(src, dest): | |
376 |
if lfutil.shortname in src and |
|
376 | if (lfutil.shortname in src and | |
|
377 | dest.startswith(repo.wjoin(lfutil.shortname))): | |||
377 | destlfile = dest.replace(lfutil.shortname, '') |
|
378 | destlfile = dest.replace(lfutil.shortname, '') | |
378 | if not opts['force'] and os.path.exists(destlfile): |
|
379 | if not opts['force'] and os.path.exists(destlfile): | |
379 | raise IOError('', |
|
380 | raise IOError('', | |
@@ -388,18 +389,19 b' def override_copy(orig, ui, repo, pats, ' | |||||
388 |
|
389 | |||
389 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
390 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
390 | for (src, dest) in copiedfiles: |
|
391 | for (src, dest) in copiedfiles: | |
391 |
if lfutil.shortname in src and |
|
392 | if (lfutil.shortname in src and | |
392 |
|
|
393 | dest.startswith(repo.wjoin(lfutil.shortname))): | |
393 |
|
|
394 | srclfile = src.replace(repo.wjoin(lfutil.standin('')), '') | |
|
395 | destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '') | |||
394 | destlfiledir = os.path.dirname(destlfile) or '.' |
|
396 | destlfiledir = os.path.dirname(destlfile) or '.' | |
395 | if not os.path.isdir(destlfiledir): |
|
397 | if not os.path.isdir(destlfiledir): | |
396 | os.makedirs(destlfiledir) |
|
398 | os.makedirs(destlfiledir) | |
397 | if rename: |
|
399 | if rename: | |
398 | os.rename(srclfile, destlfile) |
|
400 | os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) | |
399 |
lfdirstate.remove( |
|
401 | lfdirstate.remove(srclfile) | |
400 | else: |
|
402 | else: | |
401 | util.copyfile(srclfile, destlfile) |
|
403 | util.copyfile(srclfile, destlfile) | |
402 |
lfdirstate.add( |
|
404 | lfdirstate.add(destlfile) | |
403 | lfdirstate.write() |
|
405 | lfdirstate.write() | |
404 | except util.Abort, e: |
|
406 | except util.Abort, e: | |
405 | if str(e) != 'no files to copy': |
|
407 | if str(e) != 'no files to copy': |
@@ -51,10 +51,13 b' Remove both largefiles and normal files.' | |||||
51 | $ ls |
|
51 | $ ls | |
52 | sub |
|
52 | sub | |
53 |
|
53 | |||
54 | Copy both largefiles and normal files. |
|
54 | Copy both largefiles and normal files (testing that status output is correct). | |
55 |
|
55 | |||
56 | $ hg cp sub/normal2 normal1 |
|
56 | $ hg cp sub/normal2 normal1 | |
57 | $ hg cp sub/large2 large1 |
|
57 | $ hg cp sub/large2 large1 | |
|
58 | $ hg st | |||
|
59 | A large1 | |||
|
60 | A normal1 | |||
58 | $ hg commit -m "copy files" |
|
61 | $ hg commit -m "copy files" | |
59 | $ cat normal1 |
|
62 | $ cat normal1 | |
60 | normal22 |
|
63 | normal22 | |
@@ -693,7 +696,22 b' Test that transplanting a largefile chan' | |||||
693 | large6-modified |
|
696 | large6-modified | |
694 | $ cat sub2/large7 |
|
697 | $ cat sub2/large7 | |
695 | large7 |
|
698 | large7 | |
696 | $ cd .. |
|
699 | ||
|
700 | Test that renaming a largefile results in correct output for status | |||
|
701 | ||||
|
702 | $ hg rename sub/large4 large4-renamed | |||
|
703 | $ hg st | |||
|
704 | A large4-renamed | |||
|
705 | R sub/large4 | |||
|
706 | $ hg commit -m "test rename output" | |||
|
707 | $ cat large4-renamed | |||
|
708 | large4-modified | |||
|
709 | $ cd sub2 | |||
|
710 | $ hg rename large6 large6-renamed | |||
|
711 | $ hg st | |||
|
712 | A sub2/large6-renamed | |||
|
713 | R sub2/large6 | |||
|
714 | $ cd ../.. | |||
697 |
|
715 | |||
698 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
716 | vanilla clients not locked out from largefiles servers on vanilla repos | |
699 | $ mkdir r1 |
|
717 | $ mkdir r1 |
General Comments 0
You need to be logged in to leave comments.
Login now