From 72f0e766aa2722603576bc493636de9a8a2c873f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Love=20H=F6rnquist=20=C5strand?= Date: Fri, 6 Feb 2009 19:33:23 -0800 Subject: [PATCH] Make easier to add more props, don't be rude to svn info - Add function to add more props(). - Don't close the pipe on "svn info" Feedback from Dennis McRichie. --- git2svn | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/git2svn b/git2svn index 91daeec..18123a1 100755 --- a/git2svn +++ b/git2svn @@ -80,9 +80,8 @@ sub parse_svn_tree open(SVN, "svn info $url|") or die "failed to open svn info $url"; while () { chomp; - if (/^Revision: (\d+)/) { + if ($revision eq 1 && /^Revision: (\d+)/) { $revision = $1 + 1; - last; } } close SVN; @@ -169,6 +168,19 @@ sub next_line return $next; } +# +# This is to allow setting props for a path, XXX add configuration +# file/options for this. +# + +sub auto_props +{ + my $path = shift; + ### given path, return prop("prop", "value") + return ""; +} + + $|= 1; my $result; @@ -323,6 +335,7 @@ COMMAND: while (!eof(IN)) { $props = ""; $props .= prop("svn:executable", "on") if ($mode & 0111); $props .= prop("svn:special", "*") if ($kind eq "symlink"); + $props .= auto_props($path); $props .= "PROPS-END" if ($props ne ""); $content = "link $content" if ($kind eq "symlink"); -- 2.11.4.GIT