Show More
@@ -1,814 +1,820 b'' | |||||
|
1 | $ echo "[format]" >> $HGRCPATH | |||
|
2 | $ echo "usegeneraldelta=yes" >> $HGRCPATH | |||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
3 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "strip=" >> $HGRCPATH |
|
4 | $ echo "strip=" >> $HGRCPATH | |
3 |
|
5 | |||
4 | $ restore() { |
|
6 | $ restore() { | |
5 | > hg unbundle -q .hg/strip-backup/* |
|
7 | > hg unbundle -q .hg/strip-backup/* | |
6 | > rm .hg/strip-backup/* |
|
8 | > rm .hg/strip-backup/* | |
7 | > } |
|
9 | > } | |
8 | $ teststrip() { |
|
10 | $ teststrip() { | |
9 | > hg up -C $1 |
|
11 | > hg up -C $1 | |
10 | > echo % before update $1, strip $2 |
|
12 | > echo % before update $1, strip $2 | |
11 | > hg parents |
|
13 | > hg parents | |
12 | > hg --traceback strip $2 |
|
14 | > hg --traceback strip $2 | |
13 | > echo % after update $1, strip $2 |
|
15 | > echo % after update $1, strip $2 | |
14 | > hg parents |
|
16 | > hg parents | |
15 | > restore |
|
17 | > restore | |
16 | > } |
|
18 | > } | |
17 |
|
19 | |||
18 | $ hg init test |
|
20 | $ hg init test | |
19 | $ cd test |
|
21 | $ cd test | |
20 |
|
22 | |||
21 | $ echo foo > bar |
|
23 | $ echo foo > bar | |
22 | $ hg ci -Ama |
|
24 | $ hg ci -Ama | |
23 | adding bar |
|
25 | adding bar | |
24 |
|
26 | |||
25 | $ echo more >> bar |
|
27 | $ echo more >> bar | |
26 | $ hg ci -Amb |
|
28 | $ hg ci -Amb | |
27 |
|
29 | |||
28 | $ echo blah >> bar |
|
30 | $ echo blah >> bar | |
29 | $ hg ci -Amc |
|
31 | $ hg ci -Amc | |
30 |
|
32 | |||
31 | $ hg up 1 |
|
33 | $ hg up 1 | |
32 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
33 | $ echo blah >> bar |
|
35 | $ echo blah >> bar | |
34 | $ hg ci -Amd |
|
36 | $ hg ci -Amd | |
35 | created new head |
|
37 | created new head | |
36 |
|
38 | |||
37 | $ echo final >> bar |
|
39 | $ echo final >> bar | |
38 | $ hg ci -Ame |
|
40 | $ hg ci -Ame | |
39 |
|
41 | |||
40 | $ hg log |
|
42 | $ hg log | |
41 | changeset: 4:443431ffac4f |
|
43 | changeset: 4:443431ffac4f | |
42 | tag: tip |
|
44 | tag: tip | |
43 | user: test |
|
45 | user: test | |
44 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
46 | date: Thu Jan 01 00:00:00 1970 +0000 | |
45 | summary: e |
|
47 | summary: e | |
46 |
|
48 | |||
47 | changeset: 3:65bd5f99a4a3 |
|
49 | changeset: 3:65bd5f99a4a3 | |
48 | parent: 1:ef3a871183d7 |
|
50 | parent: 1:ef3a871183d7 | |
49 | user: test |
|
51 | user: test | |
50 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
52 | date: Thu Jan 01 00:00:00 1970 +0000 | |
51 | summary: d |
|
53 | summary: d | |
52 |
|
54 | |||
53 | changeset: 2:264128213d29 |
|
55 | changeset: 2:264128213d29 | |
54 | user: test |
|
56 | user: test | |
55 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
57 | date: Thu Jan 01 00:00:00 1970 +0000 | |
56 | summary: c |
|
58 | summary: c | |
57 |
|
59 | |||
58 | changeset: 1:ef3a871183d7 |
|
60 | changeset: 1:ef3a871183d7 | |
59 | user: test |
|
61 | user: test | |
60 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | date: Thu Jan 01 00:00:00 1970 +0000 | |
61 | summary: b |
|
63 | summary: b | |
62 |
|
64 | |||
63 | changeset: 0:9ab35a2d17cb |
|
65 | changeset: 0:9ab35a2d17cb | |
64 | user: test |
|
66 | user: test | |
65 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | date: Thu Jan 01 00:00:00 1970 +0000 | |
66 | summary: a |
|
68 | summary: a | |
67 |
|
69 | |||
68 |
|
70 | |||
69 | $ teststrip 4 4 |
|
71 | $ teststrip 4 4 | |
70 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
71 | % before update 4, strip 4 |
|
73 | % before update 4, strip 4 | |
72 | changeset: 4:443431ffac4f |
|
74 | changeset: 4:443431ffac4f | |
73 | tag: tip |
|
75 | tag: tip | |
74 | user: test |
|
76 | user: test | |
75 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
77 | date: Thu Jan 01 00:00:00 1970 +0000 | |
76 | summary: e |
|
78 | summary: e | |
77 |
|
79 | |||
78 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
79 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
81 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
80 | % after update 4, strip 4 |
|
82 | % after update 4, strip 4 | |
81 | changeset: 3:65bd5f99a4a3 |
|
83 | changeset: 3:65bd5f99a4a3 | |
82 | tag: tip |
|
84 | tag: tip | |
83 | parent: 1:ef3a871183d7 |
|
85 | parent: 1:ef3a871183d7 | |
84 | user: test |
|
86 | user: test | |
85 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
87 | date: Thu Jan 01 00:00:00 1970 +0000 | |
86 | summary: d |
|
88 | summary: d | |
87 |
|
89 | |||
88 | $ teststrip 4 3 |
|
90 | $ teststrip 4 3 | |
89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
90 | % before update 4, strip 3 |
|
92 | % before update 4, strip 3 | |
91 | changeset: 4:443431ffac4f |
|
93 | changeset: 4:443431ffac4f | |
92 | tag: tip |
|
94 | tag: tip | |
93 | user: test |
|
95 | user: test | |
94 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
96 | date: Thu Jan 01 00:00:00 1970 +0000 | |
95 | summary: e |
|
97 | summary: e | |
96 |
|
98 | |||
97 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
98 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
100 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
99 | % after update 4, strip 3 |
|
101 | % after update 4, strip 3 | |
100 | changeset: 1:ef3a871183d7 |
|
102 | changeset: 1:ef3a871183d7 | |
101 | user: test |
|
103 | user: test | |
102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
104 | date: Thu Jan 01 00:00:00 1970 +0000 | |
103 | summary: b |
|
105 | summary: b | |
104 |
|
106 | |||
105 | $ teststrip 1 4 |
|
107 | $ teststrip 1 4 | |
106 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 | % before update 1, strip 4 |
|
109 | % before update 1, strip 4 | |
108 | changeset: 1:ef3a871183d7 |
|
110 | changeset: 1:ef3a871183d7 | |
109 | user: test |
|
111 | user: test | |
110 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
112 | date: Thu Jan 01 00:00:00 1970 +0000 | |
111 | summary: b |
|
113 | summary: b | |
112 |
|
114 | |||
113 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
115 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
114 | % after update 1, strip 4 |
|
116 | % after update 1, strip 4 | |
115 | changeset: 1:ef3a871183d7 |
|
117 | changeset: 1:ef3a871183d7 | |
116 | user: test |
|
118 | user: test | |
117 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
119 | date: Thu Jan 01 00:00:00 1970 +0000 | |
118 | summary: b |
|
120 | summary: b | |
119 |
|
121 | |||
120 | $ teststrip 4 2 |
|
122 | $ teststrip 4 2 | |
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | % before update 4, strip 2 |
|
124 | % before update 4, strip 2 | |
123 | changeset: 4:443431ffac4f |
|
125 | changeset: 4:443431ffac4f | |
124 | tag: tip |
|
126 | tag: tip | |
125 | user: test |
|
127 | user: test | |
126 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
128 | date: Thu Jan 01 00:00:00 1970 +0000 | |
127 | summary: e |
|
129 | summary: e | |
128 |
|
130 | |||
129 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
131 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
130 | % after update 4, strip 2 |
|
132 | % after update 4, strip 2 | |
131 | changeset: 3:443431ffac4f |
|
133 | changeset: 3:443431ffac4f | |
132 | tag: tip |
|
134 | tag: tip | |
133 | user: test |
|
135 | user: test | |
134 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
136 | date: Thu Jan 01 00:00:00 1970 +0000 | |
135 | summary: e |
|
137 | summary: e | |
136 |
|
138 | |||
137 | $ teststrip 4 1 |
|
139 | $ teststrip 4 1 | |
138 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
139 | % before update 4, strip 1 |
|
141 | % before update 4, strip 1 | |
140 | changeset: 4:264128213d29 |
|
142 | changeset: 4:264128213d29 | |
141 | tag: tip |
|
143 | tag: tip | |
142 | parent: 1:ef3a871183d7 |
|
144 | parent: 1:ef3a871183d7 | |
143 | user: test |
|
145 | user: test | |
144 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
146 | date: Thu Jan 01 00:00:00 1970 +0000 | |
145 | summary: c |
|
147 | summary: c | |
146 |
|
148 | |||
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
149 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
148 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
150 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
149 | % after update 4, strip 1 |
|
151 | % after update 4, strip 1 | |
150 | changeset: 0:9ab35a2d17cb |
|
152 | changeset: 0:9ab35a2d17cb | |
151 | tag: tip |
|
153 | tag: tip | |
152 | user: test |
|
154 | user: test | |
153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
155 | date: Thu Jan 01 00:00:00 1970 +0000 | |
154 | summary: a |
|
156 | summary: a | |
155 |
|
157 | |||
156 | $ teststrip null 4 |
|
158 | $ teststrip null 4 | |
157 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
159 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
158 | % before update null, strip 4 |
|
160 | % before update null, strip 4 | |
159 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
161 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
160 | % after update null, strip 4 |
|
162 | % after update null, strip 4 | |
161 |
|
163 | |||
162 | $ hg log |
|
164 | $ hg log | |
163 | changeset: 4:264128213d29 |
|
165 | changeset: 4:264128213d29 | |
164 | tag: tip |
|
166 | tag: tip | |
165 | parent: 1:ef3a871183d7 |
|
167 | parent: 1:ef3a871183d7 | |
166 | user: test |
|
168 | user: test | |
167 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
169 | date: Thu Jan 01 00:00:00 1970 +0000 | |
168 | summary: c |
|
170 | summary: c | |
169 |
|
171 | |||
170 | changeset: 3:443431ffac4f |
|
172 | changeset: 3:443431ffac4f | |
171 | user: test |
|
173 | user: test | |
172 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
174 | date: Thu Jan 01 00:00:00 1970 +0000 | |
173 | summary: e |
|
175 | summary: e | |
174 |
|
176 | |||
175 | changeset: 2:65bd5f99a4a3 |
|
177 | changeset: 2:65bd5f99a4a3 | |
176 | user: test |
|
178 | user: test | |
177 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
179 | date: Thu Jan 01 00:00:00 1970 +0000 | |
178 | summary: d |
|
180 | summary: d | |
179 |
|
181 | |||
180 | changeset: 1:ef3a871183d7 |
|
182 | changeset: 1:ef3a871183d7 | |
181 | user: test |
|
183 | user: test | |
182 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
184 | date: Thu Jan 01 00:00:00 1970 +0000 | |
183 | summary: b |
|
185 | summary: b | |
184 |
|
186 | |||
185 | changeset: 0:9ab35a2d17cb |
|
187 | changeset: 0:9ab35a2d17cb | |
186 | user: test |
|
188 | user: test | |
187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
189 | date: Thu Jan 01 00:00:00 1970 +0000 | |
188 | summary: a |
|
190 | summary: a | |
189 |
|
191 | |||
190 | $ hg up -C 4 |
|
192 | $ hg up -C 4 | |
191 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
193 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
192 | $ hg parents |
|
194 | $ hg parents | |
193 | changeset: 4:264128213d29 |
|
195 | changeset: 4:264128213d29 | |
194 | tag: tip |
|
196 | tag: tip | |
195 | parent: 1:ef3a871183d7 |
|
197 | parent: 1:ef3a871183d7 | |
196 | user: test |
|
198 | user: test | |
197 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
199 | date: Thu Jan 01 00:00:00 1970 +0000 | |
198 | summary: c |
|
200 | summary: c | |
199 |
|
201 | |||
200 |
|
202 | |||
201 | $ hg --traceback strip 4 |
|
203 | $ hg --traceback strip 4 | |
202 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
204 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
203 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob) |
|
205 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob) | |
204 | $ hg parents |
|
206 | $ hg parents | |
205 | changeset: 1:ef3a871183d7 |
|
207 | changeset: 1:ef3a871183d7 | |
206 | user: test |
|
208 | user: test | |
207 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
209 | date: Thu Jan 01 00:00:00 1970 +0000 | |
208 | summary: b |
|
210 | summary: b | |
209 |
|
211 | |||
210 | $ hg debugbundle .hg/strip-backup/* |
|
212 | $ hg debugbundle .hg/strip-backup/* | |
|
213 | Stream params: {'Compression': 'BZ'} | |||
|
214 | changegroup -- "{'version': '02'}" | |||
211 | 264128213d290d868c54642d13aeaa3675551a78 |
|
215 | 264128213d290d868c54642d13aeaa3675551a78 | |
212 | $ hg pull .hg/strip-backup/* |
|
216 | $ hg pull .hg/strip-backup/* | |
213 | pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg |
|
217 | pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg | |
214 | searching for changes |
|
218 | searching for changes | |
215 | adding changesets |
|
219 | adding changesets | |
216 | adding manifests |
|
220 | adding manifests | |
217 | adding file changes |
|
221 | adding file changes | |
218 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
222 | added 1 changesets with 0 changes to 0 files (+1 heads) | |
219 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
223 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
220 | $ rm .hg/strip-backup/* |
|
224 | $ rm .hg/strip-backup/* | |
221 | $ hg log --graph |
|
225 | $ hg log --graph | |
222 | o changeset: 4:264128213d29 |
|
226 | o changeset: 4:264128213d29 | |
223 | | tag: tip |
|
227 | | tag: tip | |
224 | | parent: 1:ef3a871183d7 |
|
228 | | parent: 1:ef3a871183d7 | |
225 | | user: test |
|
229 | | user: test | |
226 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
230 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
227 | | summary: c |
|
231 | | summary: c | |
228 | | |
|
232 | | | |
229 | | o changeset: 3:443431ffac4f |
|
233 | | o changeset: 3:443431ffac4f | |
230 | | | user: test |
|
234 | | | user: test | |
231 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
235 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
232 | | | summary: e |
|
236 | | | summary: e | |
233 | | | |
|
237 | | | | |
234 | | o changeset: 2:65bd5f99a4a3 |
|
238 | | o changeset: 2:65bd5f99a4a3 | |
235 | |/ user: test |
|
239 | |/ user: test | |
236 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
240 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
237 | | summary: d |
|
241 | | summary: d | |
238 | | |
|
242 | | | |
239 | @ changeset: 1:ef3a871183d7 |
|
243 | @ changeset: 1:ef3a871183d7 | |
240 | | user: test |
|
244 | | user: test | |
241 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
245 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
242 | | summary: b |
|
246 | | summary: b | |
243 | | |
|
247 | | | |
244 | o changeset: 0:9ab35a2d17cb |
|
248 | o changeset: 0:9ab35a2d17cb | |
245 | user: test |
|
249 | user: test | |
246 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
250 | date: Thu Jan 01 00:00:00 1970 +0000 | |
247 | summary: a |
|
251 | summary: a | |
248 |
|
252 | |||
249 | $ hg up -C 2 |
|
253 | $ hg up -C 2 | |
250 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
254 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
251 | $ hg merge 4 |
|
255 | $ hg merge 4 | |
252 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
256 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
253 | (branch merge, don't forget to commit) |
|
257 | (branch merge, don't forget to commit) | |
254 |
|
258 | |||
255 | before strip of merge parent |
|
259 | before strip of merge parent | |
256 |
|
260 | |||
257 | $ hg parents |
|
261 | $ hg parents | |
258 | changeset: 2:65bd5f99a4a3 |
|
262 | changeset: 2:65bd5f99a4a3 | |
259 | user: test |
|
263 | user: test | |
260 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
264 | date: Thu Jan 01 00:00:00 1970 +0000 | |
261 | summary: d |
|
265 | summary: d | |
262 |
|
266 | |||
263 | changeset: 4:264128213d29 |
|
267 | changeset: 4:264128213d29 | |
264 | tag: tip |
|
268 | tag: tip | |
265 | parent: 1:ef3a871183d7 |
|
269 | parent: 1:ef3a871183d7 | |
266 | user: test |
|
270 | user: test | |
267 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
271 | date: Thu Jan 01 00:00:00 1970 +0000 | |
268 | summary: c |
|
272 | summary: c | |
269 |
|
273 | |||
270 | $ hg strip 4 |
|
274 | $ hg strip 4 | |
271 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
275 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
272 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
276 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
273 |
|
277 | |||
274 | after strip of merge parent |
|
278 | after strip of merge parent | |
275 |
|
279 | |||
276 | $ hg parents |
|
280 | $ hg parents | |
277 | changeset: 1:ef3a871183d7 |
|
281 | changeset: 1:ef3a871183d7 | |
278 | user: test |
|
282 | user: test | |
279 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
283 | date: Thu Jan 01 00:00:00 1970 +0000 | |
280 | summary: b |
|
284 | summary: b | |
281 |
|
285 | |||
282 | $ restore |
|
286 | $ restore | |
283 |
|
287 | |||
284 | $ hg up |
|
288 | $ hg up | |
285 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
289 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
286 | $ hg log -G |
|
290 | $ hg log -G | |
287 | @ changeset: 4:264128213d29 |
|
291 | @ changeset: 4:264128213d29 | |
288 | | tag: tip |
|
292 | | tag: tip | |
289 | | parent: 1:ef3a871183d7 |
|
293 | | parent: 1:ef3a871183d7 | |
290 | | user: test |
|
294 | | user: test | |
291 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
295 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
292 | | summary: c |
|
296 | | summary: c | |
293 | | |
|
297 | | | |
294 | | o changeset: 3:443431ffac4f |
|
298 | | o changeset: 3:443431ffac4f | |
295 | | | user: test |
|
299 | | | user: test | |
296 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
300 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
297 | | | summary: e |
|
301 | | | summary: e | |
298 | | | |
|
302 | | | | |
299 | | o changeset: 2:65bd5f99a4a3 |
|
303 | | o changeset: 2:65bd5f99a4a3 | |
300 | |/ user: test |
|
304 | |/ user: test | |
301 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
305 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
302 | | summary: d |
|
306 | | summary: d | |
303 | | |
|
307 | | | |
304 | o changeset: 1:ef3a871183d7 |
|
308 | o changeset: 1:ef3a871183d7 | |
305 | | user: test |
|
309 | | user: test | |
306 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
310 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
307 | | summary: b |
|
311 | | summary: b | |
308 | | |
|
312 | | | |
309 | o changeset: 0:9ab35a2d17cb |
|
313 | o changeset: 0:9ab35a2d17cb | |
310 | user: test |
|
314 | user: test | |
311 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
315 | date: Thu Jan 01 00:00:00 1970 +0000 | |
312 | summary: a |
|
316 | summary: a | |
313 |
|
317 | |||
314 |
|
318 | |||
315 | 2 is parent of 3, only one strip should happen |
|
319 | 2 is parent of 3, only one strip should happen | |
316 |
|
320 | |||
317 | $ hg strip "roots(2)" 3 |
|
321 | $ hg strip "roots(2)" 3 | |
318 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
322 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
319 | $ hg log -G |
|
323 | $ hg log -G | |
320 | @ changeset: 2:264128213d29 |
|
324 | @ changeset: 2:264128213d29 | |
321 | | tag: tip |
|
325 | | tag: tip | |
322 | | user: test |
|
326 | | user: test | |
323 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
327 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
324 | | summary: c |
|
328 | | summary: c | |
325 | | |
|
329 | | | |
326 | o changeset: 1:ef3a871183d7 |
|
330 | o changeset: 1:ef3a871183d7 | |
327 | | user: test |
|
331 | | user: test | |
328 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
332 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
329 | | summary: b |
|
333 | | summary: b | |
330 | | |
|
334 | | | |
331 | o changeset: 0:9ab35a2d17cb |
|
335 | o changeset: 0:9ab35a2d17cb | |
332 | user: test |
|
336 | user: test | |
333 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
337 | date: Thu Jan 01 00:00:00 1970 +0000 | |
334 | summary: a |
|
338 | summary: a | |
335 |
|
339 | |||
336 | $ restore |
|
340 | $ restore | |
337 | $ hg log -G |
|
341 | $ hg log -G | |
338 | o changeset: 4:443431ffac4f |
|
342 | o changeset: 4:443431ffac4f | |
339 | | tag: tip |
|
343 | | tag: tip | |
340 | | user: test |
|
344 | | user: test | |
341 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
345 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
342 | | summary: e |
|
346 | | summary: e | |
343 | | |
|
347 | | | |
344 | o changeset: 3:65bd5f99a4a3 |
|
348 | o changeset: 3:65bd5f99a4a3 | |
345 | | parent: 1:ef3a871183d7 |
|
349 | | parent: 1:ef3a871183d7 | |
346 | | user: test |
|
350 | | user: test | |
347 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
351 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
348 | | summary: d |
|
352 | | summary: d | |
349 | | |
|
353 | | | |
350 | | @ changeset: 2:264128213d29 |
|
354 | | @ changeset: 2:264128213d29 | |
351 | |/ user: test |
|
355 | |/ user: test | |
352 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
356 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
353 | | summary: c |
|
357 | | summary: c | |
354 | | |
|
358 | | | |
355 | o changeset: 1:ef3a871183d7 |
|
359 | o changeset: 1:ef3a871183d7 | |
356 | | user: test |
|
360 | | user: test | |
357 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
361 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
358 | | summary: b |
|
362 | | summary: b | |
359 | | |
|
363 | | | |
360 | o changeset: 0:9ab35a2d17cb |
|
364 | o changeset: 0:9ab35a2d17cb | |
361 | user: test |
|
365 | user: test | |
362 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
366 | date: Thu Jan 01 00:00:00 1970 +0000 | |
363 | summary: a |
|
367 | summary: a | |
364 |
|
368 | |||
365 |
|
369 | |||
366 | 2 different branches: 2 strips |
|
370 | 2 different branches: 2 strips | |
367 |
|
371 | |||
368 | $ hg strip 2 4 |
|
372 | $ hg strip 2 4 | |
369 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
373 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
370 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
374 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
371 | $ hg log -G |
|
375 | $ hg log -G | |
372 | o changeset: 2:65bd5f99a4a3 |
|
376 | o changeset: 2:65bd5f99a4a3 | |
373 | | tag: tip |
|
377 | | tag: tip | |
374 | | user: test |
|
378 | | user: test | |
375 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
379 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
376 | | summary: d |
|
380 | | summary: d | |
377 | | |
|
381 | | | |
378 | @ changeset: 1:ef3a871183d7 |
|
382 | @ changeset: 1:ef3a871183d7 | |
379 | | user: test |
|
383 | | user: test | |
380 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
384 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
381 | | summary: b |
|
385 | | summary: b | |
382 | | |
|
386 | | | |
383 | o changeset: 0:9ab35a2d17cb |
|
387 | o changeset: 0:9ab35a2d17cb | |
384 | user: test |
|
388 | user: test | |
385 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
389 | date: Thu Jan 01 00:00:00 1970 +0000 | |
386 | summary: a |
|
390 | summary: a | |
387 |
|
391 | |||
388 | $ restore |
|
392 | $ restore | |
389 |
|
393 | |||
390 | 2 different branches and a common ancestor: 1 strip |
|
394 | 2 different branches and a common ancestor: 1 strip | |
391 |
|
395 | |||
392 | $ hg strip 1 "2|4" |
|
396 | $ hg strip 1 "2|4" | |
393 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
397 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
394 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
398 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
395 | $ restore |
|
399 | $ restore | |
396 |
|
400 | |||
397 | verify fncache is kept up-to-date |
|
401 | verify fncache is kept up-to-date | |
398 |
|
402 | |||
399 | $ touch a |
|
403 | $ touch a | |
400 | $ hg ci -qAm a |
|
404 | $ hg ci -qAm a | |
401 | $ cat .hg/store/fncache | sort |
|
405 | $ cat .hg/store/fncache | sort | |
402 | data/a.i |
|
406 | data/a.i | |
403 | data/bar.i |
|
407 | data/bar.i | |
404 | $ hg strip tip |
|
408 | $ hg strip tip | |
405 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
409 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
406 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
410 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
407 | $ cat .hg/store/fncache |
|
411 | $ cat .hg/store/fncache | |
408 | data/bar.i |
|
412 | data/bar.i | |
409 |
|
413 | |||
410 | stripping an empty revset |
|
414 | stripping an empty revset | |
411 |
|
415 | |||
412 | $ hg strip "1 and not 1" |
|
416 | $ hg strip "1 and not 1" | |
413 | abort: empty revision set |
|
417 | abort: empty revision set | |
414 | [255] |
|
418 | [255] | |
415 |
|
419 | |||
416 | remove branchy history for qimport tests |
|
420 | remove branchy history for qimport tests | |
417 |
|
421 | |||
418 | $ hg strip 3 |
|
422 | $ hg strip 3 | |
419 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
423 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
420 |
|
424 | |||
421 |
|
425 | |||
422 | strip of applied mq should cleanup status file |
|
426 | strip of applied mq should cleanup status file | |
423 |
|
427 | |||
424 | $ echo "mq=" >> $HGRCPATH |
|
428 | $ echo "mq=" >> $HGRCPATH | |
425 | $ hg up -C 3 |
|
429 | $ hg up -C 3 | |
426 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
430 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
427 | $ echo fooagain >> bar |
|
431 | $ echo fooagain >> bar | |
428 | $ hg ci -mf |
|
432 | $ hg ci -mf | |
429 | $ hg qimport -r tip:2 |
|
433 | $ hg qimport -r tip:2 | |
430 |
|
434 | |||
431 | applied patches before strip |
|
435 | applied patches before strip | |
432 |
|
436 | |||
433 | $ hg qapplied |
|
437 | $ hg qapplied | |
434 | d |
|
438 | d | |
435 | e |
|
439 | e | |
436 | f |
|
440 | f | |
437 |
|
441 | |||
438 | stripping revision in queue |
|
442 | stripping revision in queue | |
439 |
|
443 | |||
440 | $ hg strip 3 |
|
444 | $ hg strip 3 | |
441 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
445 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
442 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
446 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
443 |
|
447 | |||
444 | applied patches after stripping rev in queue |
|
448 | applied patches after stripping rev in queue | |
445 |
|
449 | |||
446 | $ hg qapplied |
|
450 | $ hg qapplied | |
447 | d |
|
451 | d | |
448 |
|
452 | |||
449 | stripping ancestor of queue |
|
453 | stripping ancestor of queue | |
450 |
|
454 | |||
451 | $ hg strip 1 |
|
455 | $ hg strip 1 | |
452 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
456 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
453 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
457 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
454 |
|
458 | |||
455 | applied patches after stripping ancestor of queue |
|
459 | applied patches after stripping ancestor of queue | |
456 |
|
460 | |||
457 | $ hg qapplied |
|
461 | $ hg qapplied | |
458 |
|
462 | |||
459 | Verify strip protects against stripping wc parent when there are uncommitted mods |
|
463 | Verify strip protects against stripping wc parent when there are uncommitted mods | |
460 |
|
464 | |||
461 | $ echo b > b |
|
465 | $ echo b > b | |
462 | $ echo bb > bar |
|
466 | $ echo bb > bar | |
463 | $ hg add b |
|
467 | $ hg add b | |
464 | $ hg ci -m 'b' |
|
468 | $ hg ci -m 'b' | |
465 | $ hg log --graph |
|
469 | $ hg log --graph | |
466 | @ changeset: 1:76dcf9fab855 |
|
470 | @ changeset: 1:76dcf9fab855 | |
467 | | tag: tip |
|
471 | | tag: tip | |
468 | | user: test |
|
472 | | user: test | |
469 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
473 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
470 | | summary: b |
|
474 | | summary: b | |
471 | | |
|
475 | | | |
472 | o changeset: 0:9ab35a2d17cb |
|
476 | o changeset: 0:9ab35a2d17cb | |
473 | user: test |
|
477 | user: test | |
474 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
478 | date: Thu Jan 01 00:00:00 1970 +0000 | |
475 | summary: a |
|
479 | summary: a | |
476 |
|
480 | |||
477 | $ hg up 0 |
|
481 | $ hg up 0 | |
478 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
482 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
479 | $ echo c > bar |
|
483 | $ echo c > bar | |
480 | $ hg up -t false |
|
484 | $ hg up -t false | |
481 | merging bar |
|
485 | merging bar | |
482 | merging bar failed! |
|
486 | merging bar failed! | |
483 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
487 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
484 | use 'hg resolve' to retry unresolved file merges |
|
488 | use 'hg resolve' to retry unresolved file merges | |
485 | [1] |
|
489 | [1] | |
486 | $ hg sum |
|
490 | $ hg sum | |
487 | parent: 1:76dcf9fab855 tip |
|
491 | parent: 1:76dcf9fab855 tip | |
488 | b |
|
492 | b | |
489 | branch: default |
|
493 | branch: default | |
490 | commit: 1 modified, 1 unknown, 1 unresolved |
|
494 | commit: 1 modified, 1 unknown, 1 unresolved | |
491 | update: (current) |
|
495 | update: (current) | |
492 | phases: 2 draft |
|
496 | phases: 2 draft | |
493 | mq: 3 unapplied |
|
497 | mq: 3 unapplied | |
494 |
|
498 | |||
495 | $ echo c > b |
|
499 | $ echo c > b | |
496 | $ hg strip tip |
|
500 | $ hg strip tip | |
497 | abort: local changes found |
|
501 | abort: local changes found | |
498 | [255] |
|
502 | [255] | |
499 | $ hg strip tip --keep |
|
503 | $ hg strip tip --keep | |
500 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
504 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
501 | $ hg log --graph |
|
505 | $ hg log --graph | |
502 | @ changeset: 0:9ab35a2d17cb |
|
506 | @ changeset: 0:9ab35a2d17cb | |
503 | tag: tip |
|
507 | tag: tip | |
504 | user: test |
|
508 | user: test | |
505 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
509 | date: Thu Jan 01 00:00:00 1970 +0000 | |
506 | summary: a |
|
510 | summary: a | |
507 |
|
511 | |||
508 | $ hg status |
|
512 | $ hg status | |
509 | M bar |
|
513 | M bar | |
510 | ? b |
|
514 | ? b | |
511 | ? bar.orig |
|
515 | ? bar.orig | |
512 |
|
516 | |||
513 | $ rm bar.orig |
|
517 | $ rm bar.orig | |
514 | $ hg sum |
|
518 | $ hg sum | |
515 | parent: 0:9ab35a2d17cb tip |
|
519 | parent: 0:9ab35a2d17cb tip | |
516 | a |
|
520 | a | |
517 | branch: default |
|
521 | branch: default | |
518 | commit: 1 modified, 1 unknown |
|
522 | commit: 1 modified, 1 unknown | |
519 | update: (current) |
|
523 | update: (current) | |
520 | phases: 1 draft |
|
524 | phases: 1 draft | |
521 | mq: 3 unapplied |
|
525 | mq: 3 unapplied | |
522 |
|
526 | |||
523 | Strip adds, removes, modifies with --keep |
|
527 | Strip adds, removes, modifies with --keep | |
524 |
|
528 | |||
525 | $ touch b |
|
529 | $ touch b | |
526 | $ hg add b |
|
530 | $ hg add b | |
527 | $ hg commit -mb |
|
531 | $ hg commit -mb | |
528 | $ touch c |
|
532 | $ touch c | |
529 |
|
533 | |||
530 | ... with a clean working dir |
|
534 | ... with a clean working dir | |
531 |
|
535 | |||
532 | $ hg add c |
|
536 | $ hg add c | |
533 | $ hg rm bar |
|
537 | $ hg rm bar | |
534 | $ hg commit -mc |
|
538 | $ hg commit -mc | |
535 | $ hg status |
|
539 | $ hg status | |
536 | $ hg strip --keep tip |
|
540 | $ hg strip --keep tip | |
537 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
541 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
538 | $ hg status |
|
542 | $ hg status | |
539 | ! bar |
|
543 | ! bar | |
540 | ? c |
|
544 | ? c | |
541 |
|
545 | |||
542 | ... with a dirty working dir |
|
546 | ... with a dirty working dir | |
543 |
|
547 | |||
544 | $ hg add c |
|
548 | $ hg add c | |
545 | $ hg rm bar |
|
549 | $ hg rm bar | |
546 | $ hg commit -mc |
|
550 | $ hg commit -mc | |
547 | $ hg status |
|
551 | $ hg status | |
548 | $ echo b > b |
|
552 | $ echo b > b | |
549 | $ echo d > d |
|
553 | $ echo d > d | |
550 | $ hg strip --keep tip |
|
554 | $ hg strip --keep tip | |
551 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/57e364c8a475-4cfed93c-backup.hg (glob) |
|
555 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/57e364c8a475-4cfed93c-backup.hg (glob) | |
552 | $ hg status |
|
556 | $ hg status | |
553 | M b |
|
557 | M b | |
554 | ! bar |
|
558 | ! bar | |
555 | ? c |
|
559 | ? c | |
556 | ? d |
|
560 | ? d | |
557 | $ cd .. |
|
561 | $ cd .. | |
558 |
|
562 | |||
559 | stripping many nodes on a complex graph (issue3299) |
|
563 | stripping many nodes on a complex graph (issue3299) | |
560 |
|
564 | |||
561 | $ hg init issue3299 |
|
565 | $ hg init issue3299 | |
562 | $ cd issue3299 |
|
566 | $ cd issue3299 | |
563 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' |
|
567 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' | |
564 | $ hg strip 'not ancestors(x)' |
|
568 | $ hg strip 'not ancestors(x)' | |
565 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) |
|
569 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) | |
566 |
|
570 | |||
567 | test hg strip -B bookmark |
|
571 | test hg strip -B bookmark | |
568 |
|
572 | |||
569 | $ cd .. |
|
573 | $ cd .. | |
570 | $ hg init bookmarks |
|
574 | $ hg init bookmarks | |
571 | $ cd bookmarks |
|
575 | $ cd bookmarks | |
572 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b' |
|
576 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b' | |
573 | $ hg bookmark -r 'a' 'todelete' |
|
577 | $ hg bookmark -r 'a' 'todelete' | |
574 | $ hg bookmark -r 'b' 'B' |
|
578 | $ hg bookmark -r 'b' 'B' | |
575 | $ hg bookmark -r 'b' 'nostrip' |
|
579 | $ hg bookmark -r 'b' 'nostrip' | |
576 | $ hg bookmark -r 'c' 'delete' |
|
580 | $ hg bookmark -r 'c' 'delete' | |
577 | $ hg up -C todelete |
|
581 | $ hg up -C todelete | |
578 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
582 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
579 | (activating bookmark todelete) |
|
583 | (activating bookmark todelete) | |
580 | $ hg strip -B nostrip |
|
584 | $ hg strip -B nostrip | |
581 | bookmark 'nostrip' deleted |
|
585 | bookmark 'nostrip' deleted | |
582 | abort: empty revision set |
|
586 | abort: empty revision set | |
583 | [255] |
|
587 | [255] | |
584 | $ hg strip -B todelete |
|
588 | $ hg strip -B todelete | |
585 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
589 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
586 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
590 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) | |
587 | bookmark 'todelete' deleted |
|
591 | bookmark 'todelete' deleted | |
588 | $ hg id -ir dcbb326fdec2 |
|
592 | $ hg id -ir dcbb326fdec2 | |
589 | abort: unknown revision 'dcbb326fdec2'! |
|
593 | abort: unknown revision 'dcbb326fdec2'! | |
590 | [255] |
|
594 | [255] | |
591 | $ hg id -ir d62d843c9a01 |
|
595 | $ hg id -ir d62d843c9a01 | |
592 | d62d843c9a01 |
|
596 | d62d843c9a01 | |
593 | $ hg bookmarks |
|
597 | $ hg bookmarks | |
594 | B 9:ff43616e5d0f |
|
598 | B 9:ff43616e5d0f | |
595 | delete 6:2702dd0c91e7 |
|
599 | delete 6:2702dd0c91e7 | |
596 | $ hg strip -B delete |
|
600 | $ hg strip -B delete | |
597 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
601 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) | |
598 | bookmark 'delete' deleted |
|
602 | bookmark 'delete' deleted | |
599 | $ hg id -ir 6:2702dd0c91e7 |
|
603 | $ hg id -ir 6:2702dd0c91e7 | |
600 | abort: unknown revision '2702dd0c91e7'! |
|
604 | abort: unknown revision '2702dd0c91e7'! | |
601 | [255] |
|
605 | [255] | |
602 | $ hg update B |
|
606 | $ hg update B | |
603 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
607 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
604 | (activating bookmark B) |
|
608 | (activating bookmark B) | |
605 | $ echo a > a |
|
609 | $ echo a > a | |
606 | $ hg add a |
|
610 | $ hg add a | |
607 | $ hg strip -B B |
|
611 | $ hg strip -B B | |
608 | abort: local changes found |
|
612 | abort: local changes found | |
609 | [255] |
|
613 | [255] | |
610 | $ hg bookmarks |
|
614 | $ hg bookmarks | |
611 | * B 6:ff43616e5d0f |
|
615 | * B 6:ff43616e5d0f | |
612 |
|
616 | |||
613 | Make sure no one adds back a -b option: |
|
617 | Make sure no one adds back a -b option: | |
614 |
|
618 | |||
615 | $ hg strip -b tip |
|
619 | $ hg strip -b tip | |
616 | hg strip: option -b not recognized |
|
620 | hg strip: option -b not recognized | |
617 | hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV... |
|
621 | hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV... | |
618 |
|
622 | |||
619 | strip changesets and all their descendants from the repository |
|
623 | strip changesets and all their descendants from the repository | |
620 |
|
624 | |||
621 | (use "hg help -e strip" to show help for the strip extension) |
|
625 | (use "hg help -e strip" to show help for the strip extension) | |
622 |
|
626 | |||
623 | options ([+] can be repeated): |
|
627 | options ([+] can be repeated): | |
624 |
|
628 | |||
625 | -r --rev REV [+] strip specified revision (optional, can specify revisions |
|
629 | -r --rev REV [+] strip specified revision (optional, can specify revisions | |
626 | without this option) |
|
630 | without this option) | |
627 | -f --force force removal of changesets, discard uncommitted changes |
|
631 | -f --force force removal of changesets, discard uncommitted changes | |
628 | (no backup) |
|
632 | (no backup) | |
629 | --no-backup no backups |
|
633 | --no-backup no backups | |
630 | -k --keep do not modify working directory during strip |
|
634 | -k --keep do not modify working directory during strip | |
631 | -B --bookmark VALUE remove revs only reachable from given bookmark |
|
635 | -B --bookmark VALUE remove revs only reachable from given bookmark | |
632 | --mq operate on patch repository |
|
636 | --mq operate on patch repository | |
633 |
|
637 | |||
634 | (use "hg strip -h" to show more help) |
|
638 | (use "hg strip -h" to show more help) | |
635 | [255] |
|
639 | [255] | |
636 |
|
640 | |||
637 | $ cd .. |
|
641 | $ cd .. | |
638 |
|
642 | |||
639 | Verify bundles don't get overwritten: |
|
643 | Verify bundles don't get overwritten: | |
640 |
|
644 | |||
641 | $ hg init doublebundle |
|
645 | $ hg init doublebundle | |
642 | $ cd doublebundle |
|
646 | $ cd doublebundle | |
643 | $ touch a |
|
647 | $ touch a | |
644 | $ hg commit -Aqm a |
|
648 | $ hg commit -Aqm a | |
645 | $ touch b |
|
649 | $ touch b | |
646 | $ hg commit -Aqm b |
|
650 | $ hg commit -Aqm b | |
647 | $ hg strip -r 0 |
|
651 | $ hg strip -r 0 | |
648 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
652 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
649 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob) |
|
653 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob) | |
650 | $ ls .hg/strip-backup |
|
654 | $ ls .hg/strip-backup | |
651 | 3903775176ed-e68910bd-backup.hg |
|
655 | 3903775176ed-e68910bd-backup.hg | |
652 | $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg |
|
656 | $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg | |
653 | $ hg strip -r 0 |
|
657 | $ hg strip -r 0 | |
654 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob) |
|
658 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob) | |
655 | $ ls .hg/strip-backup |
|
659 | $ ls .hg/strip-backup | |
656 | 3903775176ed-54390173-backup.hg |
|
660 | 3903775176ed-54390173-backup.hg | |
657 | 3903775176ed-e68910bd-backup.hg |
|
661 | 3903775176ed-e68910bd-backup.hg | |
658 | $ cd .. |
|
662 | $ cd .. | |
659 |
|
663 | |||
660 | Test that we only bundle the stripped changesets (issue4736) |
|
664 | Test that we only bundle the stripped changesets (issue4736) | |
661 | ------------------------------------------------------------ |
|
665 | ------------------------------------------------------------ | |
662 |
|
666 | |||
663 | initialization (previous repo is empty anyway) |
|
667 | initialization (previous repo is empty anyway) | |
664 |
|
668 | |||
665 | $ hg init issue4736 |
|
669 | $ hg init issue4736 | |
666 | $ cd issue4736 |
|
670 | $ cd issue4736 | |
667 | $ echo a > a |
|
671 | $ echo a > a | |
668 | $ hg add a |
|
672 | $ hg add a | |
669 | $ hg commit -m commitA |
|
673 | $ hg commit -m commitA | |
670 | $ echo b > b |
|
674 | $ echo b > b | |
671 | $ hg add b |
|
675 | $ hg add b | |
672 | $ hg commit -m commitB |
|
676 | $ hg commit -m commitB | |
673 | $ echo c > c |
|
677 | $ echo c > c | |
674 | $ hg add c |
|
678 | $ hg add c | |
675 | $ hg commit -m commitC |
|
679 | $ hg commit -m commitC | |
676 | $ hg up 'desc(commitB)' |
|
680 | $ hg up 'desc(commitB)' | |
677 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
681 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
678 | $ echo d > d |
|
682 | $ echo d > d | |
679 | $ hg add d |
|
683 | $ hg add d | |
680 | $ hg commit -m commitD |
|
684 | $ hg commit -m commitD | |
681 | created new head |
|
685 | created new head | |
682 | $ hg up 'desc(commitC)' |
|
686 | $ hg up 'desc(commitC)' | |
683 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
687 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
684 | $ hg merge 'desc(commitD)' |
|
688 | $ hg merge 'desc(commitD)' | |
685 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
689 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
686 | (branch merge, don't forget to commit) |
|
690 | (branch merge, don't forget to commit) | |
687 | $ hg ci -m 'mergeCD' |
|
691 | $ hg ci -m 'mergeCD' | |
688 | $ hg log -G |
|
692 | $ hg log -G | |
689 | @ changeset: 4:d8db9d137221 |
|
693 | @ changeset: 4:d8db9d137221 | |
690 | |\ tag: tip |
|
694 | |\ tag: tip | |
691 | | | parent: 2:5c51d8d6557d |
|
695 | | | parent: 2:5c51d8d6557d | |
692 | | | parent: 3:6625a5168474 |
|
696 | | | parent: 3:6625a5168474 | |
693 | | | user: test |
|
697 | | | user: test | |
694 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
698 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
695 | | | summary: mergeCD |
|
699 | | | summary: mergeCD | |
696 | | | |
|
700 | | | | |
697 | | o changeset: 3:6625a5168474 |
|
701 | | o changeset: 3:6625a5168474 | |
698 | | | parent: 1:eca11cf91c71 |
|
702 | | | parent: 1:eca11cf91c71 | |
699 | | | user: test |
|
703 | | | user: test | |
700 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
704 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
701 | | | summary: commitD |
|
705 | | | summary: commitD | |
702 | | | |
|
706 | | | | |
703 | o | changeset: 2:5c51d8d6557d |
|
707 | o | changeset: 2:5c51d8d6557d | |
704 | |/ user: test |
|
708 | |/ user: test | |
705 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
709 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
706 | | summary: commitC |
|
710 | | summary: commitC | |
707 | | |
|
711 | | | |
708 | o changeset: 1:eca11cf91c71 |
|
712 | o changeset: 1:eca11cf91c71 | |
709 | | user: test |
|
713 | | user: test | |
710 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
714 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
711 | | summary: commitB |
|
715 | | summary: commitB | |
712 | | |
|
716 | | | |
713 | o changeset: 0:105141ef12d0 |
|
717 | o changeset: 0:105141ef12d0 | |
714 | user: test |
|
718 | user: test | |
715 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
719 | date: Thu Jan 01 00:00:00 1970 +0000 | |
716 | summary: commitA |
|
720 | summary: commitA | |
717 |
|
721 | |||
718 |
|
722 | |||
719 | Check bundle behavior: |
|
723 | Check bundle behavior: | |
720 |
|
724 | |||
721 | $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg |
|
725 | $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg | |
722 | 2 changesets found |
|
726 | 2 changesets found | |
723 | $ hg log -r 'bundle()' -R ../issue4736.hg |
|
727 | $ hg log -r 'bundle()' -R ../issue4736.hg | |
724 | changeset: 3:6625a5168474 |
|
728 | changeset: 3:6625a5168474 | |
725 | parent: 1:eca11cf91c71 |
|
729 | parent: 1:eca11cf91c71 | |
726 | user: test |
|
730 | user: test | |
727 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
731 | date: Thu Jan 01 00:00:00 1970 +0000 | |
728 | summary: commitD |
|
732 | summary: commitD | |
729 |
|
733 | |||
730 | changeset: 4:d8db9d137221 |
|
734 | changeset: 4:d8db9d137221 | |
731 | tag: tip |
|
735 | tag: tip | |
732 | parent: 2:5c51d8d6557d |
|
736 | parent: 2:5c51d8d6557d | |
733 | parent: 3:6625a5168474 |
|
737 | parent: 3:6625a5168474 | |
734 | user: test |
|
738 | user: test | |
735 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
739 | date: Thu Jan 01 00:00:00 1970 +0000 | |
736 | summary: mergeCD |
|
740 | summary: mergeCD | |
737 |
|
741 | |||
738 |
|
742 | |||
739 | check strip behavior |
|
743 | check strip behavior | |
740 |
|
744 | |||
741 | $ hg --config extensions.strip= strip 'desc(commitD)' --debug |
|
745 | $ hg --config extensions.strip= strip 'desc(commitD)' --debug | |
742 | resolving manifests |
|
746 | resolving manifests | |
743 | branchmerge: False, force: True, partial: False |
|
747 | branchmerge: False, force: True, partial: False | |
744 | ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71 |
|
748 | ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71 | |
745 | c: other deleted -> r |
|
749 | c: other deleted -> r | |
746 | removing c |
|
750 | removing c | |
747 | d: other deleted -> r |
|
751 | d: other deleted -> r | |
748 | removing d |
|
752 | removing d | |
749 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
753 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
750 | 2 changesets found |
|
754 | 2 changesets found | |
751 | list of changesets: |
|
755 | list of changesets: | |
752 | 6625a516847449b6f0fa3737b9ba56e9f0f3032c |
|
756 | 6625a516847449b6f0fa3737b9ba56e9f0f3032c | |
753 | d8db9d1372214336d2b5570f20ee468d2c72fa8b |
|
757 | d8db9d1372214336d2b5570f20ee468d2c72fa8b | |
|
758 | bundle2-output-bundle: "HG20", (1 params) 1 parts total | |||
|
759 | bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload | |||
754 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) |
|
760 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) | |
755 | invalid branchheads cache (served): tip differs |
|
761 | invalid branchheads cache (served): tip differs | |
756 | truncating cache/rbc-revs-v1 to 24 |
|
762 | truncating cache/rbc-revs-v1 to 24 | |
757 | $ hg log -G |
|
763 | $ hg log -G | |
758 | o changeset: 2:5c51d8d6557d |
|
764 | o changeset: 2:5c51d8d6557d | |
759 | | tag: tip |
|
765 | | tag: tip | |
760 | | user: test |
|
766 | | user: test | |
761 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
767 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
762 | | summary: commitC |
|
768 | | summary: commitC | |
763 | | |
|
769 | | | |
764 | @ changeset: 1:eca11cf91c71 |
|
770 | @ changeset: 1:eca11cf91c71 | |
765 | | user: test |
|
771 | | user: test | |
766 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
772 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
767 | | summary: commitB |
|
773 | | summary: commitB | |
768 | | |
|
774 | | | |
769 | o changeset: 0:105141ef12d0 |
|
775 | o changeset: 0:105141ef12d0 | |
770 | user: test |
|
776 | user: test | |
771 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
777 | date: Thu Jan 01 00:00:00 1970 +0000 | |
772 | summary: commitA |
|
778 | summary: commitA | |
773 |
|
779 | |||
774 |
|
780 | |||
775 | strip backup content |
|
781 | strip backup content | |
776 |
|
782 | |||
777 | $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg |
|
783 | $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg | |
778 | changeset: 3:6625a5168474 |
|
784 | changeset: 3:6625a5168474 | |
779 | parent: 1:eca11cf91c71 |
|
785 | parent: 1:eca11cf91c71 | |
780 | user: test |
|
786 | user: test | |
781 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
787 | date: Thu Jan 01 00:00:00 1970 +0000 | |
782 | summary: commitD |
|
788 | summary: commitD | |
783 |
|
789 | |||
784 | changeset: 4:d8db9d137221 |
|
790 | changeset: 4:d8db9d137221 | |
785 | tag: tip |
|
791 | tag: tip | |
786 | parent: 2:5c51d8d6557d |
|
792 | parent: 2:5c51d8d6557d | |
787 | parent: 3:6625a5168474 |
|
793 | parent: 3:6625a5168474 | |
788 | user: test |
|
794 | user: test | |
789 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
795 | date: Thu Jan 01 00:00:00 1970 +0000 | |
790 | summary: mergeCD |
|
796 | summary: mergeCD | |
791 |
|
797 | |||
792 |
|
798 | |||
793 | Error during post-close callback of the strip transaction |
|
799 | Error during post-close callback of the strip transaction | |
794 | (They should be gracefully handled and reported) |
|
800 | (They should be gracefully handled and reported) | |
795 |
|
801 | |||
796 | $ cat > ../crashstrip.py << EOF |
|
802 | $ cat > ../crashstrip.py << EOF | |
797 | > from mercurial import error |
|
803 | > from mercurial import error | |
798 | > def reposetup(ui, repo): |
|
804 | > def reposetup(ui, repo): | |
799 | > class crashstriprepo(repo.__class__): |
|
805 | > class crashstriprepo(repo.__class__): | |
800 | > def transaction(self, desc, *args, **kwargs): |
|
806 | > def transaction(self, desc, *args, **kwargs): | |
801 | > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs) |
|
807 | > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs) | |
802 | > if desc == 'strip': |
|
808 | > if desc == 'strip': | |
803 | > def crash(tra): raise error.Abort('boom') |
|
809 | > def crash(tra): raise error.Abort('boom') | |
804 | > tr.addpostclose('crash', crash) |
|
810 | > tr.addpostclose('crash', crash) | |
805 | > return tr |
|
811 | > return tr | |
806 | > repo.__class__ = crashstriprepo |
|
812 | > repo.__class__ = crashstriprepo | |
807 | > EOF |
|
813 | > EOF | |
808 | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py |
|
814 | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py | |
809 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob) |
|
815 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob) | |
810 | strip failed, full bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob) |
|
816 | strip failed, full bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob) | |
811 | abort: boom |
|
817 | abort: boom | |
812 | [255] |
|
818 | [255] | |
813 |
|
819 | |||
814 |
|
820 |
General Comments 0
You need to be logged in to leave comments.
Login now