[PATCH 05 of 12 topics] flake8: fix W503 style

Sean Farley sean at farley.io
Wed Aug 31 13:23:47 EDT 2016


Augie Fackler <raf at durin42.com> writes:

> On Tue, Aug 30, 2016 at 08:58:11PM -0700, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean at farley.io>
>> # Date 1472595240 25200
>> #      Tue Aug 30 15:14:00 2016 -0700
>> # Node ID 752a62b50ba31b768c52c6b423cd1a36d0c6eae2
>> # Parent  8f1e18702ba107ffcb35be04dc8a1e650e5c1e7f
>> # EXP-Topic flake8
>> flake8: fix W503 style
>>
>> diff --git a/hgext3rd/topic/destination.py b/hgext3rd/topic/destination.py
>> --- a/hgext3rd/topic/destination.py
>> +++ b/hgext3rd/topic/destination.py
>> @@ -72,12 +72,12 @@ def _destupdatetopic(repo, clean, check)
>>      if bookmarks.isactivewdirparent(repo):
>>          movemark = repo['.'].node()
>>      return node, movemark, None
>>
>>  def desthistedit(orig, ui, repo):
>> -    if not (ui.config('histedit', 'defaultrev', None) is None
>> -            and repo.currenttopic):
>> +    if not (ui.config('histedit', 'defaultrev', None) is None and
>> +            repo.currenttopic):
>
> I know I intentionally put the binary operator at the start of the subsequent line because then it's less ambiguous when visually parsing, eg:
>
> if (foo
>     and bar):
>     baz
>
> leaves it more visually obvious where the body of the if statement begins than
>
> if (foo and
>     bar):
>     baz
>
> I'm not sure how others feel.

I could take or leave this one.


More information about the Mercurial-devel mailing list