hg-fast-export.py: restore compatibility with older python
authorKyle J. McKay <mackyle@gmail.com>
Sat, 15 Mar 2014 04:06:53 +0000 (14 21:06 -0700)
committerFrej Drejhammar <frej.drejhammar@gmail.com>
Sun, 16 Mar 2014 15:00:42 +0000 (16 16:00 +0100)
Since hg runs and supports older versions of python, hg-fast-export.py
should too.  Replace dictionary comprehension with equivalent code that
supports versions of python older than 2.7.

hg-fast-export.py

index 59d225f..37ade95 100755 (executable)
@@ -278,8 +278,9 @@ def branchtip(repo, heads):
   return tip
 
 def verify_heads(ui,repo,cache,force):
-  branches={bn: branchtip(repo, heads)
-            for bn, heads in repo.branchmap().iteritems()}
+  branches={}
+  for bn, heads in repo.branchmap().iteritems():
+    branches[bn] = branchtip(repo, heads)
   l=[(-repo.changelog.rev(n), n, t) for t, n in branches.items()]
   l.sort()