[Buildbot-devel] small bugfix patch in svn_buildbot.py

Luis Armendariz luis at geodynamics.org
Tue Aug 1 00:25:35 UTC 2006


Tobi Vollebregt wrote:
> Hello,
> 
> I found a little bug in svn_buildbot.py. Here is the fix (maybe better hand 
> apply, it's only one char and it's possible I modified the path to svnlook):
> 
> --- svn_buildbot.py.orig        2006-07-26 14:39:36.000000000 +0200
> +++ svn_buildbot.py     2006-07-26 14:39:51.000000000 +0200
> @@ -108,7 +108,7 @@
>          rev_arg = '-r %s' % (opts['revision'],)
>      changed = commands.getoutput('/usr/bin/svnlook changed %s "%s"' % 
> (rev_arg, repo)
>                                   ).split('\n')
> -    changed = [x[1:].strip() for x in changed]
> +    changed = [x[2:].strip() for x in changed]
>      message = commands.getoutput('/usr/bin/svnlook log %s "%s"' % (rev_arg, 
> repo))
>      who = commands.getoutput('/usr/bin/svnlook author %s "%s"' % (rev_arg, 
> repo))
>      revision = opts.get('revision')
> 
> The bug manifested itself when buildbot received updates over the listener 
> where SVN metadata (properties) where changed in addition to normal 
> modifications: then the lines returned by svnlook don't look like "U 
> filename", but like e.g. "UU filename".
> 
> Everything processing the list of changed files was confused by this: my 
> previous patch to svn_buildbot.py would always return 'trunk' as branch in 
> this case, and the lists of changed files would include the last status 
> letter too.
> 
> cheers
> Tobi Vollebregt
> 

Hi Tobi,

I noticed the same bug a couple of days ago. You can actually receive
up to three flags (and I did, before fixing it) from the
`svnlook changed' command, which is why there are four characters
before the file paths in its output. I'd probably modify your patch
to use a 4 instead of a 2 in your slice for x. That is,


--- svn_buildbot.py.orig        2006-07-26 14:39:36.000000000 +0200
+++ svn_buildbot.py     2006-07-26 14:39:51.000000000 +0200
@@ -108,7 +108,7 @@
          rev_arg = '-r %s' % (opts['revision'],)
      changed = commands.getoutput('/usr/bin/svnlook changed %s "%s"' % 
(rev_arg, repo)
                                   ).split('\n')
-    changed = [x[1:].strip() for x in changed]
+    changed = [x[4:].strip() for x in changed]
      message = commands.getoutput('/usr/bin/svnlook log %s "%s"' % 
(rev_arg,
repo))
      who = commands.getoutput('/usr/bin/svnlook author %s "%s"' % 
(rev_arg,
repo))
      revision = opts.get('revision')


-Luis




More information about the devel mailing list