mercurial/patch.py
changeset 3900 2b3175acb653
parent 3899 504dee0abeac
child 3902 0d27502a804c
child 4092 4ced663bebf0
--- 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")