[MERGE][0.16] temp file for commit message in external editor should be opened in text mode (#110901)
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue May 1 09:51:21 BST 2007
>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:
john> Alexander Belchenko wrote:
>> John Arbash Meinel ?8H5B:
>>>> John Arbash Meinel has voted -0.
>>>> Status is now: Approved
>>>> Comment:
>>>> Please wait before merging.
>>>> I don't have time to do a full review but there is some cruft in the tests.
>>>>
>>>> v-- This is really ugly, and we should find a better way to wrap the lines.
>>>>
>>>> + msgfilename, hasinfo = bzrlib.\
>>>> + msgeditor.\
>>>> + _create_temp_file_with_commit_template(
>>>> + 'infotext', '----', 'start message')
>>
>> It's for keep lines shorter than 80 chars.
>> If you say it's ugly...
>> I could use shorter variable names, and shorter name for function
>> under test.
>> And importing
>>
>> from bzrlib import msgeditor
>>
>> it's also shorten a bit.
>>
>>
>> [µ]
john> I would rather go over 80 characters.
Urgh ;-)
john> PEP8 does say "pragmatism wins".
john> I would probably do:
john> from bzrlib.msgeditor import _create_temp_file_with_commit_template
john> msgfilename, hasinfo = _create_temp_file_with_commit_template(
john> ....)
john> That is under 72 characters, since it doesn't wrap in Thunderbird.
Yeah 72 !
john> I actually prefer
john> from bzrlib import msgeditor
john> but that still gets a little long.
What about:
create = bzrlib.msgeditor._create_temp_file_with_commit_template
msgfilename, hasinfo = create('infotext', '----', 'start message')
Vincent
More information about the bazaar
mailing list