Mercurial > hg
diff mercurial/patch.py @ 41759:aaad36b88298
cleanup: use () to wrap long lines instead of \
This is a little less brittle, and often helps indentation. In a
surprising number of cases the entire cleanup was deleting the \, as
the expression was *already* parenthesized in a workable way.
Differential Revision: https://phab.mercurial-scm.org/D5993
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 20 Feb 2019 19:28:51 -0500 |
parents | d4c9eebdd72d |
children | 251332dbf33d |
line wrap: on
line diff
--- a/mercurial/patch.py Sun Jan 13 20:13:22 2019 -0500 +++ b/mercurial/patch.py Wed Feb 20 19:28:51 2019 -0500 @@ -925,8 +925,8 @@ # if they have some content as we want to be able to change it nocontent = len(self.header) == 2 emptynewfile = self.isnewfile() and nocontent - return emptynewfile or \ - any(self.special_re.match(h) for h in self.header) + return (emptynewfile + or any(self.special_re.match(h) for h in self.header)) class recordhunk(object): """patch hunk @@ -2283,8 +2283,8 @@ # If the file has been removed, fctx2 is None; but this should # not occur here since we catch removed files early in # logcmdutil.getlinerangerevs() for 'hg log -L'. - assert fctx2 is not None, \ - 'fctx2 unexpectly None in diff hunks filtering' + assert fctx2 is not None, ( + 'fctx2 unexpectly None in diff hunks filtering') hunks = hunksfilterfn(fctx2, hunks) text = ''.join(sum((list(hlines) for hrange, hlines in hunks), [])) if hdr and (text or len(hdr) > 1):