##// END OF EJS Templates
record: Give user a hint about chunk selection progress...
Rocco Rutte -
r7910:14ec64d4 default
parent child Browse files
Show More
@@ -302,6 +302,7 b' def filterpatch(ui, chunks):'
302 elif r == _('q'):
302 elif r == _('q'):
303 raise util.Abort(_('user quit'))
303 raise util.Abort(_('user quit'))
304 return r
304 return r
305 pos, total = 0, len(chunks) - 1
305 while chunks:
306 while chunks:
306 chunk = chunks.pop()
307 chunk = chunks.pop()
307 if isinstance(chunk, header):
308 if isinstance(chunk, header):
@@ -327,8 +328,10 b' def filterpatch(ui, chunks):'
327 # new hunk
328 # new hunk
328 if resp_file[0] is None and resp_all[0] is None:
329 if resp_file[0] is None and resp_all[0] is None:
329 chunk.pretty(ui)
330 chunk.pretty(ui)
330 r = prompt(_('record this change to %r?') %
331 r = total == 1 and prompt(_('record this change to %r?') %
331 chunk.filename())
332 chunk.filename()) or \
333 prompt(_('record change %d/%d to %r?') %
334 (pos, total, chunk.filename()))
332 if r == _('y'):
335 if r == _('y'):
333 if fixoffset:
336 if fixoffset:
334 chunk = copy.copy(chunk)
337 chunk = copy.copy(chunk)
@@ -336,6 +339,7 b' def filterpatch(ui, chunks):'
336 applied[chunk.filename()].append(chunk)
339 applied[chunk.filename()].append(chunk)
337 else:
340 else:
338 fixoffset += chunk.removed - chunk.added
341 fixoffset += chunk.removed - chunk.added
342 pos = pos + 1
339 return reduce(operator.add, [h for h in applied.itervalues()
343 return reduce(operator.add, [h for h in applied.itervalues()
340 if h[0].special() or len(h) > 1], [])
344 if h[0].special() or len(h) > 1], [])
341
345
@@ -84,12 +84,12 b" examine changes to '1.txt'? [Ynsfdaq?] "
84 -2
84 -2
85 +2 2
85 +2 2
86 3
86 3
87 record this change to '1.txt'? [Ynsfdaq?] @@ -3,3 +3,3 @@
87 record change 1/6 to '1.txt'? [Ynsfdaq?] @@ -3,3 +3,3 @@
88 3
88 3
89 -4
89 -4
90 +4 4
90 +4 4
91 5
91 5
92 record this change to '1.txt'? [Ynsfdaq?] diff --git a/2.txt b/2.txt
92 record change 2/6 to '1.txt'? [Ynsfdaq?] diff --git a/2.txt b/2.txt
93 1 hunks, 2 lines changed
93 1 hunks, 2 lines changed
94 examine changes to '2.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
94 examine changes to '2.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
95 a
95 a
@@ -98,7 +98,7 b" examine changes to '2.txt'? [Ynsfdaq?] "
98 c
98 c
99 d
99 d
100 e
100 e
101 record this change to '2.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
101 record change 4/6 to '2.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
102 1 hunks, 2 lines changed
102 1 hunks, 2 lines changed
103 examine changes to 'dir/a.txt'? [Ynsfdaq?]
103 examine changes to 'dir/a.txt'? [Ynsfdaq?]
104 % after qrecord a.patch 'tip'
104 % after qrecord a.patch 'tip'
@@ -163,7 +163,7 b" examine changes to '1.txt'? [Ynsfdaq?] "
163 -4
163 -4
164 +4 4
164 +4 4
165 5
165 5
166 record this change to '1.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
166 record change 1/3 to '1.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
167 1 hunks, 2 lines changed
167 1 hunks, 2 lines changed
168 examine changes to 'dir/a.txt'? [Ynsfdaq?] @@ -1,4 +1,4 @@
168 examine changes to 'dir/a.txt'? [Ynsfdaq?] @@ -1,4 +1,4 @@
169 -hello world
169 -hello world
@@ -171,7 +171,7 b" examine changes to 'dir/a.txt'? [Ynsfdaq"
171
171
172 someone
172 someone
173 up
173 up
174 record this change to 'dir/a.txt'? [Ynsfdaq?]
174 record change 3/3 to 'dir/a.txt'? [Ynsfdaq?]
175 % after qrecord b.patch 'tip'
175 % after qrecord b.patch 'tip'
176 changeset: 2:b056198bf878
176 changeset: 2:b056198bf878
177 tag: qtip
177 tag: qtip
@@ -215,13 +215,13 b" examine changes to 'plain'? [Ynsfdaq?] "
215 2
215 2
216 3
216 3
217 4
217 4
218 record this change to 'plain'? [Ynsfdaq?] @@ -8,5 +8,3 @@
218 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -8,5 +8,3 @@
219 8
219 8
220 9
220 9
221 10
221 10
222 -11
222 -11
223 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
223 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
224 record this change to 'plain'? [Ynsfdaq?]
224 record change 2/2 to 'plain'? [Ynsfdaq?]
225 changeset: 11:d09ab1967dab
225 changeset: 11:d09ab1967dab
226 tag: tip
226 tag: tip
227 user: test
227 user: test
@@ -258,7 +258,7 b" examine changes to 'plain'? [Ynsfdaq?] "
258 7
258 7
259 8
259 8
260 9
260 9
261 record this change to 'plain'? [Ynsfdaq?] @@ -4,7 +1,7 @@
261 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -4,7 +1,7 @@
262 4
262 4
263 5
263 5
264 6
264 6
@@ -267,7 +267,7 b" record this change to 'plain'? [Ynsfdaq?"
267 9
267 9
268 -10
268 -10
269 +10.new
269 +10.new
270 record this change to 'plain'? [Ynsfdaq?]
270 record change 2/2 to 'plain'? [Ynsfdaq?]
271 changeset: 12:44516c9708ae
271 changeset: 12:44516c9708ae
272 tag: tip
272 tag: tip
273 user: test
273 user: test
@@ -326,7 +326,7 b" examine changes to 'plain'? [Ynsfdaq?] "
326 7
326 7
327 8
327 8
328 9
328 9
329 record this change to 'plain'? [Ynsfdaq?] @@ -1,7 +4,6 @@
329 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -1,7 +4,6 @@
330 4
330 4
331 5
331 5
332 6
332 6
@@ -334,7 +334,7 b" record this change to 'plain'? [Ynsfdaq?"
334 8
334 8
335 9
335 9
336 -10.new
336 -10.new
337 record this change to 'plain'? [Ynsfdaq?] % add to beginning, middle, end
337 record change 2/2 to 'plain'? [Ynsfdaq?] % add to beginning, middle, end
338 % record beginning, middle
338 % record beginning, middle
339 diff --git a/plain b/plain
339 diff --git a/plain b/plain
340 3 hunks, 7 lines changed
340 3 hunks, 7 lines changed
@@ -344,7 +344,7 b" examine changes to 'plain'? [Ynsfdaq?] "
344 +3
344 +3
345 4
345 4
346 5
346 5
347 record this change to 'plain'? [Ynsfdaq?] @@ -1,6 +4,8 @@
347 record change 1/3 to 'plain'? [Ynsfdaq?] @@ -1,6 +4,8 @@
348 4
348 4
349 5
349 5
350 +5.new
350 +5.new
@@ -353,14 +353,14 b" record this change to 'plain'? [Ynsfdaq?"
353 7
353 7
354 8
354 8
355 9
355 9
356 record this change to 'plain'? [Ynsfdaq?] @@ -3,4 +8,6 @@
356 record change 2/3 to 'plain'? [Ynsfdaq?] @@ -3,4 +8,6 @@
357 6
357 6
358 7
358 7
359 8
359 8
360 9
360 9
361 +10
361 +10
362 +11
362 +11
363 record this change to 'plain'? [Ynsfdaq?]
363 record change 3/3 to 'plain'? [Ynsfdaq?]
364 changeset: 15:c1c639d8b268
364 changeset: 15:c1c639d8b268
365 tag: tip
365 tag: tip
366 user: test
366 user: test
General Comments 0
You need to be logged in to leave comments. Login now