##// END OF EJS Templates
largefiles: use the core file copy logic to validate the destination path...
Matt Harbison -
r24006:42fa7eeb default
parent child Browse files
Show More
@@ -559,16 +559,6 b' def overridecopy(orig, ui, repo, pats, o'
559 559 # this isn't legal, let the original function deal with it
560 560 return orig(ui, repo, pats, opts, rename)
561 561
562 def makestandin(relpath):
563 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
564 return os.path.join(repo.wjoin(lfutil.standin(path)))
565
566 fullpats = scmutil.expandpats(pats)
567 dest = fullpats[-1]
568
569 if os.path.isdir(dest):
570 if not os.path.isdir(makestandin(dest)):
571 os.makedirs(makestandin(dest))
572 562 # This could copy both lfiles and normal files in one command,
573 563 # but we don't want to do that. First replace their matcher to
574 564 # only match normal files and run it, then replace it to just
@@ -595,6 +585,17 b' def overridecopy(orig, ui, repo, pats, o'
595 585 except OSError:
596 586 return result
597 587
588 def makestandin(relpath):
589 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
590 return os.path.join(repo.wjoin(lfutil.standin(path)))
591
592 fullpats = scmutil.expandpats(pats)
593 dest = fullpats[-1]
594
595 if os.path.isdir(dest):
596 if not os.path.isdir(makestandin(dest)):
597 os.makedirs(makestandin(dest))
598
598 599 try:
599 600 try:
600 601 # When we call orig below it creates the standins but we don't add
@@ -620,10 +620,16 b' check illegal path components'
620 620 $ hg rename d1/d11/a1 .hg
621 621 abort: path contains illegal component: .hg/a1 (glob)
622 622 [255]
623 $ hg --config extensions.largefiles= rename d1/d11/a1 .hg
624 abort: path contains illegal component: .hg/a1 (glob)
625 [255]
623 626 $ hg status -C
624 627 $ hg rename d1/d11/a1 ..
625 628 abort: ../a1 not under root '$TESTTMP' (glob)
626 629 [255]
630 $ hg --config extensions.largefiles= rename d1/d11/a1 ..
631 abort: ../a1 not under root '$TESTTMP' (glob)
632 [255]
627 633 $ hg status -C
628 634
629 635 $ mv d1/d11/a1 .hg
General Comments 0
You need to be logged in to leave comments. Login now