Mercurial > hg
diff hgext/record.py @ 7910:14ec64d41dad
record: Give user a hint about chunk selection progress
It greatly improves usability when one roughly knows where
the chunks of interest are.
author | Rocco Rutte <pdmef@gmx.net> |
---|---|
date | Sat, 28 Mar 2009 23:09:36 +0100 |
parents | ab00d2c281a8 |
children | 0b2561b53069 |
line wrap: on
line diff
--- a/hgext/record.py Sat Mar 28 22:22:22 2009 +0100 +++ b/hgext/record.py Sat Mar 28 23:09:36 2009 +0100 @@ -302,6 +302,7 @@ elif r == _('q'): raise util.Abort(_('user quit')) return r + pos, total = 0, len(chunks) - 1 while chunks: chunk = chunks.pop() if isinstance(chunk, header): @@ -327,8 +328,10 @@ # new hunk if resp_file[0] is None and resp_all[0] is None: chunk.pretty(ui) - r = prompt(_('record this change to %r?') % - chunk.filename()) + r = total == 1 and prompt(_('record this change to %r?') % + chunk.filename()) or \ + prompt(_('record change %d/%d to %r?') % + (pos, total, chunk.filename())) if r == _('y'): if fixoffset: chunk = copy.copy(chunk) @@ -336,6 +339,7 @@ applied[chunk.filename()].append(chunk) else: fixoffset += chunk.removed - chunk.added + pos = pos + 1 return reduce(operator.add, [h for h in applied.itervalues() if h[0].special() or len(h) > 1], [])