# HG changeset patch # User Martin Geisler # Date 1301222515 -7200 # Node ID e5390a8b56db021b47660910532ba6b3cceb6407 # Parent 463aca32a937a6296c1a966cae9b864ca73c1dfc record: replace poor man's if-statement with real if-statement diff -r 463aca32a937 -r e5390a8b56db hgext/record.py --- a/hgext/record.py Fri Mar 25 22:59:09 2011 -0700 +++ b/hgext/record.py Sun Mar 27 12:41:55 2011 +0200 @@ -324,10 +324,12 @@ for i, chunk in enumerate(h.hunks): if skipfile is None and skipall is None: chunk.pretty(ui) - msg = (total == 1 - and (_('record this change to %r?') % chunk.filename()) - or (_('record change %d/%d to %r?') % - (pos - len(h.hunks) + i, total, chunk.filename()))) + if total == 1: + msg = _('record this change to %r?') % chunk.filename() + else: + idx = pos - len(h.hunks) + i + msg = _('record change %d/%d to %r?') % (idx, total, + chunk.filename()) r, skipfile, skipall = prompt(skipfile, skipall, msg) if r: if fixoffset: