[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: Wilfredo Sánchez Vega <wsanchez_at_apple.com>
Date: Wed, 8 Oct 2008 14:56:22 -0700

On Oct 8, 2008, at 2:34 PM, Wilfredo Sánchez Vega wrote:

> Is there a reason why we don't want to leave the Name: case in
> there for older versions rather than requiring an upgrade to 1.5? I
> guess this is a server-side thing, so it's not a big deal, but it
> seems easy to keep compatibility in place there.

   The patch below should work on both 1.5 and pre-1.5.

        -wsv

Index: contrib/hook-scripts/enforcer/enforcer
===================================================================
--- contrib/hook-scripts/enforcer/enforcer (revision 33559)
+++ contrib/hook-scripts/enforcer/enforcer (working copy)
@@ -412,15 +412,27 @@
              continue

          if state is 31: # Expecting property name (follows bar)
- assert line.startswith("Name: ")
+ for label in (
+ "Name", # svn versions < 1.5
+ "Added", "Modified", "Deleted" # svn versions >= 1.5
+ ):
+ if line.startswith(label + " :"):
+ break
+ else:
+ raise AssertionError("Unexpected property name line:
%r" % line)
+
              state = 300
              # Fall through to state 300

          if state is 300:
- if line.startswith("Name: "):
- current_property = line[6:]
- current_verify_property_function = None
- continue
+ for label in (
+ "Name", # svn versions < 1.5
+ "Added", "Modified", "Deleted" # svn versions >= 1.5
+ ):
+ if line.startswith(label + ": "):
+ current_property = line[len(label)+2:]
+ current_verify_property_function = None
+ continue

              for prefix, verify in (
                  (" - ", verify_property_line_removed),

---------------------------------------------------------------------
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 23:56:34 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.