contrib/synthrepo.py
changeset 24306 6ddc86eedc3b
parent 23778 a5dbec255f14
child 25186 80c5b2666a96
--- a/contrib/synthrepo.py	Fri Mar 13 14:20:13 2015 -0400
+++ b/contrib/synthrepo.py	Fri Mar 13 17:00:06 2015 -0400
@@ -359,7 +359,10 @@
                             files.iterkeys(), filectxfn, ui.username(),
                             '%d %d' % util.makedate())
         initnode = mc.commit()
-        hexfn = ui.debugflag and hex or short
+        if ui.debugflag:
+            hexfn = hex
+        else:
+            hexfn = short
         ui.status(_('added commit %s with %d files\n')
                   % (hexfn(initnode), len(files)))
 
@@ -475,7 +478,10 @@
         if dirpath in replacements:
             return replacements[dirpath]
         head, _ = os.path.split(dirpath)
-        head = head and rename(head) or ''
+        if head:
+            head = rename(head)
+        else:
+            head = ''
         renamed = os.path.join(head, wordgen.next())
         replacements[dirpath] = renamed
         return renamed