You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2009/11/19 21:17:05 UTC
svn commit: r882279 - /subversion/trunk/tools/dev/contribulyze.py
Author: cmpilato
Date: Thu Nov 19 20:17:05 2009
New Revision: 882279
URL: http://svn.apache.org/viewvc?rev=882279&view=rev
Log:
* tools/dev/contribulyze.py
(field_re): Expect at least one non-whitespace character after the whitespace
field separator.
(grace): Add a bit of stderr logging for when field parsing goes foul.
Modified:
subversion/trunk/tools/dev/contribulyze.py
Modified: subversion/trunk/tools/dev/contribulyze.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/contribulyze.py?rev=882279&r1=882278&r2=882279&view=diff
==============================================================================
--- subversion/trunk/tools/dev/contribulyze.py (original)
+++ subversion/trunk/tools/dev/contribulyze.py Thu Nov 19 20:17:05 2009
@@ -510,7 +510,7 @@
log_separator = '-' * 72 + '\n'
log_header_re = re.compile\
('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
-field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found) by:\s*(.*)')
+field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found) by:\s*\S.*$')
field_aliases = { 'Reviewed' : 'Review' }
parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
@@ -565,6 +565,8 @@
+ (field.alias or field.name)
+ ' by:\s+|\s+)([^\s(].*)')
m = in_field_re.match(line)
+ if m is None:
+ sys.stderr.write("Error matching: %s\n" % (line))
user, real, email = Contributor.parse(m.group(2))
if user == 'me':
user = log.committer
Re: svn commit: r882279 - /subversion/trunk/tools/dev/contribulyze.py
Posted by "C. Michael Pilato" <cm...@collab.net>.
C. Michael Pilato wrote:
> Greg Stein wrote:
>> On Thu, Nov 19, 2009 at 15:17, <cm...@apache.org> wrote:
>>> Author: cmpilato
>>> Date: Thu Nov 19 20:17:05 2009
>>> New Revision: 882279
>
> [...]
>
>>> @@ -565,6 +565,8 @@
>>> + (field.alias or field.name)
>>> + ' by:\s+|\s+)([^\s(].*)')
>>> m = in_field_re.match(line)
>>> + if m is None:
>>> + sys.stderr.write("Error matching: %s\n" % (line))
>>> user, real, email = Contributor.parse(m.group(2))
>>> if user == 'me':
>>> user = log.committer
>> How does this work? Looks like you dropped group #2 from the regex.
>
> Different regexp. m.group(2) refers to the regexp which is built from a
> string just above the context of this latter hunk.
Oh, and we never use group(2) of the field_re regexp match anywhere. Only
group(1).
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: svn commit: r882279 - /subversion/trunk/tools/dev/contribulyze.py
Posted by "C. Michael Pilato" <cm...@collab.net>.
Greg Stein wrote:
> On Thu, Nov 19, 2009 at 15:17, <cm...@apache.org> wrote:
>> Author: cmpilato
>> Date: Thu Nov 19 20:17:05 2009
>> New Revision: 882279
[...]
>> @@ -565,6 +565,8 @@
>> + (field.alias or field.name)
>> + ' by:\s+|\s+)([^\s(].*)')
>> m = in_field_re.match(line)
>> + if m is None:
>> + sys.stderr.write("Error matching: %s\n" % (line))
>> user, real, email = Contributor.parse(m.group(2))
>> if user == 'me':
>> user = log.committer
>
> How does this work? Looks like you dropped group #2 from the regex.
Different regexp. m.group(2) refers to the regexp which is built from a
string just above the context of this latter hunk.
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: svn commit: r882279 - /subversion/trunk/tools/dev/contribulyze.py
Posted by Greg Stein <gs...@gmail.com>.
On Thu, Nov 19, 2009 at 15:17, <cm...@apache.org> wrote:
> Author: cmpilato
> Date: Thu Nov 19 20:17:05 2009
> New Revision: 882279
>
> URL: http://svn.apache.org/viewvc?rev=882279&view=rev
> Log:
> * tools/dev/contribulyze.py
> (field_re): Expect at least one non-whitespace character after the whitespace
> field separator.
> (grace): Add a bit of stderr logging for when field parsing goes foul.
>
> Modified:
> subversion/trunk/tools/dev/contribulyze.py
>
> Modified: subversion/trunk/tools/dev/contribulyze.py
> URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/contribulyze.py?rev=882279&r1=882278&r2=882279&view=diff
> ==============================================================================
> --- subversion/trunk/tools/dev/contribulyze.py (original)
> +++ subversion/trunk/tools/dev/contribulyze.py Thu Nov 19 20:17:05 2009
> @@ -510,7 +510,7 @@
> log_separator = '-' * 72 + '\n'
> log_header_re = re.compile\
> ('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
> -field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found) by:\s*(.*)')
> +field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found) by:\s*\S.*$')
> field_aliases = { 'Reviewed' : 'Review' }
> parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
>
> @@ -565,6 +565,8 @@
> + (field.alias or field.name)
> + ' by:\s+|\s+)([^\s(].*)')
> m = in_field_re.match(line)
> + if m is None:
> + sys.stderr.write("Error matching: %s\n" % (line))
> user, real, email = Contributor.parse(m.group(2))
> if user == 'me':
> user = log.committer
How does this work? Looks like you dropped group #2 from the regex.
Cheers,
-g