##// END OF EJS Templates
largefiles: fix largefiles+subrepo update (issue3752)...
Benoit Boissinot -
r18459:c9db897d stable
parent child Browse files
Show More
@@ -669,18 +669,18 b' def overriderevert(orig, ui, repo, *pats'
669 669 finally:
670 670 wlock.release()
671 671
672 def hgupdate(orig, repo, node):
673 # Only call updatelfiles the standins that have changed to save time
674 oldstandins = lfutil.getstandinsstate(repo)
675 result = orig(repo, node)
676 newstandins = lfutil.getstandinsstate(repo)
677 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
678 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
679 return result
672 def hgupdaterepo(orig, repo, node, overwrite):
673 if not overwrite:
674 # Only call updatelfiles on the standins that have changed to save time
675 oldstandins = lfutil.getstandinsstate(repo)
680 676
681 def hgclean(orig, repo, node, show_stats=True):
682 result = orig(repo, node, show_stats)
683 lfcommands.updatelfiles(repo.ui, repo)
677 result = orig(repo, node, overwrite)
678
679 filelist = None
680 if not overwrite:
681 newstandins = lfutil.getstandinsstate(repo)
682 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
683 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist)
684 684 return result
685 685
686 686 def hgmerge(orig, repo, node, force=None, remind=True):
@@ -109,11 +109,7 b' def uisetup(ui):'
109 109 entry = extensions.wrapfunction(commands, 'revert',
110 110 overrides.overriderevert)
111 111
112 # clone uses hg._update instead of hg.update even though they are the
113 # same function... so wrap both of them)
114 extensions.wrapfunction(hg, 'update', overrides.hgupdate)
115 extensions.wrapfunction(hg, '_update', overrides.hgupdate)
116 extensions.wrapfunction(hg, 'clean', overrides.hgclean)
112 extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo)
117 113 extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
118 114
119 115 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
@@ -16,9 +16,9 b' Create the repository outside $HOME sinc'
16 16 $ hg commit -m "Add foo as a largefile"
17 17
18 18 $ hg update -r 0
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 19 getting changed largefiles
21 20 0 largefiles updated, 1 removed
21 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 22
23 23 $ echo "normal" > foo
24 24 $ hg add foo
@@ -45,27 +45,27 b' but there is no cache file for it. So, '
45 45 "missing"(!) file.
46 46
47 47 $ hg update
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 48 getting changed largefiles
50 49 error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
51 50 0 largefiles updated, 0 removed
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 52 $ hg status
53 53 ! large
54 54
55 55 Update working directory to null: this cleanup .hg/largefiles/dirstate
56 56
57 57 $ hg update null
58 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
59 58 getting changed largefiles
60 59 0 largefiles updated, 0 removed
60 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
61 61
62 62 Update working directory to tip, again.
63 63
64 64 $ hg update
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 65 getting changed largefiles
67 66 error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
68 67 0 largefiles updated, 0 removed
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 69 $ hg status
70 70 ! large
71 71 $ cd ..
@@ -57,7 +57,6 b' makes copies instead of hardlinks:'
57 57 adding file changes
58 58 added 1 changesets with 1 changes to 1 files
59 59 updating to branch default
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 60 getting changed largefiles
62 61 abort: No space left on device
63 62 [255]
@@ -506,9 +506,9 b' accident.'
506 506 Test addremove with -R
507 507
508 508 $ hg up -C
509 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 509 getting changed largefiles
511 510 1 largefiles updated, 0 removed
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 512 $ rm normal3
513 513 $ rm sub/large4
514 514 $ echo "testing addremove with patterns" > testaddremove.dat
@@ -524,9 +524,9 b' Test addremove with -R'
524 524 Test 3364
525 525 $ hg clone . ../addrm
526 526 updating to branch default
527 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
528 527 getting changed largefiles
529 528 3 largefiles updated, 0 removed
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 530 $ cd ../addrm
531 531 $ cat >> .hg/hgrc <<EOF
532 532 > [hooks]
@@ -604,9 +604,9 b' Test 3507 (both normal files and largefi'
604 604 C sub2/large6
605 605 C sub2/large7
606 606 $ hg up -C '.^'
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 607 getting changed largefiles
609 608 0 largefiles updated, 0 removed
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 610 $ hg remove large
611 611 $ hg addremove --traceback
612 612 $ hg ci -m "removed large"
@@ -715,9 +715,9 b' Clone a largefiles repo.'
715 715
716 716 $ hg clone . ../b
717 717 updating to branch default
718 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
719 718 getting changed largefiles
720 719 3 largefiles updated, 0 removed
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 721 $ cd ../b
722 722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
723 723 7:daea875e9014 add/edit more largefiles
@@ -745,9 +745,9 b' Clone a largefiles repo.'
745 745 adding file changes
746 746 added 4 changesets with 10 changes to 4 files
747 747 updating to branch default
748 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
749 748 getting changed largefiles
750 749 2 largefiles updated, 0 removed
750 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
751 751 $ cd c
752 752 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
753 753 3:9e8fbc4bce62 copy files
@@ -767,9 +767,9 b' Old revisions of a clone have correct la'
767 767 tests update).
768 768
769 769 $ hg update -r 1
770 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
771 770 getting changed largefiles
772 771 1 largefiles updated, 0 removed
772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 773 $ cat large1
774 774 large11
775 775 $ cat sub/large2
@@ -781,17 +781,17 b' Test cloning with --all-largefiles flag'
781 781 $ rm "${USERCACHE}"/*
782 782 $ hg clone --all-largefiles a a-backup
783 783 updating to branch default
784 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 784 getting changed largefiles
786 785 3 largefiles updated, 0 removed
786 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 787 8 additional largefiles cached
788 788
789 789 $ rm "${USERCACHE}"/*
790 790 $ hg clone --all-largefiles -u 0 a a-clone0
791 791 updating to branch default
792 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 792 getting changed largefiles
794 793 2 largefiles updated, 0 removed
794 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 795 9 additional largefiles cached
796 796 $ hg -R a-clone0 sum
797 797 parent: 0:30d30fe6a5be
@@ -803,9 +803,9 b' Test cloning with --all-largefiles flag'
803 803 $ rm "${USERCACHE}"/*
804 804 $ hg clone --all-largefiles -u 1 a a-clone1
805 805 updating to branch default
806 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
807 806 getting changed largefiles
808 807 2 largefiles updated, 0 removed
808 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
809 809 8 additional largefiles cached
810 810 $ hg -R a-clone1 sum
811 811 parent: 1:ce8896473775
@@ -828,9 +828,9 b' Test cloning with --all-largefiles flag'
828 828 $ hg clone ../a
829 829 destination directory: a
830 830 updating to branch default
831 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 831 getting changed largefiles
833 832 3 largefiles updated, 0 removed
833 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
834 834 $ cd ..
835 835
836 836 Ensure base clone command argument validation
@@ -854,9 +854,9 b" downloaded from 'default' instead of 'de"
854 854 adding file changes
855 855 added 2 changesets with 8 changes to 4 files
856 856 updating to branch default
857 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
858 857 getting changed largefiles
859 858 2 largefiles updated, 0 removed
859 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
860 860 $ rm "${USERCACHE}"/*
861 861 $ cd a-backup
862 862 $ hg pull --all-largefiles --config paths.default-push=bogus/path
@@ -877,9 +877,9 b' revisions (this was a very bad bug that '
877 877
878 878 $ hg clone a d
879 879 updating to branch default
880 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
881 880 getting changed largefiles
882 881 3 largefiles updated, 0 removed
882 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
883 883 $ cd b
884 884 $ echo large4-modified > sub/large4
885 885 $ echo normal3-modified > normal3
@@ -897,9 +897,9 b' revisions (this was a very bad bug that '
897 897 $ cd ..
898 898 $ hg clone d e
899 899 updating to branch default
900 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
901 900 getting changed largefiles
902 901 3 largefiles updated, 0 removed
902 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
903 903 $ cd d
904 904
905 905 More rebase testing, but also test that the largefiles are downloaded from
@@ -1065,9 +1065,9 b' Rollback on largefiles.'
1065 1065 $ hg revert sub2/large7
1066 1066 $ hg -q update --clean -r null
1067 1067 $ hg update --clean
1068 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1069 1068 getting changed largefiles
1070 1069 3 largefiles updated, 0 removed
1070 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1071 1071 $ cat normal3
1072 1072 normal3-modified
1073 1073 $ cat sub/normal4
@@ -1086,22 +1086,22 b' Rollback on largefiles.'
1086 1086 demonstrate misfeature: .orig file is overwritten on every update -C,
1087 1087 also when clean:
1088 1088 $ hg update --clean
1089 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1090 1089 getting changed largefiles
1091 1090 0 largefiles updated, 0 removed
1091 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1092 1092 $ cat sub2/large7.orig
1093 1093 large7
1094 1094 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1095 1095
1096 1096 Now "update check" is happy.
1097 1097 $ hg update --check 8
1098 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1099 1098 getting changed largefiles
1100 1099 1 largefiles updated, 0 removed
1100 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1101 1101 $ hg update --check
1102 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1103 1102 getting changed largefiles
1104 1103 1 largefiles updated, 0 removed
1104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1105 1105
1106 1106 Test removing empty largefiles directories on update
1107 1107 $ test -d sub2 && echo "sub2 exists"
@@ -1190,14 +1190,14 b' correctly.'
1190 1190 adding file changes
1191 1191 added 8 changesets with 24 changes to 10 files
1192 1192 updating to branch default
1193 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1194 1193 getting changed largefiles
1195 1194 3 largefiles updated, 0 removed
1195 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1196 1196 $ hg clone temp f
1197 1197 updating to branch default
1198 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1199 1198 getting changed largefiles
1200 1199 3 largefiles updated, 0 removed
1200 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1201 1201 # Delete the largefiles in the largefiles system cache so that we have an
1202 1202 # opportunity to test that caching after a pull works.
1203 1203 $ rm "${USERCACHE}"/*
@@ -1289,9 +1289,9 b' Test that transplanting a largefile chan'
1289 1289 adding file changes
1290 1290 added 9 changesets with 26 changes to 10 files
1291 1291 updating to branch default
1292 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1293 1292 getting changed largefiles
1294 1293 3 largefiles updated, 0 removed
1294 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1295 1295 $ cd g
1296 1296 $ hg transplant -s ../d 598410d3eb9a
1297 1297 searching for changes
@@ -1551,7 +1551,6 b' Clone over http, with largefiles being p'
1551 1551 .hglf/f1: remote created -> g
1552 1552 updating: .hglf/f1 1/1 files (100.00%)
1553 1553 getting .hglf/f1
1554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1555 1554 getting changed largefiles
1556 1555 using http://localhost:$HGPORT2/
1557 1556 sending capabilities command
@@ -1561,6 +1560,7 b' Clone over http, with largefiles being p'
1561 1560 sending getlfile command
1562 1561 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1563 1562 1 largefiles updated, 0 removed
1563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1564 1564
1565 1565 $ ls http-clone-usercache/*
1566 1566 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
@@ -1601,9 +1601,9 b' We have to simulate that here by setting'
1601 1601 adding file changes
1602 1602 added 1 changesets with 1 changes to 1 files
1603 1603 updating to branch default
1604 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1605 1604 getting changed largefiles
1606 1605 1 largefiles updated, 0 removed
1606 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1607 1607 $ cd ..
1608 1608 $ chmod -R u+w alice/pubrepo
1609 1609 $ HOME="$ORIGHOME"
@@ -1755,23 +1755,48 b' Lock in subrepo, otherwise the change is'
1755 1755 A normal.txt
1756 1756 Invoking status precommit hook
1757 1757 M .hgsubstate
1758 $ hg archive -S lf_subrepo_archive
1759 $ find lf_subrepo_archive | sort
1760 lf_subrepo_archive
1761 lf_subrepo_archive/.hg_archival.txt
1762 lf_subrepo_archive/.hgsub
1763 lf_subrepo_archive/.hgsubstate
1764 lf_subrepo_archive/a
1765 lf_subrepo_archive/a/b
1766 lf_subrepo_archive/a/b/c
1767 lf_subrepo_archive/a/b/c/d
1768 lf_subrepo_archive/a/b/c/d/e.large.txt
1769 lf_subrepo_archive/a/b/c/d/e.normal.txt
1770 lf_subrepo_archive/a/b/c/x
1771 lf_subrepo_archive/a/b/c/x/y.normal.txt
1772 lf_subrepo_archive/subrepo
1773 lf_subrepo_archive/subrepo/large.txt
1774 lf_subrepo_archive/subrepo/normal.txt
1758 $ hg archive -S ../lf_subrepo_archive
1759 $ find ../lf_subrepo_archive | sort
1760 ../lf_subrepo_archive
1761 ../lf_subrepo_archive/.hg_archival.txt
1762 ../lf_subrepo_archive/.hgsub
1763 ../lf_subrepo_archive/.hgsubstate
1764 ../lf_subrepo_archive/a
1765 ../lf_subrepo_archive/a/b
1766 ../lf_subrepo_archive/a/b/c
1767 ../lf_subrepo_archive/a/b/c/d
1768 ../lf_subrepo_archive/a/b/c/d/e.large.txt
1769 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
1770 ../lf_subrepo_archive/a/b/c/x
1771 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
1772 ../lf_subrepo_archive/subrepo
1773 ../lf_subrepo_archive/subrepo/large.txt
1774 ../lf_subrepo_archive/subrepo/normal.txt
1775
1776 Test update with subrepos.
1777
1778 $ hg update 0
1779 getting changed largefiles
1780 0 largefiles updated, 1 removed
1781 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1782 $ hg status -S
1783 $ hg update tip
1784 getting changed largefiles
1785 1 largefiles updated, 0 removed
1786 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1787 $ hg status -S
1788 # modify a large file
1789 $ echo "modified" > subrepo/large.txt
1790 $ hg st -S
1791 M subrepo/large.txt
1792 # update -C should revert the change.
1793 $ hg update -C
1794 getting changed largefiles
1795 1 largefiles updated, 0 removed
1796 getting changed largefiles
1797 0 largefiles updated, 0 removed
1798 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1799 $ hg status -S
1775 1800
1776 1801 Test archiving a revision that references a subrepo that is not yet
1777 1802 cloned (see test-subrepo-recursion.t):
@@ -78,9 +78,9 b' Test link+rename largefile codepath'
78 78 "lfconvert" converts content correctly
79 79 $ cd largefiles-repo
80 80 $ hg up
81 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 81 getting changed largefiles
83 82 2 largefiles updated, 0 removed
83 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 84 $ hg locate
85 85 .hglf/large
86 86 .hglf/sub/maybelarge.dat
@@ -187,9 +187,9 b' lfconvert with rename, merge, and remove'
187 187 normal1
188 188 stuff/normal2
189 189 $ hg update
190 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 190 getting changed largefiles
192 191 1 largefiles updated, 0 removed
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 $ cat stuff/normal2
194 194 alsonormal
195 195 blah
General Comments 0
You need to be logged in to leave comments. Login now