[PATCH] svn subrepo: abort only on nonzero process exit code, no longer assuming warnings are errors (issue2833)
Regis Desgroppes
regis.desgroppes at nokia.com
Fri May 27 02:19:11 CDT 2011
On 05/26/2011 08:13 PM, ext Matt Mackall wrote:
> On Thu, 2011-05-26 at 11:51 -0500, Augie Fackler wrote:
>> On May 26, 2011, at 8:21 AM, Desgroppes Regis (Nokia-MS/Berlin) wrote:
>>
>>> svn subrepo: abort only on nonzero process exit code, no longer assuming
>>> warnings are errors (issue2833)
>>>
>>> In subrepo.py, when svn writes something to its error output stream, the
>>> command is considered as failed.
>>> This is a wrong assumption, as svn may write simple warnings as well (as
>>> seen when accessing KWallet, a keyring for KDE).
>>> The process exit code should be considered instead, as proposed in the
>>> below patch.
>>> Could you please consider applying it? Feel free to rewrite as well.
>>> Thanks,
>>> Régis
>>>
>>> # HG changeset patch
>>> # User desgropp<regis.desgroppes at nokia.com>
>>> # Date 1306401763 -7200
>>> # Node ID 6d174e1bce47614b09f7e3fe3b9ccdd2d0bc9044
>>> # Parent c864f5e743efefeb667c6f8ffa659a8572047059
>>> svn subrepo: abort only on nonzero process exit code, no longer assuming
>>> warnings are errors (issue2833)
>>>
>>> diff -r c864f5e743ef -r 6d174e1bce47 mercurial/subrepo.py
>>> --- a/mercurial/subrepo.py Tue May 24 17:30:00 2011 -0500
>>> +++ b/mercurial/subrepo.py Thu May 26 11:22:43 2011 +0200
>>> @@ -548,8 +548,10 @@
>>> universal_newlines=True, env=env)
>>> stdout, stderr = p.communicate()
>>> stderr = stderr.strip()
>>> - if stderr:
>>> - raise util.Abort(stderr)
>>> + if p.returncode:
>>> + raise util.Abort(stderr or 'exited with code %d' % p.returncode)
>>> + if stderr:
> Typo?
Yes: fixed here. Probably hit the 'E' key at mail composition time (my
outgoing patch was OK). Next time, I'll use patchbomb, period.
By the way, I replaced double quotes by single ones, as surrounding code
does (while PEP-8 keeps agnostic on the matter).
>>> + self._ui.warn(stderr + '\n')
>> I think you should print stderr as warnings before aborting.
>>
>> Other than that, this looks and sounds reasonable and correct to me.
>>
>>> return stdout
>>>
>>> @propertycache
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel at selenic.com
>>> http://selenic.com/mailman/listinfo/mercurial-devel
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel
>
More information about the Mercurial-devel
mailing list