Show More
@@ -0,0 +1,196 b'' | |||
|
1 | ============================================================================ | |
|
2 | Pulling from modern to a non-general delta target (and other related checks) | |
|
3 | ============================================================================ | |
|
4 | ||
|
5 | There is various issue that can arise when we update the code with modern | |
|
6 | storage in mind while working on delta processing. So this file is meant for | |
|
7 | various scenario that might break in the future or have break in the past. | |
|
8 | ||
|
9 | Setup | |
|
10 | ===== | |
|
11 | ||
|
12 | Create a modern server with an older clone | |
|
13 | ||
|
14 | $ cat << EOF >> $HGRCPATH | |
|
15 | > [command-templates] | |
|
16 | > log = "{desc} {tags}\n" | |
|
17 | > EOF | |
|
18 | ||
|
19 | $ hg init server | |
|
20 | ||
|
21 | $ hg clone --quiet --pull server client --config format.usegeneraldelta=no | |
|
22 | $ hg debugformat -R client | grep generaldelta | |
|
23 | generaldelta: no | |
|
24 | ||
|
25 | Create some complexe history | |
|
26 | ||
|
27 | $ cd server | |
|
28 | $ hg debugbuilddag -n '.+3:a$.+5:b/a:k$.+7:c/b:l$.+6:d/a:m<k+6/l+1/m' | |
|
29 | $ hg log -G | |
|
30 | o r36 tip | |
|
31 | |\ | |
|
32 | | o r35 | |
|
33 | | | | |
|
34 | | o r34 | |
|
35 | | |\ | |
|
36 | | | o r33 | |
|
37 | | | | | |
|
38 | | | o r32 | |
|
39 | | | | | |
|
40 | | | o r31 | |
|
41 | | | | | |
|
42 | | | o r30 | |
|
43 | | | | | |
|
44 | | | o r29 | |
|
45 | | | | | |
|
46 | | | o r28 | |
|
47 | | | | | |
|
48 | o | | r27 m | |
|
49 | |\ \ \ | |
|
50 | | o | | r26 d | |
|
51 | | | | | | |
|
52 | | o | | r25 | |
|
53 | | | | | | |
|
54 | | o | | r24 | |
|
55 | | | | | | |
|
56 | | o | | r23 | |
|
57 | | | | | | |
|
58 | | o | | r22 | |
|
59 | | | | | | |
|
60 | | o | | r21 | |
|
61 | | | | | | |
|
62 | | o | | r20 | |
|
63 | | / / | |
|
64 | | o | r19 l | |
|
65 | | |\ \ | |
|
66 | | | o | r18 c | |
|
67 | | | | | | |
|
68 | | | o | r17 | |
|
69 | | | | | | |
|
70 | | | o | r16 | |
|
71 | | | | | | |
|
72 | | | o | r15 | |
|
73 | | | | | | |
|
74 | | | o | r14 | |
|
75 | | | | | | |
|
76 | | | o | r13 | |
|
77 | | | | | | |
|
78 | | | o | r12 | |
|
79 | | | | | | |
|
80 | | | o | r11 | |
|
81 | | | / | |
|
82 | +---o r10 k | |
|
83 | | |/ | |
|
84 | | o r9 b | |
|
85 | | | | |
|
86 | | o r8 | |
|
87 | | | | |
|
88 | | o r7 | |
|
89 | | | | |
|
90 | | o r6 | |
|
91 | | | | |
|
92 | | o r5 | |
|
93 | | | | |
|
94 | | o r4 | |
|
95 | | | |
|
96 | o r3 a | |
|
97 | | | |
|
98 | o r2 | |
|
99 | | | |
|
100 | o r1 | |
|
101 | | | |
|
102 | o r0 | |
|
103 | ||
|
104 | $ cd .. | |
|
105 | ||
|
106 | ||
|
107 | Pull it in the client | |
|
108 | ===================== | |
|
109 | ||
|
110 | ||
|
111 | pull with default value | |
|
112 | ----------------------- | |
|
113 | ||
|
114 | $ cp -R client client-simple-pull | |
|
115 | $ hg -R client-simple-pull pull | |
|
116 | pulling from $TESTTMP/server | |
|
117 | requesting all changes | |
|
118 | adding changesets | |
|
119 | adding manifests | |
|
120 | adding file changes | |
|
121 | added 37 changesets with 37 changes to 37 files | |
|
122 | new changesets 61246295ee1e:b4b117cbbcf3 | |
|
123 | (run 'hg update' to get a working copy) | |
|
124 | $ hg -R client-simple-pull verify | |
|
125 | checking changesets | |
|
126 | checking manifests | |
|
127 | crosschecking files in changesets and manifests | |
|
128 | checking files | |
|
129 | checking dirstate | |
|
130 | checked 37 changesets with 37 changes to 37 files | |
|
131 | ||
|
132 | ||
|
133 | pull with "no-reuse" policy | |
|
134 | --------------------------- | |
|
135 | ||
|
136 | $ cp -R client client-no-reuse | |
|
137 | $ hg -R client-no-reuse pull --config paths.default:pulled-delta-reuse-policy=no-reuse | |
|
138 | pulling from $TESTTMP/server | |
|
139 | requesting all changes | |
|
140 | adding changesets | |
|
141 | adding manifests | |
|
142 | adding file changes | |
|
143 | added 37 changesets with 37 changes to 37 files | |
|
144 | new changesets 61246295ee1e:b4b117cbbcf3 | |
|
145 | (run 'hg update' to get a working copy) | |
|
146 | $ hg -R client-no-reuse verify | |
|
147 | checking changesets | |
|
148 | checking manifests | |
|
149 | crosschecking files in changesets and manifests | |
|
150 | checking files | |
|
151 | checking dirstate | |
|
152 | checked 37 changesets with 37 changes to 37 files | |
|
153 | ||
|
154 | ||
|
155 | pull with "try-base" policy | |
|
156 | --------------------------- | |
|
157 | ||
|
158 | $ cp -R client client-try-base | |
|
159 | $ hg -R client-try-base pull --config paths.default:pulled-delta-reuse-policy=try-base | |
|
160 | pulling from $TESTTMP/server | |
|
161 | requesting all changes | |
|
162 | adding changesets | |
|
163 | adding manifests | |
|
164 | adding file changes | |
|
165 | added 37 changesets with 37 changes to 37 files | |
|
166 | new changesets 61246295ee1e:b4b117cbbcf3 | |
|
167 | (run 'hg update' to get a working copy) | |
|
168 | $ hg -R client-try-base verify | |
|
169 | checking changesets | |
|
170 | checking manifests | |
|
171 | crosschecking files in changesets and manifests | |
|
172 | checking files | |
|
173 | checking dirstate | |
|
174 | checked 37 changesets with 37 changes to 37 files | |
|
175 | ||
|
176 | ||
|
177 | pull with "forced" policy | |
|
178 | ------------------------- | |
|
179 | ||
|
180 | $ cp -R client client-forced | |
|
181 | $ hg -R client-forced pull --config paths.default:pulled-delta-reuse-policy=forced | |
|
182 | pulling from $TESTTMP/server | |
|
183 | requesting all changes | |
|
184 | adding changesets | |
|
185 | adding manifests | |
|
186 | adding file changes | |
|
187 | added 37 changesets with 37 changes to 37 files | |
|
188 | new changesets 61246295ee1e:b4b117cbbcf3 | |
|
189 | (run 'hg update' to get a working copy) | |
|
190 | $ hg -R client-forced verify | |
|
191 | checking changesets | |
|
192 | checking manifests | |
|
193 | crosschecking files in changesets and manifests | |
|
194 | checking files | |
|
195 | checking dirstate | |
|
196 | checked 37 changesets with 37 changes to 37 files |
@@ -687,6 +687,12 b' def _candidategroups(' | |||
|
687 | 687 | if target_rev is None: |
|
688 | 688 | target_rev = len(revlog) |
|
689 | 689 | |
|
690 | if not revlog._generaldelta: | |
|
691 | # before general delta, there is only one possible delta base | |
|
692 | yield (target_rev - 1,) | |
|
693 | yield None | |
|
694 | return | |
|
695 | ||
|
690 | 696 | if ( |
|
691 | 697 | cachedelta is not None |
|
692 | 698 | and nullrev == cachedelta[0] |
General Comments 0
You need to be logged in to leave comments.
Login now