Make path format output switches more compact
authorChristian Ebert <blacktrash@gmx.net>
Sun, 02 Dec 2007 08:15:36 +0100
changeset 309 a5f5bbf4a668
parent 308 2a20fa267041
child 310 574128f982a2
Make path format output switches more compact
hgkw/keyword.py
--- a/hgkw/keyword.py	Sun Dec 02 08:00:31 2007 +0100
+++ b/hgkw/keyword.py	Sun Dec 02 08:15:36 2007 +0100
@@ -326,8 +326,8 @@
     ui.note(_('unhooked all commit hooks\n'))
     ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
     repo.commit(text=msg)
-    pathinfo = ('', ' in %s' % path)[ui.verbose]
-    demostatus('%s keywords expanded%s' % (kwstatus, pathinfo))
+    format = ui.verbose and ' in %s' % path or ''
+    demostatus('%s keywords expanded%s' % (kwstatus, format))
     ui.write(repo.wread(fn))
     ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
     shutil.rmtree(tmpdir, ignore_errors=True)
@@ -368,10 +368,7 @@
     if allf or ignore:
         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
     for char, filenames in kwfstats:
-        if allf or ui.verbose:
-            format = '%s %%s\n' % char
-        else:
-            format = '%s\n'
+        format = (allf or ui.verbose) and '%s %%s\n' % char or '%s\n'
         for f in filenames:
             ui.write(format % repo.pathto(f, cwd))