mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
27a1ffa9d1
Summary: On Windows the error message is different. In this test we only need to verify a command fails. Therefore remove the output and only keep the exit code. Reviewed By: xavierd Differential Revision: D18915580 fbshipit-source-id: bd1031170335918d507e6225b02541ec52bc62fa
80 lines
1.8 KiB
Perl
80 lines
1.8 KiB
Perl
#chg-compatible
|
|
|
|
(This test needs to re-run the hg process. Therefore hard to use single-process Python test)
|
|
|
|
Test indexedlogdatapack
|
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
$ newrepo master
|
|
$ setconfig remotefilelog.server=true remotefilelog.serverexpiration=-1
|
|
|
|
$ cd $TESTTMP
|
|
$ enable remotenames
|
|
$ setconfig remotefilelog.debug=false remotefilelog.indexedlogdatastore=true remotefilelog.fetchpacks=true
|
|
$ setconfig diff.git=true experimental.narrow-heads=true mutation.record=true mutation.enabled=true mutation.date="0 0" visibility.enabled=1
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
|
$ cd shallow
|
|
|
|
Make some commits
|
|
|
|
$ drawdag << 'EOS'
|
|
> B C # amend: B -> C
|
|
> |/
|
|
> A
|
|
> EOS
|
|
|
|
When everything looks okay:
|
|
|
|
$ hg doctor
|
|
mutation: looks okay
|
|
metalog: looks okay
|
|
allheads: looks okay
|
|
indexedlogdatastore: looks okay
|
|
|
|
Break the repo in various ways:
|
|
|
|
$ echo x > $TESTTMP/hgcache/master/indexedlogdatastore/latest
|
|
$ echo y > $TESTTMP/hgcache/master/indexedlogdatastore/0/index-node.sum
|
|
$ mkdir -p .hg/store/mutation/
|
|
$ echo v > .hg/store/mutation/log
|
|
$ echo xx > .hg/store/metalog/blobs/index-id
|
|
$ echo xx > .hg/store/metalog/roots/meta
|
|
$ rm .hg/store/allheads/meta
|
|
|
|
Check the repo is broken (exit code is non-zero):
|
|
|
|
$ hg log -GpT '{desc}\n' &>/dev/null
|
|
[255]
|
|
|
|
Test that 'hg doctor' can fix them:
|
|
|
|
$ hg doctor
|
|
mutation: repaired
|
|
metalog: repaired
|
|
allheads: repaired
|
|
indexedlogdatastore: repaired
|
|
|
|
Check the repo is usable again:
|
|
|
|
$ hg log -GpT '{desc}\n'
|
|
o C
|
|
| diff --git a/C b/C
|
|
| new file mode 100644
|
|
| --- /dev/null
|
|
| +++ b/C
|
|
| @@ -0,0 +1,1 @@
|
|
| +C
|
|
| \ No newline at end of file
|
|
|
|
|
o A
|
|
diff --git a/A b/A
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/A
|
|
@@ -0,0 +1,1 @@
|
|
+A
|
|
\ No newline at end of file
|
|
|