test-verify.t
364 lines
| 9.8 KiB
| text/troff
|
Tads3Lexer
/ tests / test-verify.t
Gregory Szorc
|
r37446 | #require reporevlogstore | ||
Nicolas Dumazet
|
r11787 | prepare repo | ||
$ hg init a | ||||
$ cd a | ||||
$ echo "some text" > FOO.txt | ||||
$ echo "another text" > bar.txt | ||||
$ echo "more text" > QUICK.txt | ||||
$ hg add | ||||
adding FOO.txt | ||||
adding QUICK.txt | ||||
adding bar.txt | ||||
$ hg ci -mtest1 | ||||
verify | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 3 changes to 3 files | ||
Nicolas Dumazet
|
r11787 | |||
verify with journal | ||||
$ touch .hg/store/journal | ||||
$ hg verify | ||||
abandoned transaction found - run hg recover | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 3 changes to 3 files | ||
Nicolas Dumazet
|
r11787 | $ rm .hg/store/journal | ||
introduce some bugs in repo | ||||
$ cd .hg/store/data | ||||
$ mv _f_o_o.txt.i X_f_o_o.txt.i | ||||
$ mv bar.txt.i xbar.txt.i | ||||
$ rm _q_u_i_c_k.txt.i | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Matt Mackall
|
r25627 | warning: revlog 'data/FOO.txt.i' not in fncache! | ||
Nicolas Dumazet
|
r11787 | 0: empty or missing FOO.txt | ||
Martin von Zweigbergk
|
r28114 | FOO.txt@0: manifest refers to unknown revision f62022d3d590 | ||
Matt Mackall
|
r25627 | warning: revlog 'data/QUICK.txt.i' not in fncache! | ||
Nicolas Dumazet
|
r11787 | 0: empty or missing QUICK.txt | ||
Martin von Zweigbergk
|
r28114 | QUICK.txt@0: manifest refers to unknown revision 88b857db8eba | ||
Matt Mackall
|
r25627 | warning: revlog 'data/bar.txt.i' not in fncache! | ||
Nicolas Dumazet
|
r11787 | 0: empty or missing bar.txt | ||
Martin von Zweigbergk
|
r28114 | bar.txt@0: manifest refers to unknown revision 256559129457 | ||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 0 changes to 3 files | ||
Matt Mackall
|
r25627 | 3 warnings encountered! | ||
Gregory Szorc
|
r25653 | hint: run "hg debugrebuildfncache" to recover from corrupt fncache | ||
Matt Mackall
|
r25627 | 6 integrity errors encountered! | ||
Nicolas Dumazet
|
r11787 | (first damaged changeset appears to be 0) | ||
Matt Mackall
|
r12316 | [1] | ||
Nicolas Dumazet
|
r11787 | |||
Mads Kiilerich
|
r16912 | $ cd ../../.. | ||
Nicolas Dumazet
|
r11787 | $ cd .. | ||
Martin von Zweigbergk
|
r28110 | Set up a repo for testing missing revlog entries | ||
$ hg init missing-entries | ||||
$ cd missing-entries | ||||
$ echo 0 > file | ||||
$ hg ci -Aqm0 | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store .hg/store-partial | ||
Martin von Zweigbergk
|
r28110 | $ echo 1 > file | ||
$ hg ci -Aqm1 | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store .hg/store-full | ||
Martin von Zweigbergk
|
r28110 | |||
Entire changelog missing | ||||
$ rm .hg/store/00changelog.* | ||||
$ hg verify -q | ||||
0: empty or missing changelog | ||||
manifest@0: d0b6632564d4 not in changesets | ||||
manifest@1: 941fc4534185 not in changesets | ||||
3 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Entire manifest log missing | ||||
$ rm .hg/store/00manifest.* | ||||
$ hg verify -q | ||||
0: empty or missing manifest | ||||
1 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Entire filelog missing | ||||
$ rm .hg/store/data/file.* | ||||
$ hg verify -q | ||||
warning: revlog 'data/file.i' not in fncache! | ||||
0: empty or missing file | ||||
Martin von Zweigbergk
|
r28114 | file@0: manifest refers to unknown revision 362fef284ce2 | ||
file@1: manifest refers to unknown revision c10f2164107d | ||||
Martin von Zweigbergk
|
r28110 | 1 warnings encountered! | ||
hint: run "hg debugrebuildfncache" to recover from corrupt fncache | ||||
3 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Entire changelog and manifest log missing | ||||
$ rm .hg/store/00changelog.* | ||||
$ rm .hg/store/00manifest.* | ||||
$ hg verify -q | ||||
Gregory Szorc
|
r37428 | warning: orphan data file 'data/file.i' | ||
Martin von Zweigbergk
|
r28110 | 1 warnings encountered! | ||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Entire changelog and filelog missing | ||||
$ rm .hg/store/00changelog.* | ||||
$ rm .hg/store/data/file.* | ||||
$ hg verify -q | ||||
0: empty or missing changelog | ||||
manifest@0: d0b6632564d4 not in changesets | ||||
manifest@1: 941fc4534185 not in changesets | ||||
warning: revlog 'data/file.i' not in fncache! | ||||
?: empty or missing file | ||||
Martin von Zweigbergk
|
r28114 | file@0: manifest refers to unknown revision 362fef284ce2 | ||
file@1: manifest refers to unknown revision c10f2164107d | ||||
Martin von Zweigbergk
|
r28110 | 1 warnings encountered! | ||
hint: run "hg debugrebuildfncache" to recover from corrupt fncache | ||||
6 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Entire manifest log and filelog missing | ||||
$ rm .hg/store/00manifest.* | ||||
$ rm .hg/store/data/file.* | ||||
$ hg verify -q | ||||
0: empty or missing manifest | ||||
warning: revlog 'data/file.i' not in fncache! | ||||
0: empty or missing file | ||||
1 warnings encountered! | ||||
hint: run "hg debugrebuildfncache" to recover from corrupt fncache | ||||
2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Changelog missing entry | ||||
$ cp -f .hg/store-partial/00changelog.* .hg/store | ||||
$ hg verify -q | ||||
manifest@?: rev 1 points to nonexistent changeset 1 | ||||
manifest@?: 941fc4534185 not in changesets | ||||
file@?: rev 1 points to nonexistent changeset 1 | ||||
(expected 0) | ||||
1 warnings encountered! | ||||
3 integrity errors encountered! | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Manifest log missing entry | ||||
$ cp -f .hg/store-partial/00manifest.* .hg/store | ||||
$ hg verify -q | ||||
Martin von Zweigbergk
|
r28113 | manifest@1: changeset refers to unknown revision 941fc4534185 | ||
Martin von Zweigbergk
|
r28110 | file@1: c10f2164107d not in manifests | ||
2 integrity errors encountered! | ||||
(first damaged changeset appears to be 1) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Filelog missing entry | ||||
$ cp -f .hg/store-partial/data/file.* .hg/store/data | ||||
$ hg verify -q | ||||
Martin von Zweigbergk
|
r28114 | file@1: manifest refers to unknown revision c10f2164107d | ||
Martin von Zweigbergk
|
r28110 | 1 integrity errors encountered! | ||
(first damaged changeset appears to be 1) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Changelog and manifest log missing entry | ||||
$ cp -f .hg/store-partial/00changelog.* .hg/store | ||||
$ cp -f .hg/store-partial/00manifest.* .hg/store | ||||
$ hg verify -q | ||||
file@?: rev 1 points to nonexistent changeset 1 | ||||
(expected 0) | ||||
file@?: c10f2164107d not in manifests | ||||
1 warnings encountered! | ||||
2 integrity errors encountered! | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Changelog and filelog missing entry | ||||
$ cp -f .hg/store-partial/00changelog.* .hg/store | ||||
$ cp -f .hg/store-partial/data/file.* .hg/store/data | ||||
$ hg verify -q | ||||
manifest@?: rev 1 points to nonexistent changeset 1 | ||||
manifest@?: 941fc4534185 not in changesets | ||||
Martin von Zweigbergk
|
r28114 | file@?: manifest refers to unknown revision c10f2164107d | ||
Martin von Zweigbergk
|
r28110 | 3 integrity errors encountered! | ||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Manifest and filelog missing entry | ||||
$ cp -f .hg/store-partial/00manifest.* .hg/store | ||||
$ cp -f .hg/store-partial/data/file.* .hg/store/data | ||||
$ hg verify -q | ||||
Martin von Zweigbergk
|
r28113 | manifest@1: changeset refers to unknown revision 941fc4534185 | ||
Martin von Zweigbergk
|
r28110 | 1 integrity errors encountered! | ||
(first damaged changeset appears to be 1) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Corrupt changelog base node to cause failure to read revision | ||||
$ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \ | ||||
> 2> /dev/null | ||||
$ hg verify -q | ||||
0: unpacking changeset 08b1860757c2: * (glob) | ||||
manifest@?: rev 0 points to unexpected changeset 0 | ||||
manifest@?: d0b6632564d4 not in changesets | ||||
file@?: rev 0 points to unexpected changeset 0 | ||||
(expected 1) | ||||
1 warnings encountered! | ||||
4 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Corrupt manifest log base node to cause failure to read revision | ||||
$ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \ | ||||
> 2> /dev/null | ||||
$ hg verify -q | ||||
Martin von Zweigbergk
|
r28113 | manifest@0: reading delta d0b6632564d4: * (glob) | ||
Martin von Zweigbergk
|
r28110 | file@0: 362fef284ce2 not in manifests | ||
2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
Corrupt filelog base node to cause failure to read revision | ||||
$ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \ | ||||
> 2> /dev/null | ||||
$ hg verify -q | ||||
file@0: unpacking 362fef284ce2: * (glob) | ||||
1 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
Jun Wu
|
r30556 | $ cp -R .hg/store-full/. .hg/store | ||
Martin von Zweigbergk
|
r28110 | |||
$ cd .. | ||||
Patrick Mezard
|
r17385 | test changelog without a manifest | ||
Nicolas Dumazet
|
r11787 | |||
$ hg init b | ||||
$ cd b | ||||
Patrick Mezard
|
r17385 | $ hg branch foo | ||
marked working directory as branch foo | ||||
(branches are permanent and global, did you want a bookmark?) | ||||
$ hg ci -m branchfoo | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 0 changes to 0 files | ||
Patrick Mezard
|
r17385 | |||
test revlog corruption | ||||
Nicolas Dumazet
|
r11787 | |||
$ touch a | ||||
$ hg add a | ||||
$ hg ci -m a | ||||
$ echo 'corrupted' > b | ||||
$ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null | ||||
$ cat start b > .hg/store/data/a.i | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Matt Harbison
|
r50429 | a@1: broken revlog! (index a is corrupted) | ||
Gregory Szorc
|
r37428 | warning: orphan data file 'data/a.i' | ||
Meirambek Omyrzak
|
r39525 | checked 2 changesets with 0 changes to 1 files | ||
Nicolas Dumazet
|
r11787 | 1 warnings encountered! | ||
1 integrity errors encountered! | ||||
Patrick Mezard
|
r17385 | (first damaged changeset appears to be 1) | ||
Matt Mackall
|
r12316 | [1] | ||
Nicolas Dumazet
|
r11787 | |||
Thomas Arendsen Hein
|
r12172 | $ cd .. | ||
test revlog format 0 | ||||
Matt Mackall
|
r25472 | $ revlog-formatv0.py | ||
Thomas Arendsen Hein
|
r12172 | $ cd formatv0 | ||
$ hg verify | ||||
repository uses revlog format 0 | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 1 changes to 1 files | ||
Mads Kiilerich
|
r16912 | $ cd .. | ||
Jun Wu
|
r32288 | |||
test flag processor and skipflags | ||||
$ hg init skipflags | ||||
$ cd skipflags | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [extensions] | ||||
Martin von Zweigbergk
|
r32572 | > flagprocessor=$RUNTESTDIR/flagprocessorext.py | ||
Jun Wu
|
r32288 | > EOF | ||
$ echo '[BASE64]content' > base64 | ||||
$ hg commit -Aqm 'flag processor content' base64 | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 1 changes to 1 files | ||
Jun Wu
|
r32288 | |||
$ cat >> $TESTTMP/break-base64.py <<EOF | ||||
> import base64 | ||||
> base64.b64decode=lambda x: x | ||||
> EOF | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> breakbase64=$TESTTMP/break-base64.py | ||||
> EOF | ||||
$ hg verify | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Matt Harbison
|
r50429 | base64@0: unpacking 794cee7777cb: integrity check failed on base64:0 | ||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 1 changes to 1 files | ||
Jun Wu
|
r32288 | 1 integrity errors encountered! | ||
(first damaged changeset appears to be 0) | ||||
[1] | ||||
$ hg verify --config verify.skipflags=2147483647 | ||||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
Meirambek Omyrzak
|
r39525 | checked 1 changesets with 1 changes to 1 files | ||
Jun Wu
|
r32288 | |||