mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
Don't use node length for calculating revision number length.
Done by moving repo.lookup of revisions from commands.export to patch.export
This commit is contained in:
parent
f0c446ce6e
commit
a6c0381996
@ -1066,7 +1066,7 @@ def export(ui, repo, *changesets, **opts):
|
||||
ui.note(_('exporting patches:\n'))
|
||||
else:
|
||||
ui.note(_('exporting patch:\n'))
|
||||
patch.export(repo, map(repo.lookup, revs), template=opts['output'],
|
||||
patch.export(repo, revs, template=opts['output'],
|
||||
switch_parent=opts['switch_parent'],
|
||||
opts=patch.diffopts(ui, opts))
|
||||
|
||||
|
@ -626,7 +626,7 @@ def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
|
||||
'''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.patch', fp=None, switch_parent=False,
|
||||
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")
|
||||
|
@ -48,13 +48,13 @@ foo-5f17a83f5fbd.patch
|
||||
foo-f3acbafac161.patch
|
||||
# foo-%r.patch
|
||||
exporting patches:
|
||||
foo-00000000000000000002.patch
|
||||
foo-00000000000000000003.patch
|
||||
foo-00000000000000000004.patch
|
||||
foo-00000000000000000005.patch
|
||||
foo-00000000000000000006.patch
|
||||
foo-00000000000000000007.patch
|
||||
foo-00000000000000000008.patch
|
||||
foo-00000000000000000009.patch
|
||||
foo-00000000000000000010.patch
|
||||
foo-00000000000000000011.patch
|
||||
foo-02.patch
|
||||
foo-03.patch
|
||||
foo-04.patch
|
||||
foo-05.patch
|
||||
foo-06.patch
|
||||
foo-07.patch
|
||||
foo-08.patch
|
||||
foo-09.patch
|
||||
foo-10.patch
|
||||
foo-11.patch
|
||||
|
Loading…
Reference in New Issue
Block a user