comparison tests/test-largefiles-update.t @ 30189:4999c12c526b stable

largefiles: test coverage of fatal interruption of update Test using existing changesets in a clean working directory, revealing problems with files that don't show up as modified or do show up as removed when they just not have been written yet.
author Mads Kiilerich <madski@unity3d.com>
date Sun, 16 Oct 2016 02:26:38 +0200
parents b59ef0c21405
children 56b930238036
comparison
equal deleted inserted replaced
30031:8d74027bd4e7 30189:4999c12c526b
142 M large1 142 M large1
143 $ cat large1 143 $ cat large1
144 large1 in #1 144 large1 in #1
145 $ cat .hglf/large1 145 $ cat .hglf/large1
146 58e24f733a964da346e2407a2bee99d9001184f5 146 58e24f733a964da346e2407a2bee99d9001184f5
147 $ rm normal1.orig
147 148
148 (merge non-existing largefiles from "other" via conflict prompt - 149 (merge non-existing largefiles from "other" via conflict prompt -
149 make sure the following commit doesn't abort in a confusing way when trying to 150 make sure the following commit doesn't abort in a confusing way when trying to
150 mark the non-existing file as normal in lfdirstate) 151 mark the non-existing file as normal in lfdirstate)
151 152
241 242
242 $ hg status -A largeY 243 $ hg status -A largeY
243 ? largeY 244 ? largeY
244 $ test -f .hglf/largeY 245 $ test -f .hglf/largeY
245 [1] 246 [1]
247 $ rm largeY
246 248
247 Test that "hg rollback" restores standins correctly 249 Test that "hg rollback" restores standins correctly
248 250
249 $ hg commit -m 'will be rollback-ed soon' 251 $ hg commit -m 'will be rollback-ed soon'
250 $ hg update -q -C 2 252 $ hg update -q -C 2
283 285
284 $ cat .hglf/large1 286 $ cat .hglf/large1
285 58e24f733a964da346e2407a2bee99d9001184f5 287 58e24f733a964da346e2407a2bee99d9001184f5
286 $ cat .hglf/large2 288 $ cat .hglf/large2
287 1deebade43c8c498a3c8daddac0244dc55d1331d 289 1deebade43c8c498a3c8daddac0244dc55d1331d
290 $ rm normalX
288 291
289 Test that "hg status" shows status of largefiles correctly just after 292 Test that "hg status" shows status of largefiles correctly just after
290 automated commit like rebase/transplant 293 automated commit like rebase/transplant
291 294
292 $ cat >> .hg/hgrc <<EOF 295 $ cat >> .hg/hgrc <<EOF
596 [1] 599 [1]
597 $ cat .hglf/large1 600 $ cat .hglf/large1
598 58e24f733a964da346e2407a2bee99d9001184f5 601 58e24f733a964da346e2407a2bee99d9001184f5
599 $ cat large1 602 $ cat large1
600 large1 in #1 603 large1 in #1
604 $ rm normal1.orig
601 605
602 Test that rebase updates standins for manually modified largefiles at 606 Test that rebase updates standins for manually modified largefiles at
603 the 1st commit of resuming. 607 the 1st commit of resuming.
604 608
605 $ echo "manually modified before 'hg rebase --continue'" > large1 609 $ echo "manually modified before 'hg rebase --continue'" > large1
726 $ hg status -A --rev tip large2 730 $ hg status -A --rev tip large2
727 C large2 731 C large2
728 732
729 #endif 733 #endif
730 734
735 Test a fatal error interrupting an update. lfdirstate doesn't realize that
736 .hglf has been updated while the largefile hasn't. Status thus shows a clean
737 state ... but rebuilding lfdirstate and checking all hashes reveals it isn't
738 clean.
739
740 Start with clean dirstates:
741 $ hg up -qcr "8^"
742 $ sleep 1
743 $ hg st
744 Update standins without updating largefiles:
745 $ cat << EOF > ../crashupdatelfiles.py
746 > import hgext.largefiles.lfutil
747 > def getlfilestoupdate(oldstandins, newstandins):
748 > raise SystemExit(7)
749 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
750 > EOF
751 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
752 [7]
753 Check large1 content and status:
754 BUG: largeX is R and large1 is not M and update does nothing
755 $ cat large1
756 large1 in #3
757 $ hg st
758 R largeX
759 $ hg up -Cr .
760 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 $ hg st
762 R largeX
763 Force largefiles rehashing and check again - revealing modifications that
764 update now can remove:
765 $ rm .hg/largefiles/dirstate
766 $ hg st
767 M large1
768 ! largeX
769 $ hg up -Cr .
770 getting changed largefiles
771 2 largefiles updated, 0 removed
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 $ hg st
774 $ cat large1
775 manually modified before 'hg transplant --continue'
776
731 $ cd .. 777 $ cd ..
732 778
733 Test that "hg convert" avoids copying largefiles from the working 779 Test that "hg convert" avoids copying largefiles from the working
734 directory into store, because "hg convert" doesn't update largefiles 780 directory into store, because "hg convert" doesn't update largefiles
735 in the working directory (removing files under ".cache/largefiles" 781 in the working directory (removing files under ".cache/largefiles"