##// END OF EJS Templates
phabricator: change "readpatch" to be more flexible...
Jun Wu -
r33830:75fdaf85 default
parent child Browse files
Show More
@@ -635,15 +635,12 b' def getdiffmeta(diff):'
635 meta[r'parent'] = commit[r'parents'][0]
635 meta[r'parent'] = commit[r'parents'][0]
636 return meta or {}
636 return meta or {}
637
637
638 def readpatch(repo, params, write, stack=False):
638 def readpatch(repo, drevs, write):
639 """generate plain-text patch readable by 'hg import'
639 """generate plain-text patch readable by 'hg import'
640
640
641 write is usually ui.write. params is passed to "differential.query". If
641 write is usually ui.write. drevs is what "querydrev" returns, results of
642 stack is True, also write dependent patches.
642 "differential.query".
643 """
643 """
644 # Differential Revisions
645 drevs = querydrev(repo, params, stack)
646
647 # Prefetch hg:meta property for all diffs
644 # Prefetch hg:meta property for all diffs
648 diffids = sorted(set(max(int(v) for v in drev[r'diffs']) for drev in drevs))
645 diffids = sorted(set(max(int(v) for v in drev[r'diffs']) for drev in drevs))
649 diffs = callconduit(repo, 'differential.querydiffs', {'ids': diffids})
646 diffs = callconduit(repo, 'differential.querydiffs', {'ids': diffids})
@@ -683,4 +680,5 b' def phabread(ui, repo, revid, **opts):'
683 revid = int(revid.split('/')[-1].replace('D', ''))
680 revid = int(revid.split('/')[-1].replace('D', ''))
684 except ValueError:
681 except ValueError:
685 raise error.Abort(_('invalid Revision ID: %s') % revid)
682 raise error.Abort(_('invalid Revision ID: %s') % revid)
686 readpatch(repo, {'ids': [revid]}, ui.write, opts.get('stack'))
683 drevs = querydrev(repo, {'ids': [revid]}, opts.get('stack'))
684 readpatch(repo, drevs, ui.write)
General Comments 0
You need to be logged in to leave comments. Login now