mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
add tests for contrib/dumprevlog and undumprevlog
This commit is contained in:
parent
80f473ccc9
commit
5c85e0dcee
47
tests/test-dumprevlog
Normal file
47
tests/test-dumprevlog
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CONTRIBDIR=$TESTDIR/../contrib
|
||||||
|
|
||||||
|
mkdir repo-a
|
||||||
|
cd repo-a
|
||||||
|
hg init
|
||||||
|
|
||||||
|
echo this is file a > a
|
||||||
|
hg add a
|
||||||
|
hg commit -m first -d '0 0'
|
||||||
|
|
||||||
|
echo adding to file a >> a
|
||||||
|
hg commit -m second -d '0 0'
|
||||||
|
|
||||||
|
echo adding more to file a >> a
|
||||||
|
hg commit -m third -d '0 0'
|
||||||
|
|
||||||
|
hg verify
|
||||||
|
|
||||||
|
echo dumping revlog of file a to stdout:
|
||||||
|
python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
|
||||||
|
echo dumprevlog done
|
||||||
|
|
||||||
|
# dump all revlogs to file repo.dump
|
||||||
|
find .hg/store/ -name "*.i" | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
mkdir repo-b
|
||||||
|
cd repo-b
|
||||||
|
hg init
|
||||||
|
|
||||||
|
echo undumping:
|
||||||
|
python $CONTRIBDIR/undumprevlog < ../repo.dump
|
||||||
|
echo undumping done
|
||||||
|
|
||||||
|
hg verify
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo comparing repos:
|
||||||
|
hg -R repo-b incoming repo-a
|
||||||
|
hg -R repo-a incoming repo-b
|
||||||
|
echo comparing done
|
||||||
|
|
||||||
|
exit 0
|
53
tests/test-dumprevlog.out
Normal file
53
tests/test-dumprevlog.out
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
checking changesets
|
||||||
|
checking manifests
|
||||||
|
crosschecking files in changesets and manifests
|
||||||
|
checking files
|
||||||
|
1 files, 3 changesets, 3 total revisions
|
||||||
|
dumping revlog of file a to stdout:
|
||||||
|
file: .hg/store/data/a.i
|
||||||
|
node: 183d2312b35066fb6b3b449b84efc370d50993d0
|
||||||
|
linkrev: 0
|
||||||
|
parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
|
||||||
|
length: 15
|
||||||
|
-start-
|
||||||
|
this is file a
|
||||||
|
|
||||||
|
-end-
|
||||||
|
node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
|
||||||
|
linkrev: 1
|
||||||
|
parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
|
||||||
|
length: 32
|
||||||
|
-start-
|
||||||
|
this is file a
|
||||||
|
adding to file a
|
||||||
|
|
||||||
|
-end-
|
||||||
|
node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
|
||||||
|
linkrev: 2
|
||||||
|
parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
|
||||||
|
length: 54
|
||||||
|
-start-
|
||||||
|
this is file a
|
||||||
|
adding to file a
|
||||||
|
adding more to file a
|
||||||
|
|
||||||
|
-end-
|
||||||
|
dumprevlog done
|
||||||
|
undumping:
|
||||||
|
.hg/store/data/a.i
|
||||||
|
.hg/store/00manifest.i
|
||||||
|
.hg/store/00changelog.i
|
||||||
|
undumping done
|
||||||
|
checking changesets
|
||||||
|
checking manifests
|
||||||
|
crosschecking files in changesets and manifests
|
||||||
|
checking files
|
||||||
|
1 files, 3 changesets, 3 total revisions
|
||||||
|
comparing repos:
|
||||||
|
comparing with repo-a
|
||||||
|
searching for changes
|
||||||
|
no changes found
|
||||||
|
comparing with repo-b
|
||||||
|
searching for changes
|
||||||
|
no changes found
|
||||||
|
comparing done
|
Loading…
Reference in New Issue
Block a user