changeset 86:f98d6e234cd9

util: eliminate py2.6 if/else expression
author Matt Mackall <mpm@selenic.com>
date Thu, 17 Nov 2011 12:53:41 -0600
parents bfd1c264f6cb
children 5661d5f7e39b
files hglib/util.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hglib/util.py	Thu Nov 10 17:45:57 2011 -0600
+++ b/hglib/util.py	Thu Nov 17 12:53:41 2011 -0600
@@ -81,7 +81,10 @@
 
         arg = arg.replace('_', '-')
         if arg != '-':
-            arg = '-' + arg if len(arg) == 1 else '--' + arg
+            if len(arg) == 1:
+                arg = '-' + arg
+            else:
+                arg = '--' + arg
         if isinstance(val, bool):
             if val:
                 cmd.append(arg)