Mercurial > hg
annotate tests/test-dumprevlog.t @ 14002:a738c30d4b18
run-tests: add a lock for console I/O
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 24 Apr 2011 16:46:37 -0500 |
parents | ffb5c09ba822 |
children |
rev | line source |
---|---|
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
1 Set vars: |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
2 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
3 $ CONTRIBDIR=$TESTDIR/../contrib |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
4 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
5 Prepare repo-a: |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
6 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
12327
diff
changeset
|
7 $ hg init repo-a |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
8 $ cd repo-a |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
9 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
10 $ echo this is file a > a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
11 $ hg add a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
12 $ hg commit -m first |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
13 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
14 $ echo adding to file a >> a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
15 $ hg commit -m second |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
16 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
17 $ echo adding more to file a >> a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
18 $ hg commit -m third |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
19 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
20 $ hg verify |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
21 checking changesets |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
22 checking manifests |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
23 crosschecking files in changesets and manifests |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
24 checking files |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
25 1 files, 3 changesets, 3 total revisions |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
26 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
27 Dumping revlog of file a to stdout: |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
28 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
29 $ python $CONTRIBDIR/dumprevlog .hg/store/data/a.i |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
30 file: .hg/store/data/a.i |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
31 node: 183d2312b35066fb6b3b449b84efc370d50993d0 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
32 linkrev: 0 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
33 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
34 length: 15 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
35 -start- |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
36 this is file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
37 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
38 -end- |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
39 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
40 linkrev: 1 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
41 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
42 length: 32 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
43 -start- |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
44 this is file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
45 adding to file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
46 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
47 -end- |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
48 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
49 linkrev: 2 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
50 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
51 length: 54 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
52 -start- |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
53 this is file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
54 adding to file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
55 adding more to file a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
56 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
57 -end- |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
58 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
59 Dump all revlogs to file repo.dump: |
7229
7946503ec76e
introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents:
6516
diff
changeset
|
60 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
61 $ find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
62 $ cd .. |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
63 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
64 Undumping into repo-b: |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
65 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
12327
diff
changeset
|
66 $ hg init repo-b |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
67 $ cd repo-b |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
68 $ python $CONTRIBDIR/undumprevlog < ../repo.dump |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
69 .hg/store/00changelog.i |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
70 .hg/store/00manifest.i |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
71 .hg/store/data/a.i |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
72 $ cd .. |
7229
7946503ec76e
introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents:
6516
diff
changeset
|
73 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
74 Rebuild fncache with clone --pull: |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
75 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
76 $ hg clone --pull -U repo-b repo-c |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
77 requesting all changes |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
78 adding changesets |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
79 adding manifests |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
80 adding file changes |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
81 added 3 changesets with 3 changes to 1 files |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
82 |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
83 Verify: |
7229
7946503ec76e
introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents:
6516
diff
changeset
|
84 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
85 $ hg -R repo-c verify |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
86 checking changesets |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
87 checking manifests |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
88 crosschecking files in changesets and manifests |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
89 checking files |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
90 1 files, 3 changesets, 3 total revisions |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
91 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
92 Compare repos: |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
93 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
94 $ hg -R repo-c incoming repo-a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
95 comparing with repo-a |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
96 searching for changes |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
97 no changes found |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11867
diff
changeset
|
98 [1] |
6465
9b340e725c11
add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
99 |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
100 $ hg -R repo-a incoming repo-c |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
101 comparing with repo-c |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
102 searching for changes |
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
103 no changes found |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11867
diff
changeset
|
104 [1] |
11867
20bd477d0e89
tests: unify test-dumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
105 |