Add node_kind function to differentiate between file and directory
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Yaacov Akiba Slama committed
Nov 2, 2005 at 23:51 UTC
cbce5d8961f7790a621f7cee6ecb2c25ae372867
1 file changed
+18
-3
git-svnimport.perl
+18
-3
@@ -260,10 +260,17 @@ EOM
260
261
open BRANCHES,">>", "$git_dir/svn2git";
262
263
-sub get_file($$$) {
264
- my($rev,$branch,$path) = @_;
263
+sub node_kind($$$) {
264
+ my ($branch, $path, $revision) = @_;
265
+ my $pool=SVN::Pool->new;
266
+ my $kind = $svn->{'svn'}->check_path(revert_split_path($branch,$path),$revision,$pool);
267
+ $pool->clear;
268
+ return $kind;
269
+}
270
+
271
+sub revert_split_path($$) {
272
+ my($branch,$path) = @_;
273
266
- # revert split_path(), below
274
my $svnpath;
275
$path = "" if $path eq "/"; # this should not happen, but ...
276
if($branch eq "/") {
@@ -274,6 +281,14 @@ sub get_file($$$) {
281
$svnpath = "$branch_name/$branch/$path";
282
}
283
284
+ return $svnpath
285
+}
286
+
287
+sub get_file($$$) {
288
+ my($rev,$branch,$path) = @_;
289
+
290
+ my $svnpath = revert_split_path($branch,$path);
291
+
292
# now get it
293
my $name;
294
if($opt_d) {