aboutsummaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorMartyn Smith <martyn@catalyst.net.nz>2006-03-28 13:24:27 +1200
committerMartin Langhoff <martin@catalyst.net.nz>2006-05-08 10:38:31 +1200
commit82000d74642f1c9f55ad4b0516c59d829014839a (patch)
tree1996a5b5cfe9b2a26aa047c94979b3ead2e74699 /git-cvsserver.perl
parent7d90095abe322f72820f334839afb75c23e009ff (diff)
downloadgit-82000d74642f1c9f55ad4b0516c59d829014839a.tar.gz
git-82000d74642f1c9f55ad4b0516c59d829014839a.tar.xz
Change to allow subdir updates from Eclipse
(Now you can rightclick any directory and select team-update/team-commit) and it should work
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl38
1 files changed, 27 insertions, 11 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index f3149bbc4..5ccca4f99 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -291,8 +291,7 @@ sub req_Directory
$log->debug("Prepending '$state->{prependdir}' to state|directory");
$state->{directory} = $state->{prependdir} . $state->{directory}
}
-
- $log->debug("req_Directory : localdir=$data repository=$repository directory=$state->{directory} module=$state->{module}");
+ $log->debug("req_Directory : localdir=$data repository=$repository path=$state->{path} directory=$state->{directory} module=$state->{module}");
}
# Entry entry-line \n
@@ -1705,17 +1704,34 @@ sub argsfromdir
$state->{args} = [] if ( scalar(@{$state->{args}}) == 1 and $state->{args}[0] eq "." );
- return if ( scalar ( @{$state->{args}} ) > 0 );
+ return if ( scalar ( @{$state->{args}} ) > 1 );
- $log->info("No args specified, populating file list automatically");
+ if ( scalar(@{$state->{args}}) == 1 )
+ {
+ my $arg = $state->{args}[0];
+ $arg .= $state->{prependdir} if ( defined ( $state->{prependdir} ) );
- $state->{args} = [];
+ $log->info("Only one arg specified, checking for directory expansion on '$arg'");
- foreach my $file ( @{$updater->gethead} )
- {
- next if ( $file->{filehash} eq "deleted" and not defined ( $state->{entries}{$file->{name}} ) );
- next unless ( $file->{name} =~ s/^$state->{directory}// );
- push @{$state->{args}}, $file->{name};
+ foreach my $file ( @{$updater->gethead} )
+ {
+ next if ( $file->{filehash} eq "deleted" and not defined ( $state->{entries}{$file->{name}} ) );
+ next unless ( $file->{name} =~ /^$arg\// or $file->{name} eq $arg );
+ push @{$state->{args}}, $file->{name};
+ }
+
+ shift @{$state->{args}} if ( scalar(@{$state->{args}}) > 1 );
+ } else {
+ $log->info("Only one arg specified, populating file list automatically");
+
+ $state->{args} = [];
+
+ foreach my $file ( @{$updater->gethead} )
+ {
+ next if ( $file->{filehash} eq "deleted" and not defined ( $state->{entries}{$file->{name}} ) );
+ next unless ( $file->{name} =~ s/^$state->{prependdir}// );
+ push @{$state->{args}}, $file->{name};
+ }
}
}
@@ -1816,7 +1832,7 @@ sub filecleanup
}
$filename =~ s/^\.\///g;
- $filename = $state->{directory} . $filename;
+ $filename = $state->{prependdir} . $filename;
return $filename;
}