Mercurial > public > mercurial-scm > hg
diff mercurial/minirst.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 | 876494fd967d |
children | f9cdd732cb58 |
line wrap: on
line diff
--- a/mercurial/minirst.py Sun Jan 13 20:13:22 2019 -0500 +++ b/mercurial/minirst.py Wed Feb 20 19:28:51 2019 -0500 @@ -114,9 +114,9 @@ # Partially minimized form: remove space and both # colons. blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-3] - elif len(blocks[i]['lines']) == 1 and \ - blocks[i]['lines'][0].lstrip(' ').startswith('.. ') and \ - blocks[i]['lines'][0].find(' ', 3) == -1: + elif (len(blocks[i]['lines']) == 1 and + blocks[i]['lines'][0].lstrip(' ').startswith('.. ') and + blocks[i]['lines'][0].find(' ', 3) == -1): # directive on its own line, not a literal block i += 1 continue @@ -790,8 +790,8 @@ if section['type'] != 'margin': sindent = section['indent'] if len(section['lines']) > 1: - sindent += len(section['lines'][1]) - \ - len(section['lines'][1].lstrip(' ')) + sindent += (len(section['lines'][1]) - + len(section['lines'][1].lstrip(' '))) if bindent >= sindent: break pointer += 1