comparison hgext/mq.py @ 44823:3b7aabd02e11

cleanup: avoid extra node/ctx conversions in logcmdutil.diffordiffstat I'm about to write some code that wants to pass a memctx to diffordiffstat, but this feels like a meritorious cleanup anyway, since the first thing this method does is turn nodes into contexts, and most callers have a context handy. Differential Revision: https://phab.mercurial-scm.org/D8502
author Augie Fackler <augie@google.com>
date Thu, 07 May 2020 16:54:17 -0400
parents 9d2b2df2c2ba
children 8c466bcb0879
comparison
equal deleted inserted replaced
44822:118f067f6bd1 44823:3b7aabd02e11
834 if opts is None: 834 if opts is None:
835 opts = {} 835 opts = {}
836 stat = opts.get(b'stat') 836 stat = opts.get(b'stat')
837 m = scmutil.match(repo[node1], files, opts) 837 m = scmutil.match(repo[node1], files, opts)
838 logcmdutil.diffordiffstat( 838 logcmdutil.diffordiffstat(
839 self.ui, repo, diffopts, node1, node2, m, changes, stat, fp 839 self.ui,
840 repo,
841 diffopts,
842 repo[node1],
843 repo[node2],
844 m,
845 changes,
846 stat,
847 fp,
840 ) 848 )
841 849
842 def mergeone(self, repo, mergeq, head, patch, rev, diffopts): 850 def mergeone(self, repo, mergeq, head, patch, rev, diffopts):
843 # first try just applying the patch 851 # first try just applying the patch
844 (err, n) = self.apply( 852 (err, n) = self.apply(