##// END OF EJS Templates
test: enforce non-general delta in 'test-generaldelta.t'...
Pierre-Yves David -
r26866:0f75461a default
parent child Browse files
Show More
@@ -1,114 +1,114 b''
1 Check whether size of generaldelta revlog is not bigger than its
1 Check whether size of generaldelta revlog is not bigger than its
2 regular equivalent. Test would fail if generaldelta was naive
2 regular equivalent. Test would fail if generaldelta was naive
3 implementation of parentdelta: third manifest revision would be fully
3 implementation of parentdelta: third manifest revision would be fully
4 inserted due to big distance from its paren revision (zero).
4 inserted due to big distance from its paren revision (zero).
5
5
6 $ hg init repo
6 $ hg init repo
7 $ cd repo
7 $ cd repo
8 $ echo foo > foo
8 $ echo foo > foo
9 $ echo bar > bar
9 $ echo bar > bar
10 $ hg commit -q -Am boo
10 $ hg commit -q -Am boo
11 $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
11 $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
12 $ for r in 1 2 3; do
12 $ for r in 1 2 3; do
13 > echo $r > foo
13 > echo $r > foo
14 > hg commit -q -m $r
14 > hg commit -q -m $r
15 > hg up -q -r 0
15 > hg up -q -r 0
16 > hg pull . -q -r $r -R ../gdrepo
16 > hg pull . -q -r $r -R ../gdrepo
17 > done
17 > done
18
18
19 $ cd ..
19 $ cd ..
20 >>> import os
20 >>> import os
21 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
21 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
22 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
22 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
23 >>> if regsize < gdsize:
23 >>> if regsize < gdsize:
24 ... print 'generaldata increased size of manifest'
24 ... print 'generaldata increased size of manifest'
25
25
26 Verify rev reordering doesnt create invalid bundles (issue4462)
26 Verify rev reordering doesnt create invalid bundles (issue4462)
27 This requires a commit tree that when pulled will reorder manifest revs such
27 This requires a commit tree that when pulled will reorder manifest revs such
28 that the second manifest to create a file rev will be ordered before the first
28 that the second manifest to create a file rev will be ordered before the first
29 manifest to create that file rev. We also need to do a partial pull to ensure
29 manifest to create that file rev. We also need to do a partial pull to ensure
30 reordering happens. At the end we verify the linkrev points at the earliest
30 reordering happens. At the end we verify the linkrev points at the earliest
31 commit.
31 commit.
32
32
33 $ hg init server --config format.generaldelta=True
33 $ hg init server --config format.generaldelta=True
34 $ cd server
34 $ cd server
35 $ touch a
35 $ touch a
36 $ hg commit -Aqm a
36 $ hg commit -Aqm a
37 $ echo x > x
37 $ echo x > x
38 $ echo y > y
38 $ echo y > y
39 $ hg commit -Aqm xy
39 $ hg commit -Aqm xy
40 $ hg up -q '.^'
40 $ hg up -q '.^'
41 $ echo x > x
41 $ echo x > x
42 $ echo z > z
42 $ echo z > z
43 $ hg commit -Aqm xz
43 $ hg commit -Aqm xz
44 $ hg up -q 1
44 $ hg up -q 1
45 $ echo b > b
45 $ echo b > b
46 $ hg commit -Aqm b
46 $ hg commit -Aqm b
47 $ hg merge -q 2
47 $ hg merge -q 2
48 $ hg commit -Aqm merge
48 $ hg commit -Aqm merge
49 $ echo c > c
49 $ echo c > c
50 $ hg commit -Aqm c
50 $ hg commit -Aqm c
51 $ hg log -G -T '{rev} {shortest(node)} {desc}'
51 $ hg log -G -T '{rev} {shortest(node)} {desc}'
52 @ 5 ebb8 c
52 @ 5 ebb8 c
53 |
53 |
54 o 4 baf7 merge
54 o 4 baf7 merge
55 |\
55 |\
56 | o 3 a129 b
56 | o 3 a129 b
57 | |
57 | |
58 o | 2 958c xz
58 o | 2 958c xz
59 | |
59 | |
60 | o 1 f00c xy
60 | o 1 f00c xy
61 |/
61 |/
62 o 0 3903 a
62 o 0 3903 a
63
63
64 $ cd ..
64 $ cd ..
65 $ hg init client
65 $ hg init client --config format.generaldelta=false
66 $ cd client
66 $ cd client
67 $ hg pull -q ../server -r 4
67 $ hg pull -q ../server -r 4
68 $ hg debugindex x
68 $ hg debugindex x
69 rev offset length base linkrev nodeid p1 p2
69 rev offset length base linkrev nodeid p1 p2
70 0 0 3 0 1 1406e7411862 000000000000 000000000000
70 0 0 3 0 1 1406e7411862 000000000000 000000000000
71
71
72 $ cd ..
72 $ cd ..
73
73
74 Test format.aggressivemergedeltas
74 Test format.aggressivemergedeltas
75
75
76 $ hg init --config format.generaldelta=1 aggressive
76 $ hg init --config format.generaldelta=1 aggressive
77 $ cd aggressive
77 $ cd aggressive
78 $ touch a b c d e
78 $ touch a b c d e
79 $ hg commit -Aqm side1
79 $ hg commit -Aqm side1
80 $ hg up -q null
80 $ hg up -q null
81 $ touch x y
81 $ touch x y
82 $ hg commit -Aqm side2
82 $ hg commit -Aqm side2
83
83
84 - Verify non-aggressive merge uses p1 (commit 1) as delta parent
84 - Verify non-aggressive merge uses p1 (commit 1) as delta parent
85 $ hg merge -q 0
85 $ hg merge -q 0
86 $ hg commit -q -m merge
86 $ hg commit -q -m merge
87 $ hg debugindex -m
87 $ hg debugindex -m
88 rev offset length delta linkrev nodeid p1 p2
88 rev offset length delta linkrev nodeid p1 p2
89 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000
89 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000
90 1 59 59 -1 1 315c023f341d 000000000000 000000000000
90 1 59 59 -1 1 315c023f341d 000000000000 000000000000
91 2 118 65 1 2 2ab389a983eb 315c023f341d 8dde941edb6e
91 2 118 65 1 2 2ab389a983eb 315c023f341d 8dde941edb6e
92
92
93 $ hg strip -q -r . --config extensions.strip=
93 $ hg strip -q -r . --config extensions.strip=
94
94
95 - Verify aggressive merge uses p2 (commit 0) as delta parent
95 - Verify aggressive merge uses p2 (commit 0) as delta parent
96 $ hg up -q -C 1
96 $ hg up -q -C 1
97 $ hg merge -q 0
97 $ hg merge -q 0
98 $ hg commit -q -m merge --config format.aggressivemergedeltas=True
98 $ hg commit -q -m merge --config format.aggressivemergedeltas=True
99 $ hg debugindex -m
99 $ hg debugindex -m
100 rev offset length delta linkrev nodeid p1 p2
100 rev offset length delta linkrev nodeid p1 p2
101 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000
101 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000
102 1 59 59 -1 1 315c023f341d 000000000000 000000000000
102 1 59 59 -1 1 315c023f341d 000000000000 000000000000
103 2 118 62 0 2 2ab389a983eb 315c023f341d 8dde941edb6e
103 2 118 62 0 2 2ab389a983eb 315c023f341d 8dde941edb6e
104
104
105 Test that strip bundle use bundle2
105 Test that strip bundle use bundle2
106 $ hg --config extensions.strip= strip .
106 $ hg --config extensions.strip= strip .
107 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
107 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
108 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob)
108 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob)
109 $ hg debugbundle .hg/strip-backup/*
109 $ hg debugbundle .hg/strip-backup/*
110 Stream params: {'Compression': 'BZ'}
110 Stream params: {'Compression': 'BZ'}
111 changegroup -- "{'version': '02'}"
111 changegroup -- "{'version': '02'}"
112 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
112 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
113
113
114 $ cd ..
114 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now