##// END OF EJS Templates
phabricator: pass ui instead of repo to `readpatch()`...
Matt Harbison -
r44905:41217dfa default
parent child Browse files
Show More
@@ -1609,7 +1609,7 b' def getdiffmeta(diff):'
1609 1609 return meta
1610 1610
1611 1611
1612 def readpatch(repo, drevs, write):
1612 def readpatch(ui, drevs, write):
1613 1613 """generate plain-text patch readable by 'hg import'
1614 1614
1615 1615 write is usually ui.write. drevs is what "querydrev" returns, results of
@@ -1617,16 +1617,14 b' def readpatch(repo, drevs, write):'
1617 1617 """
1618 1618 # Prefetch hg:meta property for all diffs
1619 1619 diffids = sorted(set(max(int(v) for v in drev[b'diffs']) for drev in drevs))
1620 diffs = callconduit(repo.ui, b'differential.querydiffs', {b'ids': diffids})
1620 diffs = callconduit(ui, b'differential.querydiffs', {b'ids': diffids})
1621 1621
1622 1622 # Generate patch for each drev
1623 1623 for drev in drevs:
1624 repo.ui.note(_(b'reading D%s\n') % drev[b'id'])
1624 ui.note(_(b'reading D%s\n') % drev[b'id'])
1625 1625
1626 1626 diffid = max(int(v) for v in drev[b'diffs'])
1627 body = callconduit(
1628 repo.ui, b'differential.getrawdiff', {b'diffID': diffid}
1629 )
1627 body = callconduit(ui, b'differential.getrawdiff', {b'diffID': diffid})
1630 1628 desc = getdescfromdrev(drev)
1631 1629 header = b'# HG changeset patch\n'
1632 1630
@@ -1671,7 +1669,7 b' def phabread(ui, repo, spec, **opts):'
1671 1669 if opts.get(b'stack'):
1672 1670 spec = b':(%s)' % spec
1673 1671 drevs = querydrev(repo, spec)
1674 readpatch(repo, drevs, ui.write)
1672 readpatch(repo.ui, drevs, ui.write)
1675 1673
1676 1674
1677 1675 @vcrcommand(
General Comments 0
You need to be logged in to leave comments. Login now