diff mercurial/patch.py @ 3900:2b3175acb653

Don't use node length for calculating revision number length. Done by moving repo.lookup of revisions from commands.export to patch.export
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 15 Dec 2006 19:30:20 +0100
parents 504dee0abeac
children 0d27502a804c 4ced663bebf0
line wrap: on
line diff
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -626,7 +626,7 @@ def export(repo, revs, template='hg-%h.p
     '''export changesets as hg patches.'''
 
     total = len(revs)
-    revwidth = max(map(len, revs))
+    revwidth = max([len(str(rev)) for rev in revs])
 
     def single(node, seqno, fp):
         parents = [p for p in repo.changelog.parents(node) if p != nullid]
@@ -655,8 +655,8 @@ def export(repo, revs, template='hg-%h.p
         if fp not in (sys.stdout, repo.ui):
             fp.close()
 
-    for seqno, cset in enumerate(revs):
-        single(cset, seqno+1, fp)
+    for seqno, rev in enumerate(revs):
+        single(repo.lookup(rev), seqno+1, fp)
 
 def diffstat(patchlines):
     fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")