You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/03/25 15:22:59 UTC
Re: svn commit: r36086 - trunk/contrib/client-side/svnmerge
This rev was asked about on IRC, for inclusion into 1.6.x. I've got no
opinion on that, but I do have a review of it...
On Mon, Feb 23, 2009 at 22:45, Paul T. Burba <pb...@collab.net> wrote:
>...
> +++ trunk/contrib/client-side/svnmerge/svnmerge.py Mon Feb 23 13:45:14 2009 (r36086)
> @@ -908,7 +908,12 @@ def set_props(dir, name, props):
> if props:
> _run_propset(dir, name, props)
> else:
> - svn_command('propdel "%s" "%s"' % (name, dir))
> + # Check if NAME exists on DIR before trying to delete it.
> + # As of 1.6 propdel no longer supports deleting a
> + # non-existent property.
> + out = launchsvn('propget "%s" "%s"' % (name, dir))
> + if (len(out) > 0):
> + svn_command('propdel "%s" "%s"' % (name, dir))
That 'if' condition is so redundant, it's not even funny :-P
if out:
svn_command(...)
No need to get the length, nor to check for greater than zero. Just
redundant stuff for Python.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1416537
Re: svn commit: r36086 - trunk/contrib/client-side/svnmerge
Posted by Paul Burba <pt...@gmail.com>.
On Wed, Mar 25, 2009 at 11:22 AM, Greg Stein <gs...@gmail.com> wrote:
> This rev was asked about on IRC, for inclusion into 1.6.x. I've got no
> opinion on that, but I do have a review of it...
>
> On Mon, Feb 23, 2009 at 22:45, Paul T. Burba <pb...@collab.net> wrote:
>>...
>> +++ trunk/contrib/client-side/svnmerge/svnmerge.py Mon Feb 23 13:45:14 2009 (r36086)
>> @@ -908,7 +908,12 @@ def set_props(dir, name, props):
>> if props:
>> _run_propset(dir, name, props)
>> else:
>> - svn_command('propdel "%s" "%s"' % (name, dir))
>> + # Check if NAME exists on DIR before trying to delete it.
>> + # As of 1.6 propdel no longer supports deleting a
>> + # non-existent property.
>> + out = launchsvn('propget "%s" "%s"' % (name, dir))
>> + if (len(out) > 0):
>> + svn_command('propdel "%s" "%s"' % (name, dir))
>
> That 'if' condition is so redundant, it's not even funny :-P
>
> if out:
> svn_command(...)
>
>
> No need to get the length, nor to check for greater than zero. Just
> redundant stuff for Python.
Yikes, thanks Greg, fixed r36767.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1416929