##// END OF EJS Templates
fix: pass line ranges as value instead of callback...
Danny Hooper -
r43003:e9f50307 default
parent child Browse files
Show More
@@ -563,8 +563,8 b' def fixfile(ui, repo, opts, fixers, fixc'
563 563 newdata = fixctx[path].data()
564 564 for fixername, fixer in fixers.iteritems():
565 565 if fixer.affects(opts, fixctx, path):
566 rangesfn = lambda: lineranges(opts, path, basectxs, fixctx, newdata)
567 command = fixer.command(ui, path, rangesfn)
566 ranges = lineranges(opts, path, basectxs, fixctx, newdata)
567 command = fixer.command(ui, path, ranges)
568 568 if command is None:
569 569 continue
570 570 ui.debug('subprocess: %s\n' % (command,))
@@ -758,7 +758,7 b' class Fixer(object):'
758 758 """Should the stdout of this fixer start with JSON and a null byte?"""
759 759 return self._metadata
760 760
761 def command(self, ui, path, rangesfn):
761 def command(self, ui, path, ranges):
762 762 """A shell command to use to invoke this fixer on the given file/lines
763 763
764 764 May return None if there is no appropriate command to run for the given
@@ -768,7 +768,6 b' class Fixer(object):'
768 768 parts = [expand(ui, self._command,
769 769 {'rootpath': path, 'basename': os.path.basename(path)})]
770 770 if self._linerange:
771 ranges = rangesfn()
772 771 if self._skipclean and not ranges:
773 772 # No line ranges to fix, so don't run the fixer.
774 773 return None
General Comments 0
You need to be logged in to leave comments. Login now