{"thread":{"id":"2323","subject":"[PATCH 2/7] Add node_kind function to differentiate between file and directory","startedAt":"2005-11-02T21:51:57Z","lastAt":"2005-11-02T21:51:57Z","messageCount":1,"participants":["Yaacov Akiba Slama"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"11038","messageId":"E1EXQWT-000508-Sz@localhost.localdomain","threadId":"2323","inReplyTo":null,"subject":"[PATCH 2/7] Add node_kind function to differentiate between file and directory","fromName":"Yaacov Akiba Slama","fromEmail":"ya@slamail.org","sentAt":"2005-11-02T21:51:57Z","receivedAt":"2005-11-02T21:51:57Z","isPatch":true,"sender":{"key":"ya@slamail.org","avatar":null},"body":"Signed-off-by: Yaacov Akiba Slama <ya@slamail.org>\n\n---\n\n git-svnimport.perl |   21 ++++++++++++++++++---\n 1 files changed, 18 insertions(+), 3 deletions(-)\n\napplies-to: e230cf653f1af6412e43f9b527465406bdb76ece\nc38f34212ace329637fd87fb11247f6a5733e47f\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 5bf9ef2..83b70f9 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -260,10 +260,17 @@ EOM\n \n open BRANCHES,\">>\", \"$git_dir/svn2git\";\n \n-sub get_file($$$) {\n-\tmy($rev,$branch,$path) = @_;\n+sub node_kind($$$) {\n+\tmy ($branch, $path, $revision) = @_;\n+\tmy $pool=SVN::Pool->new;\n+\tmy $kind = $svn->{'svn'}->check_path(revert_split_path($branch,$path),$revision,$pool);\n+\t$pool->clear;\n+\treturn $kind;\n+}\n+\n+sub revert_split_path($$) {\n+\tmy($branch,$path) = @_;\n \n-\t# revert split_path(), below\n \tmy $svnpath;\n \t$path = \"\" if $path eq \"/\"; # this should not happen, but ...\n \tif($branch eq \"/\") {\n@@ -274,6 +281,14 @@ sub get_file($$$) {\n \t\t$svnpath = \"$branch_name/$branch/$path\";\n \t}\n \n+\treturn $svnpath\n+}\n+\n+sub get_file($$$) {\n+\tmy($rev,$branch,$path) = @_;\n+\n+\tmy $svnpath = revert_split_path($branch,$path);\n+\n \t# now get it\n \tmy $name;\n \tif($opt_d) {\n---\n0.99.9.GIT\n"}]}