sapling/eden/scm/tests/test-clone-resume.t
Durham Goode 1183f14f11 treemanifest: disable flatcompat by default
Summary:
This was a hack to allow the tests to produce the same hashes as
before. Let's disable this and fix the remaining test failures. A future diff
will remove the feature entirely.

Where possible I changed input hashes to desc() and output hashes to globs so
hopefully future hash changes are a little easier.

Differential Revision: D29567762

fbshipit-source-id: cf5150c112c56b08f583feba80e5a636cc07db0a
2021-07-13 15:04:57 -07:00

64 lines
1.9 KiB
Perl

#chg-compatible
$ configure modern
$ setconfig clone.nativecheckout=True
$ newserver server
Create a repo that touches a few files
$ newremoterepo client1
$ mkdir dir1 dir2
$ for i in {0..5000} ; do touch dir1/$i ; done
$ touch dir2/x
$ hg commit -Aqm 'initial commit' 2>/dev/null
$ hg push --to master --create -q
$ cd ..
Bare clone the repo
$ newremoterepo client2
$ hg pull -q
#if no-windows
Make some of the directories we are about to checkout read-only so we encounter
an error mid-checkout.
$ mkdir dir2
$ chmod -R a-w dir2
$ hg checkout tip --config remotefilelog.debug=False
abort: Permission denied* (glob)
[255]
Verify we see the warning for other commands
$ hg log -r .
warning: this repository appears to have not finished cloning - run 'hg checkout --continue' to resume the clone
commit: 000000000000
user:
date: Thu Jan 01 00:00:00 1970 +0000
Verify we cannot specify --continue and a rev
$ hg checkout master --continue
warning: this repository appears to have not finished cloning - run 'hg checkout --continue' to resume the clone
abort: cannot specify --continue and a update revision
[255]
Verify the checkout resumes where it left off
- [^0].* tells it to not match "0", so we can ensure some files were skipped.
$ chmod -R a+w dir2
$ EDENSCM_LOG=checkout=debug hg checkout --continue
warning: this repository appears to have not finished cloning - run 'hg checkout --continue' to resume the clone
continuing checkout to '*' (glob)
DEBUG checkout: Skipping checking out [^0].* files since they're already written (re)
5002 files updated, 0 files merged, 0 files removed, 0 files unresolved
Verify we can disable resumable checkouts
$ hg checkout -q null
$ mkdir dir2
$ chmod -R a-w dir2
$ hg checkout tip --config checkout.resumable=False
abort: * (glob)
[255]
$ chmod -R a+w dir2
$ test -f .hg/updateprogress
[1]
$ chmod -R a-w dir2
#endif