##// END OF EJS Templates
histedit: record histedit source (issue3681)...
Pierre-Yves David -
r18437:358c23e8 default
parent child Browse files
Show More
@@ -181,12 +181,15 b' def commitfuncfor(repo, src):'
181
181
182 This function ensure we apply the same treatement to all changesets.
182 This function ensure we apply the same treatement to all changesets.
183
183
184 No such treatment is done yet.
184 - Add a 'histedit_source' entry in extra.
185
185
186 Note that fold have its own separated logic because its handling is a bit
186 Note that fold have its own separated logic because its handling is a bit
187 different and not easily factored out of the fold method.
187 different and not easily factored out of the fold method.
188 """
188 """
189 def commitfunc(**kwargs):
189 def commitfunc(**kwargs):
190 extra = kwargs.get('extra', {}).copy()
191 extra['histedit_source'] = src.hex()
192 kwargs['extra'] = extra
190 return repo.commit(**kwargs)
193 return repo.commit(**kwargs)
191 return commitfunc
194 return commitfunc
192
195
@@ -270,7 +273,7 b' def collapse(repo, first, last, commitop'
270 message = first.description()
273 message = first.description()
271 user = commitopts.get('user')
274 user = commitopts.get('user')
272 date = commitopts.get('date')
275 date = commitopts.get('date')
273 extra = first.extra()
276 extra = commitopts.get('extra')
274
277
275 parents = (first.p1().node(), first.p2().node())
278 parents = (first.p1().node(), first.p2().node())
276 new = context.memctx(repo,
279 new = context.memctx(repo,
@@ -348,6 +351,12 b' def finishfold(ui, repo, ctx, oldctx, ne'
348 commitopts['message'] = newmessage
351 commitopts['message'] = newmessage
349 # date
352 # date
350 commitopts['date'] = max(ctx.date(), oldctx.date())
353 commitopts['date'] = max(ctx.date(), oldctx.date())
354 extra = ctx.extra().copy()
355 # histedit_source
356 # note: ctx is likely a temporary commit but that the best we can do here
357 # This is sufficient to solve issue3681 anyway
358 extra['histedit_source'] = '%s,%s' % (ctx.hex(), oldctx.hex())
359 commitopts['extra'] = extra
351 n = collapse(repo, ctx, repo[newnode], commitopts)
360 n = collapse(repo, ctx, repo[newnode], commitopts)
352 if n is None:
361 if n is None:
353 return ctx, []
362 return ctx, []
@@ -84,30 +84,30 b''
84 > pick 652413bf663e 5 f
84 > pick 652413bf663e 5 f
85 > EOF
85 > EOF
86 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
86 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
87 histedit: moving bookmarks also-two from 177f92b77385 to d36c0562f908
87 histedit: moving bookmarks also-two from 177f92b77385 to b346ab9a313d
88 histedit: moving bookmarks five from 652413bf663e to 0efacef7cb48
88 histedit: moving bookmarks five from 652413bf663e to cacdfd884a93
89 histedit: moving bookmarks four from e860deea161a to ae467701c500
89 histedit: moving bookmarks four from e860deea161a to 59d9f330561f
90 histedit: moving bookmarks three from 055a42cdd887 to ae467701c500
90 histedit: moving bookmarks three from 055a42cdd887 to 59d9f330561f
91 histedit: moving bookmarks two from 177f92b77385 to d36c0562f908
91 histedit: moving bookmarks two from 177f92b77385 to b346ab9a313d
92 histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b
92 histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b
93 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg (glob)
93 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg (glob)
94 saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg (glob)
94 saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-backup.hg (glob)
95 $ hg log --graph
95 $ hg log --graph
96 @ changeset: 3:0efacef7cb48
96 @ changeset: 3:cacdfd884a93
97 | bookmark: five
97 | bookmark: five
98 | tag: tip
98 | tag: tip
99 | user: test
99 | user: test
100 | date: Thu Jan 01 00:00:00 1970 +0000
100 | date: Thu Jan 01 00:00:00 1970 +0000
101 | summary: f
101 | summary: f
102 |
102 |
103 o changeset: 2:ae467701c500
103 o changeset: 2:59d9f330561f
104 | bookmark: four
104 | bookmark: four
105 | bookmark: three
105 | bookmark: three
106 | user: test
106 | user: test
107 | date: Thu Jan 01 00:00:00 1970 +0000
107 | date: Thu Jan 01 00:00:00 1970 +0000
108 | summary: d
108 | summary: d
109 |
109 |
110 o changeset: 1:d36c0562f908
110 o changeset: 1:b346ab9a313d
111 | bookmark: also-two
111 | bookmark: also-two
112 | bookmark: two
112 | bookmark: two
113 | user: test
113 | user: test
@@ -121,11 +121,11 b''
121 summary: a
121 summary: a
122
122
123 $ HGEDITOR=cat hg histedit 1
123 $ HGEDITOR=cat hg histedit 1
124 pick d36c0562f908 1 c
124 pick b346ab9a313d 1 c
125 pick ae467701c500 2 d
125 pick 59d9f330561f 2 d
126 pick 0efacef7cb48 3 f
126 pick cacdfd884a93 3 f
127
127
128 # Edit history between d36c0562f908 and 0efacef7cb48
128 # Edit history between b346ab9a313d and cacdfd884a93
129 #
129 #
130 # Commands:
130 # Commands:
131 # p, pick = use commit
131 # p, pick = use commit
@@ -136,21 +136,21 b''
136 #
136 #
137 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
138 $ cat > commands.txt << EOF
138 $ cat > commands.txt << EOF
139 > pick d36c0562f908 1 c
139 > pick b346ab9a313d 1 c
140 > pick 0efacef7cb48 3 f
140 > pick cacdfd884a93 3 f
141 > pick ae467701c500 2 d
141 > pick 59d9f330561f 2 d
142 > EOF
142 > EOF
143 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
143 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
144 histedit: moving bookmarks five from 0efacef7cb48 to 1be9c35b4cb2
144 histedit: moving bookmarks five from cacdfd884a93 to c04e50810e4b
145 histedit: moving bookmarks four from ae467701c500 to 1be9c35b4cb2
145 histedit: moving bookmarks four from 59d9f330561f to c04e50810e4b
146 histedit: moving bookmarks three from ae467701c500 to 1be9c35b4cb2
146 histedit: moving bookmarks three from 59d9f330561f to c04e50810e4b
147 saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg (glob)
147 saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-backup.hg (glob)
148
148
149 We expect 'five' to stay at tip, since the tipmost bookmark is most
149 We expect 'five' to stay at tip, since the tipmost bookmark is most
150 likely the useful signal.
150 likely the useful signal.
151
151
152 $ hg log --graph
152 $ hg log --graph
153 @ changeset: 3:1be9c35b4cb2
153 @ changeset: 3:c04e50810e4b
154 | bookmark: five
154 | bookmark: five
155 | bookmark: four
155 | bookmark: four
156 | bookmark: three
156 | bookmark: three
@@ -159,12 +159,12 b' likely the useful signal.'
159 | date: Thu Jan 01 00:00:00 1970 +0000
159 | date: Thu Jan 01 00:00:00 1970 +0000
160 | summary: d
160 | summary: d
161 |
161 |
162 o changeset: 2:7c044e3e33a9
162 o changeset: 2:c13eb81022ca
163 | user: test
163 | user: test
164 | date: Thu Jan 01 00:00:00 1970 +0000
164 | date: Thu Jan 01 00:00:00 1970 +0000
165 | summary: f
165 | summary: f
166 |
166 |
167 o changeset: 1:d36c0562f908
167 o changeset: 1:b346ab9a313d
168 | bookmark: also-two
168 | bookmark: also-two
169 | bookmark: two
169 | bookmark: two
170 | user: test
170 | user: test
@@ -94,18 +94,18 b' rules should end up in .hg/histedit-last'
94
94
95 log after edit
95 log after edit
96 $ hg log --graph
96 $ hg log --graph
97 @ changeset: 5:853c68da763f
97 @ changeset: 5:07114f51870f
98 | tag: tip
98 | tag: tip
99 | user: test
99 | user: test
100 | date: Thu Jan 01 00:00:00 1970 +0000
100 | date: Thu Jan 01 00:00:00 1970 +0000
101 | summary: d
101 | summary: d
102 |
102 |
103 o changeset: 4:26f6a030ae82
103 o changeset: 4:8ade9693061e
104 | user: test
104 | user: test
105 | date: Thu Jan 01 00:00:00 1970 +0000
105 | date: Thu Jan 01 00:00:00 1970 +0000
106 | summary: f
106 | summary: f
107 |
107 |
108 o changeset: 3:b069cc29fb22
108 o changeset: 3:d8249471110a
109 | user: test
109 | user: test
110 | date: Thu Jan 01 00:00:00 1970 +0000
110 | date: Thu Jan 01 00:00:00 1970 +0000
111 | summary: e
111 | summary: e
@@ -130,9 +130,9 b' put things back'
130
130
131 $ cat > $EDITED <<EOF
131 $ cat > $EDITED <<EOF
132 > pick 177f92b77385 c
132 > pick 177f92b77385 c
133 > pick 853c68da763f d
133 > pick 07114f51870f d
134 > pick b069cc29fb22 e
134 > pick d8249471110a e
135 > pick 26f6a030ae82 f
135 > pick 8ade9693061e f
136 > EOF
136 > EOF
137 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
137 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
138 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
138 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
@@ -141,18 +141,18 b' put things back'
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142
142
143 $ hg log --graph
143 $ hg log --graph
144 @ changeset: 5:652413bf663e
144 @ changeset: 5:7eca9b5b1148
145 | tag: tip
145 | tag: tip
146 | user: test
146 | user: test
147 | date: Thu Jan 01 00:00:00 1970 +0000
147 | date: Thu Jan 01 00:00:00 1970 +0000
148 | summary: f
148 | summary: f
149 |
149 |
150 o changeset: 4:e860deea161a
150 o changeset: 4:915da888f2de
151 | user: test
151 | user: test
152 | date: Thu Jan 01 00:00:00 1970 +0000
152 | date: Thu Jan 01 00:00:00 1970 +0000
153 | summary: e
153 | summary: e
154 |
154 |
155 o changeset: 3:055a42cdd887
155 o changeset: 3:10517e47bbbb
156 | user: test
156 | user: test
157 | date: Thu Jan 01 00:00:00 1970 +0000
157 | date: Thu Jan 01 00:00:00 1970 +0000
158 | summary: d
158 | summary: d
@@ -176,9 +176,9 b' put things back'
176 slightly different this time
176 slightly different this time
177
177
178 $ cat > $EDITED <<EOF
178 $ cat > $EDITED <<EOF
179 > pick 055a42cdd887 d
179 > pick 10517e47bbbb d
180 > pick 652413bf663e f
180 > pick 7eca9b5b1148 f
181 > pick e860deea161a e
181 > pick 915da888f2de e
182 > pick 177f92b77385 c
182 > pick 177f92b77385 c
183 > EOF
183 > EOF
184 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
184 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
@@ -188,23 +188,23 b' slightly different this time'
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 $ hg log --graph
190 $ hg log --graph
191 @ changeset: 5:99a62755c625
191 @ changeset: 5:38b92f448761
192 | tag: tip
192 | tag: tip
193 | user: test
193 | user: test
194 | date: Thu Jan 01 00:00:00 1970 +0000
194 | date: Thu Jan 01 00:00:00 1970 +0000
195 | summary: c
195 | summary: c
196 |
196 |
197 o changeset: 4:7c6fdd608667
197 o changeset: 4:de71b079d9ce
198 | user: test
198 | user: test
199 | date: Thu Jan 01 00:00:00 1970 +0000
199 | date: Thu Jan 01 00:00:00 1970 +0000
200 | summary: e
200 | summary: e
201 |
201 |
202 o changeset: 3:c4f52e213402
202 o changeset: 3:be9ae3a309c6
203 | user: test
203 | user: test
204 | date: Thu Jan 01 00:00:00 1970 +0000
204 | date: Thu Jan 01 00:00:00 1970 +0000
205 | summary: f
205 | summary: f
206 |
206 |
207 o changeset: 2:bfe4a5a76b37
207 o changeset: 2:799205341b6b
208 | user: test
208 | user: test
209 | date: Thu Jan 01 00:00:00 1970 +0000
209 | date: Thu Jan 01 00:00:00 1970 +0000
210 | summary: d
210 | summary: d
@@ -222,48 +222,48 b' slightly different this time'
222
222
223 keep prevents stripping dead revs
223 keep prevents stripping dead revs
224 $ cat > $EDITED <<EOF
224 $ cat > $EDITED <<EOF
225 > pick bfe4a5a76b37 d
225 > pick 799205341b6b d
226 > pick c4f52e213402 f
226 > pick be9ae3a309c6 f
227 > pick 99a62755c625 c
227 > pick 38b92f448761 c
228 > pick 7c6fdd608667 e
228 > pick de71b079d9ce e
229 > EOF
229 > EOF
230 $ HGEDITOR="cat \"$EDITED\" > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle
230 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 799205341b6b --keep 2>&1 | fixbundle
231 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
231 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
232 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ hg log --graph
234 $ hg log --graph
235 > cat > $EDITED <<EOF
235 > cat > $EDITED <<EOF
236 > pick 7c6fdd608667 e
236 > pick de71b079d9ce e
237 > pick 99a62755c625 c
237 > pick 38b92f448761 c
238 > EOF
238 > EOF
239 @ changeset: 7:99e266581538
239 @ changeset: 7:803ef1c6fcfd
240 | tag: tip
240 | tag: tip
241 | user: test
241 | user: test
242 | date: Thu Jan 01 00:00:00 1970 +0000
242 | date: Thu Jan 01 00:00:00 1970 +0000
243 | summary: e
243 | summary: e
244 |
244 |
245 o changeset: 6:5ad36efb0653
245 o changeset: 6:ece0b8d93dda
246 | parent: 3:c4f52e213402
246 | parent: 3:be9ae3a309c6
247 | user: test
247 | user: test
248 | date: Thu Jan 01 00:00:00 1970 +0000
248 | date: Thu Jan 01 00:00:00 1970 +0000
249 | summary: c
249 | summary: c
250 |
250 |
251 | o changeset: 5:99a62755c625
251 | o changeset: 5:38b92f448761
252 | | user: test
252 | | user: test
253 | | date: Thu Jan 01 00:00:00 1970 +0000
253 | | date: Thu Jan 01 00:00:00 1970 +0000
254 | | summary: c
254 | | summary: c
255 | |
255 | |
256 | o changeset: 4:7c6fdd608667
256 | o changeset: 4:de71b079d9ce
257 |/ user: test
257 |/ user: test
258 | date: Thu Jan 01 00:00:00 1970 +0000
258 | date: Thu Jan 01 00:00:00 1970 +0000
259 | summary: e
259 | summary: e
260 |
260 |
261 o changeset: 3:c4f52e213402
261 o changeset: 3:be9ae3a309c6
262 | user: test
262 | user: test
263 | date: Thu Jan 01 00:00:00 1970 +0000
263 | date: Thu Jan 01 00:00:00 1970 +0000
264 | summary: f
264 | summary: f
265 |
265 |
266 o changeset: 2:bfe4a5a76b37
266 o changeset: 2:799205341b6b
267 | user: test
267 | user: test
268 | date: Thu Jan 01 00:00:00 1970 +0000
268 | date: Thu Jan 01 00:00:00 1970 +0000
269 | summary: d
269 | summary: d
@@ -283,34 +283,34 b' try with --rev'
283 $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
283 $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
284 abort: may not use changesets other than the ones listed
284 abort: may not use changesets other than the ones listed
285 $ hg log --graph
285 $ hg log --graph
286 @ changeset: 7:99e266581538
286 @ changeset: 7:803ef1c6fcfd
287 | tag: tip
287 | tag: tip
288 | user: test
288 | user: test
289 | date: Thu Jan 01 00:00:00 1970 +0000
289 | date: Thu Jan 01 00:00:00 1970 +0000
290 | summary: e
290 | summary: e
291 |
291 |
292 o changeset: 6:5ad36efb0653
292 o changeset: 6:ece0b8d93dda
293 | parent: 3:c4f52e213402
293 | parent: 3:be9ae3a309c6
294 | user: test
294 | user: test
295 | date: Thu Jan 01 00:00:00 1970 +0000
295 | date: Thu Jan 01 00:00:00 1970 +0000
296 | summary: c
296 | summary: c
297 |
297 |
298 | o changeset: 5:99a62755c625
298 | o changeset: 5:38b92f448761
299 | | user: test
299 | | user: test
300 | | date: Thu Jan 01 00:00:00 1970 +0000
300 | | date: Thu Jan 01 00:00:00 1970 +0000
301 | | summary: c
301 | | summary: c
302 | |
302 | |
303 | o changeset: 4:7c6fdd608667
303 | o changeset: 4:de71b079d9ce
304 |/ user: test
304 |/ user: test
305 | date: Thu Jan 01 00:00:00 1970 +0000
305 | date: Thu Jan 01 00:00:00 1970 +0000
306 | summary: e
306 | summary: e
307 |
307 |
308 o changeset: 3:c4f52e213402
308 o changeset: 3:be9ae3a309c6
309 | user: test
309 | user: test
310 | date: Thu Jan 01 00:00:00 1970 +0000
310 | date: Thu Jan 01 00:00:00 1970 +0000
311 | summary: f
311 | summary: f
312 |
312 |
313 o changeset: 2:bfe4a5a76b37
313 o changeset: 2:799205341b6b
314 | user: test
314 | user: test
315 | date: Thu Jan 01 00:00:00 1970 +0000
315 | date: Thu Jan 01 00:00:00 1970 +0000
316 | summary: d
316 | summary: d
@@ -69,18 +69,18 b' edit the history'
69
69
70 log after edit
70 log after edit
71 $ hg log --graph
71 $ hg log --graph
72 @ changeset: 4:708943196e52
72 @ changeset: 4:f518305ce889
73 | tag: tip
73 | tag: tip
74 | user: test
74 | user: test
75 | date: Thu Jan 01 00:00:00 1970 +0000
75 | date: Thu Jan 01 00:00:00 1970 +0000
76 | summary: d
76 | summary: d
77 |
77 |
78 o changeset: 3:75cbdffecadb
78 o changeset: 3:a4f7421b80f7
79 | user: test
79 | user: test
80 | date: Thu Jan 01 00:00:00 1970 +0000
80 | date: Thu Jan 01 00:00:00 1970 +0000
81 | summary: f
81 | summary: f
82 |
82 |
83 o changeset: 2:493dc0964412
83 o changeset: 2:ee283cb5f2d5
84 | user: test
84 | user: test
85 | date: Thu Jan 01 00:00:00 1970 +0000
85 | date: Thu Jan 01 00:00:00 1970 +0000
86 | summary: e
86 | summary: e
@@ -96,6 +96,25 b' log after edit'
96 summary: a
96 summary: a
97
97
98
98
99 Check histedit_source
100
101 $ hg log --debug --rev f518305ce889
102 changeset: 4:f518305ce889c07cb5bd05522176d75590ef3324
103 tag: tip
104 phase: draft
105 parent: 3:a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3
106 parent: -1:0000000000000000000000000000000000000000
107 manifest: 4:d3d4f51c157ff242c32ff745d4799aaa26ccda44
108 user: test
109 date: Thu Jan 01 00:00:00 1970 +0000
110 files+: d
111 extra: branch=default
112 extra: histedit_source=055a42cdd88768532f9cf79daa407fc8d138de9b
113 description:
114 d
115
116
117
99 manifest after edit
118 manifest after edit
100 $ hg manifest
119 $ hg manifest
101 a
120 a
@@ -88,13 +88,13 b' commit, then edit the revision'
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89
89
90 $ hg log --graph
90 $ hg log --graph
91 @ changeset: 6:bf757c081cd0
91 @ changeset: 6:b5f70786f9b0
92 | tag: tip
92 | tag: tip
93 | user: test
93 | user: test
94 | date: Thu Jan 01 00:00:00 1970 +0000
94 | date: Thu Jan 01 00:00:00 1970 +0000
95 | summary: f
95 | summary: f
96 |
96 |
97 o changeset: 5:d6b15fed32d4
97 o changeset: 5:a5e1ba2f7afb
98 | user: test
98 | user: test
99 | date: Thu Jan 01 00:00:00 1970 +0000
99 | date: Thu Jan 01 00:00:00 1970 +0000
100 | summary: foobaz
100 | summary: foobaz
@@ -128,8 +128,26 b' commit, then edit the revision'
128 $ hg cat e
128 $ hg cat e
129 a
129 a
130
130
131 check histedit_source
132
133 $ hg log --debug --rev 5
134 changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d
135 phase: draft
136 parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34
137 parent: -1:0000000000000000000000000000000000000000
138 manifest: 5:5ad3be8791f39117565557781f5464363b918a45
139 user: test
140 date: Thu Jan 01 00:00:00 1970 +0000
141 files: e
142 extra: branch=default
143 extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae
144 description:
145 foobaz
146
147
148
131 $ cat > $EDITED <<EOF
149 $ cat > $EDITED <<EOF
132 > edit bf757c081cd0 f
150 > edit b5f70786f9b0 f
133 > EOF
151 > EOF
134 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
152 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
135 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
153 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -139,11 +157,13 b' commit, then edit the revision'
139 A f
157 A f
140 $ HGEDITOR='true' hg histedit --continue
158 $ HGEDITOR='true' hg histedit --continue
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob)
161
142 $ hg status
162 $ hg status
143
163
144 log after edit
164 log after edit
145 $ hg log --limit 1
165 $ hg log --limit 1
146 changeset: 6:bf757c081cd0
166 changeset: 6:a107ee126658
147 tag: tip
167 tag: tip
148 user: test
168 user: test
149 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
@@ -160,7 +180,7 b" say we'll change the message, but don't."
160 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 $ hg status
181 $ hg status
162 $ hg log --limit 1
182 $ hg log --limit 1
163 changeset: 6:bf757c081cd0
183 changeset: 6:1fd3b2fe7754
164 tag: tip
184 tag: tip
165 user: test
185 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
186 date: Thu Jan 01 00:00:00 1970 +0000
@@ -169,18 +189,18 b" say we'll change the message, but don't."
169
189
170 modify the message
190 modify the message
171 $ cat > $EDITED <<EOF
191 $ cat > $EDITED <<EOF
172 > mess bf757c081cd0 f
192 > mess 1fd3b2fe7754 f
173 > EOF
193 > EOF
174 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
194 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
175 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
176 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 $ hg status
197 $ hg status
178 $ hg log --limit 1
198 $ hg log --limit 1
179 changeset: 6:0b16746f8e89
199 changeset: 6:5585e802ef99
180 tag: tip
200 tag: tip
181 user: test
201 user: test
182 date: Thu Jan 01 00:00:00 1970 +0000
202 date: Thu Jan 01 00:00:00 1970 +0000
183 summary: mess bf757c081cd0 f
203 summary: mess 1fd3b2fe7754 f
184
204
185
205
186 rollback should not work after a histedit
206 rollback should not work after a histedit
@@ -136,13 +136,13 b' just continue this time'
136
136
137 log after edit
137 log after edit
138 $ hg log --graph
138 $ hg log --graph
139 @ changeset: 5:2696a654c663
139 @ changeset: 5:d9cf42e54966
140 | tag: tip
140 | tag: tip
141 | user: test
141 | user: test
142 | date: Thu Jan 01 00:00:00 1970 +0000
142 | date: Thu Jan 01 00:00:00 1970 +0000
143 | summary: f
143 | summary: f
144 |
144 |
145 o changeset: 4:ec2c1cf833a8
145 o changeset: 4:10486af2e984
146 | user: test
146 | user: test
147 | date: Thu Jan 01 00:00:00 1970 +0000
147 | date: Thu Jan 01 00:00:00 1970 +0000
148 | summary: d
148 | summary: d
@@ -72,18 +72,18 b' edit the history'
72
72
73 log after edit
73 log after edit
74 $ hg log --graph
74 $ hg log --graph
75 @ changeset: 4:82b0c1ff1777
75 @ changeset: 4:7e0a290363ed
76 | tag: tip
76 | tag: tip
77 | user: test
77 | user: test
78 | date: Thu Jan 01 00:00:00 1970 +0000
78 | date: Thu Jan 01 00:00:00 1970 +0000
79 | summary: d
79 | summary: d
80 |
80 |
81 o changeset: 3:150aafb44a91
81 o changeset: 3:5e24935bad3d
82 | user: test
82 | user: test
83 | date: Thu Jan 01 00:00:00 1970 +0000
83 | date: Thu Jan 01 00:00:00 1970 +0000
84 | summary: pick e860deea161a e
84 | summary: pick e860deea161a e
85 |
85 |
86 o changeset: 2:493dc0964412
86 o changeset: 2:ee283cb5f2d5
87 | user: test
87 | user: test
88 | date: Thu Jan 01 00:00:00 1970 +0000
88 | date: Thu Jan 01 00:00:00 1970 +0000
89 | summary: e
89 | summary: e
@@ -108,6 +108,28 b' post-fold manifest'
108 e
108 e
109 f
109 f
110
110
111
112 check histedit_source
113
114 $ hg log --debug --rev 3
115 changeset: 3:5e24935bad3d5a4486de3b90f233e991465ced72
116 phase: draft
117 parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a
118 parent: -1:0000000000000000000000000000000000000000
119 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
120 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
122 files+: c f
123 extra: branch=default
124 extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b
125 description:
126 pick e860deea161a e
127 pick 652413bf663e f
128 fold 177f92b77385 c
129 pick 055a42cdd887 d
130
131
132
111 $ cd ..
133 $ cd ..
112
134
113 folding and creating no new change doesn't break:
135 folding and creating no new change doesn't break:
@@ -258,7 +280,7 b' dropped revision.'
258 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
281 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
260 $ hg log -G
282 $ hg log -G
261 @ changeset: 1:e29e02896e6c
283 @ changeset: 1:10c647b2cdd5
262 | tag: tip
284 | tag: tip
263 | user: test
285 | user: test
264 | date: Thu Jan 01 00:00:00 1970 +0000
286 | date: Thu Jan 01 00:00:00 1970 +0000
@@ -273,7 +295,7 b' dropped revision.'
273 # HG changeset patch
295 # HG changeset patch
274 # User test
296 # User test
275 # Date 0 0
297 # Date 0 0
276 # Node ID e29e02896e6c2b149d2228a0a64b4f3a9a4237f3
298 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
277 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
299 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
278 +4
300 +4
279 ***
301 ***
@@ -281,7 +303,7 b' dropped revision.'
281 ***
303 ***
282 +6
304 +6
283
305
284 diff -r 0189ba417d34 -r e29e02896e6c file
306 diff -r 0189ba417d34 -r 10c647b2cdd5 file
285 --- a/file Thu Jan 01 00:00:00 1970 +0000
307 --- a/file Thu Jan 01 00:00:00 1970 +0000
286 +++ b/file Thu Jan 01 00:00:00 1970 +0000
308 +++ b/file Thu Jan 01 00:00:00 1970 +0000
287 @@ -1,3 +1,6 @@
309 @@ -1,3 +1,6 @@
@@ -96,17 +96,19 b' editing a changeset without any actual c'
96 When you are finished, run hg histedit --continue to resume.
96 When you are finished, run hg histedit --continue to resume.
97 $ continueediting true "(leaving commit message unaltered)"
97 $ continueediting true "(leaving commit message unaltered)"
98 % finalize changeset editing (leaving commit message unaltered)
98 % finalize changeset editing (leaving commit message unaltered)
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
101
100
102
101 check state of working copy
103 check state of working copy
102 $ hg id
104 $ hg id
103 652413bf663e tip
105 794fe033d0a0 tip
104
106
105 $ graphlog "log after history editing"
107 $ graphlog "log after history editing"
106 % log after history editing
108 % log after history editing
107 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
109 @ 5 794fe033d0a030f8df77c5de945fca35c9181c30 "f"
108 |
110 |
109 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
111 o 4 04d2fab980779f332dec458cc944f28de8b43435 "e"
110 |
112 |
111 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
113 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
112 |
114 |
@@ -152,12 +154,14 b' check state of working copy'
152 When you are finished, run hg histedit --continue to resume.
154 When you are finished, run hg histedit --continue to resume.
153 $ graphlog "log after first edit"
155 $ graphlog "log after first edit"
154 % log after first edit
156 % log after first edit
155 o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
157 @ 6 e5ae3ca2f1ffdbd89ec41ebc273a231f7c3022f2 "d"
156 |
158 |
157 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
159 | o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
158 |
160 | |
159 @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
161 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
160 |
162 | |
163 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
164 |/
161 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
165 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
162 |
166 |
163 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
167 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
@@ -174,13 +174,13 b' just continue this time'
174
174
175 log after edit
175 log after edit
176 $ hg log --graph
176 $ hg log --graph
177 @ changeset: 6:8e082d1a72ea
177 @ changeset: 6:7efe1373e4bc
178 | tag: tip
178 | tag: tip
179 | user: test
179 | user: test
180 | date: Thu Jan 01 00:00:00 1970 +0000
180 | date: Thu Jan 01 00:00:00 1970 +0000
181 | summary: f
181 | summary: f
182 |
182 |
183 o changeset: 5:13b04d775b81
183 o changeset: 5:e334d87a1e55
184 | user: test
184 | user: test
185 | date: Thu Jan 01 00:00:00 1970 +0000
185 | date: Thu Jan 01 00:00:00 1970 +0000
186 | summary: does not commute with e
186 | summary: does not commute with e
@@ -255,13 +255,13 b' second edit also fails, but just continu'
255
255
256 post message fix
256 post message fix
257 $ hg log --graph
257 $ hg log --graph
258 @ changeset: 6:f14da722aa4b
258 @ changeset: 6:521c4c32c5e2
259 | tag: tip
259 | tag: tip
260 | user: test
260 | user: test
261 | date: Thu Jan 01 00:00:00 1970 +0000
261 | date: Thu Jan 01 00:00:00 1970 +0000
262 | summary: f
262 | summary: f
263 |
263 |
264 o changeset: 5:382ff1adf0ed
264 o changeset: 5:f4f088e8adf6
265 | user: test
265 | user: test
266 | date: Thu Jan 01 00:00:00 1970 +0000
266 | date: Thu Jan 01 00:00:00 1970 +0000
267 | summary: pick 65a9a84f33fd 3 c
267 | summary: pick 65a9a84f33fd 3 c
@@ -66,13 +66,13 b' Enable obsolete'
66 > pick 652413bf663e 5 f
66 > pick 652413bf663e 5 f
67 > EOF
67 > EOF
68 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
68 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
69 saved backup bundle to $TESTTMP/base/.hg/strip-backup/34a9919932c1-backup.hg (glob)
69 saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob)
70 $ hg log --graph --hidden
70 $ hg log --graph --hidden
71 @ 8:0efacef7cb48 f
71 @ 8:cacdfd884a93 f
72 |
72 |
73 o 7:ae467701c500 d
73 o 7:59d9f330561f d
74 |
74 |
75 o 6:d36c0562f908 c
75 o 6:b346ab9a313d c
76 |
76 |
77 | x 5:652413bf663e f
77 | x 5:652413bf663e f
78 | |
78 | |
@@ -88,10 +88,10 b' Enable obsolete'
88
88
89 $ hg debugobsolete
89 $ hg debugobsolete
90 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob)
90 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob)
91 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '* *', 'user': 'test'} (glob)
91 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 {'date': '* *', 'user': 'test'} (glob)
92 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
92 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob)
93 e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
93 e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob)
94 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '* *', 'user': 'test'} (glob)
94 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 {'date': '* *', 'user': 'test'} (glob)
95
95
96
96
97 Ensure hidden revision does not prevent histedit
97 Ensure hidden revision does not prevent histedit
@@ -100,25 +100,25 b' Ensure hidden revision does not prevent '
100 create an hidden revision
100 create an hidden revision
101
101
102 $ cat > commands.txt <<EOF
102 $ cat > commands.txt <<EOF
103 > pick d36c0562f908 6 c
103 > pick b346ab9a313d 6 c
104 > drop ae467701c500 7 d
104 > drop 59d9f330561f 7 d
105 > pick 0efacef7cb48 8 f
105 > pick cacdfd884a93 8 f
106 > EOF
106 > EOF
107 $ hg histedit 6 --commands commands.txt
107 $ hg histedit 6 --commands commands.txt
108 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
108 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ hg log --graph
110 $ hg log --graph
111 @ 9:7c044e3e33a9 f
111 @ 9:c13eb81022ca f
112 |
112 |
113 o 6:d36c0562f908 c
113 o 6:b346ab9a313d c
114 |
114 |
115 o 0:cb9a9f314b8b a
115 o 0:cb9a9f314b8b a
116
116
117 check hidden revision are ignored (6 have hidden children 7 and 8)
117 check hidden revision are ignored (6 have hidden children 7 and 8)
118
118
119 $ cat > commands.txt <<EOF
119 $ cat > commands.txt <<EOF
120 > pick d36c0562f908 6 c
120 > pick b346ab9a313d 6 c
121 > pick 7c044e3e33a9 8 f
121 > pick c13eb81022ca 8 f
122 > EOF
122 > EOF
123 $ hg histedit 6 --commands commands.txt
123 $ hg histedit 6 --commands commands.txt
124 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -130,9 +130,9 b' Check that histedit respect phases'
130 (not directly related to the test file but doesn't deserve it's own test case)
130 (not directly related to the test file but doesn't deserve it's own test case)
131
131
132 $ hg log -G
132 $ hg log -G
133 @ 9:7c044e3e33a9 f
133 @ 9:c13eb81022ca f
134 |
134 |
135 o 6:d36c0562f908 c
135 o 6:b346ab9a313d c
136 |
136 |
137 o 0:cb9a9f314b8b a
137 o 0:cb9a9f314b8b a
138
138
@@ -150,6 +150,6 b' Test that rewriting leaving instability '
150 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
150 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
151 $ hg phase --force --draft .
151 $ hg phase --force --draft .
152 $ hg log -r 'children(.)'
152 $ hg log -r 'children(.)'
153 9:7c044e3e33a9 f (no-eol)
153 9:c13eb81022ca f (no-eol)
154 $ hg histedit -r '.'
154 $ hg histedit -r '.'
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now