##// END OF EJS Templates
revert: use "discard"/"revert" verb when reverting interactively (issue5143)...
Denis Laxalde -
r29283:14eee72c default
parent child Browse files
Show More
@@ -3301,10 +3301,12 b' def _performrevert(repo, parents, ctx, a'
3301 else:
3301 else:
3302 diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
3302 diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
3303 originalchunks = patch.parsepatch(diff)
3303 originalchunks = patch.parsepatch(diff)
3304 operation = _('discard') if node == parent else _('revert')
3304
3305
3305 try:
3306 try:
3306
3307
3307 chunks, opts = recordfilter(repo.ui, originalchunks)
3308 chunks, opts = recordfilter(repo.ui, originalchunks,
3309 operation=operation)
3308 if reversehunks:
3310 if reversehunks:
3309 chunks = patch.reversehunks(chunks)
3311 chunks = patch.reversehunks(chunks)
3310
3312
@@ -1109,11 +1109,12 b' the hunk is left unchanged.'
1109 if skipfile is None and skipall is None:
1109 if skipfile is None and skipall is None:
1110 chunk.pretty(ui)
1110 chunk.pretty(ui)
1111 if total == 1:
1111 if total == 1:
1112 msg = _("record this change to '%s'?") % chunk.filename()
1112 msg = _("%s this change to '%s'?") % (operation,
1113 chunk.filename())
1113 else:
1114 else:
1114 idx = pos - len(h.hunks) + i
1115 idx = pos - len(h.hunks) + i
1115 msg = _("record change %d/%d to '%s'?") % (idx, total,
1116 msg = _("%s change %d/%d to '%s'?") % (operation, idx, total,
1116 chunk.filename())
1117 chunk.filename())
1117 r, skipfile, skipall, newpatches = prompt(skipfile,
1118 r, skipfile, skipall, newpatches = prompt(skipfile,
1118 skipall, msg, chunk)
1119 skipall, msg, chunk)
1119 if r:
1120 if r:
@@ -64,7 +64,7 b' 10 run the same test than 8 from within '
64 3
64 3
65 4
65 4
66 5
66 5
67 record change 1/6 to 'f'? [Ynesfdaq?] y
67 revert change 1/6 to 'f'? [Ynesfdaq?] y
68
68
69 @@ -1,5 +2,6 @@
69 @@ -1,5 +2,6 @@
70 1
70 1
@@ -73,7 +73,7 b' 10 run the same test than 8 from within '
73 4
73 4
74 5
74 5
75 +b
75 +b
76 record change 2/6 to 'f'? [Ynesfdaq?] y
76 revert change 2/6 to 'f'? [Ynesfdaq?] y
77
77
78 diff --git a/folder1/g b/folder1/g
78 diff --git a/folder1/g b/folder1/g
79 2 hunks, 2 lines changed
79 2 hunks, 2 lines changed
@@ -86,7 +86,7 b' 10 run the same test than 8 from within '
86 3
86 3
87 4
87 4
88 5
88 5
89 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
89 revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y
90
90
91 @@ -1,5 +2,6 @@
91 @@ -1,5 +2,6 @@
92 1
92 1
@@ -95,7 +95,7 b' 10 run the same test than 8 from within '
95 4
95 4
96 5
96 5
97 +d
97 +d
98 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
98 revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n
99
99
100 diff --git a/folder2/h b/folder2/h
100 diff --git a/folder2/h b/folder2/h
101 2 hunks, 2 lines changed
101 2 hunks, 2 lines changed
@@ -163,7 +163,7 b' Test that --interactive lift the need fo'
163 3
163 3
164 4
164 4
165 5
165 5
166 record change 1/6 to 'f'? [Ynesfdaq?] y
166 revert change 1/6 to 'f'? [Ynesfdaq?] y
167
167
168 @@ -1,5 +2,6 @@
168 @@ -1,5 +2,6 @@
169 1
169 1
@@ -172,7 +172,7 b' Test that --interactive lift the need fo'
172 4
172 4
173 5
173 5
174 +b
174 +b
175 record change 2/6 to 'f'? [Ynesfdaq?] y
175 revert change 2/6 to 'f'? [Ynesfdaq?] y
176
176
177 diff --git a/folder1/g b/folder1/g
177 diff --git a/folder1/g b/folder1/g
178 2 hunks, 2 lines changed
178 2 hunks, 2 lines changed
@@ -185,7 +185,7 b' Test that --interactive lift the need fo'
185 3
185 3
186 4
186 4
187 5
187 5
188 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
188 revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y
189
189
190 @@ -1,5 +2,6 @@
190 @@ -1,5 +2,6 @@
191 1
191 1
@@ -194,7 +194,7 b' Test that --interactive lift the need fo'
194 4
194 4
195 5
195 5
196 +d
196 +d
197 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
197 revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n
198
198
199 diff --git a/folder2/h b/folder2/h
199 diff --git a/folder2/h b/folder2/h
200 2 hunks, 2 lines changed
200 2 hunks, 2 lines changed
@@ -242,7 +242,7 b' Test that --interactive lift the need fo'
242 3
242 3
243 4
243 4
244 5
244 5
245 record change 1/2 to 'f'? [Ynesfdaq?] y
245 discard change 1/2 to 'f'? [Ynesfdaq?] y
246
246
247 @@ -2,6 +1,5 @@
247 @@ -2,6 +1,5 @@
248 1
248 1
@@ -251,7 +251,7 b' Test that --interactive lift the need fo'
251 4
251 4
252 5
252 5
253 -b
253 -b
254 record change 2/2 to 'f'? [Ynesfdaq?] n
254 discard change 2/2 to 'f'? [Ynesfdaq?] n
255
255
256 $ hg st
256 $ hg st
257 M f
257 M f
@@ -303,7 +303,7 b' 3) Use interactive revert with editing ('
303 -1
303 -1
304 +0
304 +0
305 +2
305 +2
306 record this change to 'k'? [Ynesfdaq?] e
306 discard this change to 'k'? [Ynesfdaq?] e
307
307
308 $ cat k
308 $ cat k
309 42
309 42
@@ -350,7 +350,7 b' Check the experimental config to invert '
350 1
350 1
351 2
351 2
352 3
352 3
353 record change 1/3 to 'folder1/g'? [Ynesfdaq?] y
353 discard change 1/3 to 'folder1/g'? [Ynesfdaq?] y
354
354
355 @@ -2,7 +1,7 @@
355 @@ -2,7 +1,7 @@
356 c
356 c
@@ -361,13 +361,13 b' Check the experimental config to invert '
361 +4
361 +4
362 5
362 5
363 d
363 d
364 record change 2/3 to 'folder1/g'? [Ynesfdaq?] y
364 discard change 2/3 to 'folder1/g'? [Ynesfdaq?] y
365
365
366 @@ -7,3 +6,2 @@
366 @@ -7,3 +6,2 @@
367 5
367 5
368 d
368 d
369 -lastline
369 -lastline
370 record change 3/3 to 'folder1/g'? [Ynesfdaq?] n
370 discard change 3/3 to 'folder1/g'? [Ynesfdaq?] n
371
371
372 $ hg diff --nodates
372 $ hg diff --nodates
373 diff -r a3d963a027aa folder1/g
373 diff -r a3d963a027aa folder1/g
General Comments 0
You need to be logged in to leave comments. Login now