[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fixed broken parsing of property strings from svnlook's output

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Wed, 08 Oct 2008 13:49:03 -0400

Panu Outinen <panu_at_vertex.fi> writes:
> As Karl Fogel pushed here's my quick patch for the contributed
> hook-script 'enforcer' relating to the parsing problem with svn
> 1.5.x's change introduced in r27808 in svnlook's output.
>
> svn diff is against the trunk version.

Below is a slightly improved version of the patch & log message (it
conditionally recommends to the user to upgrade, see the diff). Can you
test this and let us know if it works?

Thanks,
-Karl

[[[
* contrib/hook-scripts/enforcer/enforcer: Adjust for the r27808
    svnlook output changes.

Patch by: Panu Outinen <panu_at_vertex.fi>
          me
]]]

Index: contrib/hook-scripts/enforcer/enforcer
===================================================================
--- contrib/hook-scripts/enforcer/enforcer (revision 33550)
+++ contrib/hook-scripts/enforcer/enforcer (working copy)
@@ -412,16 +412,31 @@
             continue
 
         if state is 31: # Expecting property name (follows bar)
- assert line.startswith("Name: ")
+ if not (line.startswith("Added: ") or line.startswith("Modified: ") or line.startswith("Deleted: ")):
+ error_str = "Unexpected property line: '%r'" % line
+ if line.startswith("Name: "):
+ error_str += "\n(Upgrade to Subversion 1.5 or higher " \
+ "to use this script.)"
+ raise AssertionError(error_str)
             state = 300
             # Fall through to state 300
 
         if state is 300:
- if line.startswith("Name: "):
- current_property = line[6:]
+ if line.startswith("Added: "):
+ current_property = line[7:]
                 current_verify_property_function = None
                 continue
 
+ if line.startswith("Modified: "):
+ current_property = line[10:]
+ current_verify_property_function = None
+ continue
+
+ if line.startswith("Deleted: "):
+ current_property = line[9:]
+ current_verify_property_function = None
+ continue
+
             for prefix, verify in (
                 (" - ", verify_property_line_removed),
                 (" + ", verify_property_line_added)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-08 20:20:42 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.