record: replace poor man's if-statement with real if-statement
authorMartin Geisler <mg@lazybytes.net>
Sun, 27 Mar 2011 12:41:55 +0200
changeset 13773 e5390a8b56db
parent 13772 463aca32a937
child 13774 1ce0e80799c0
record: replace poor man's if-statement with real if-statement
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: