@matheusbsbs / matheus-bagliano / commits / 4a87db0e12
Fork 0

git-svn: cleanup: move process_rm around

(it's only used in one function now) Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Jan 4, 2007 at 01:38 UTC 4a87db0e12df48408501610605bd7cde81c6d20e
1 file changed +19 -25
git-svn.perl
+19 -25
@@ -40,7 +40,6 @@ if ($SVN::Core::VERSION lt '1.1.0') {
40 }
41 push @SVN::Git::Editor::ISA, 'SVN::Delta::Editor';
42 push @SVN::Git::Fetcher::ISA, 'SVN::Delta::Editor';
43 -*SVN::Git::Fetcher::process_rm = *process_rm;
43 use Carp qw/croak/;
44 use IO::File qw//;
45 use File::Basename qw/dirname basename/;
@@ -2181,28 +2180,6 @@ sub libsvn_log_entry {
2180 revprops => $rp }
2181 }
2182
2184 -sub process_rm {
2185 - my ($gui, $last_commit, $f, $q) = @_;
2186 - # remove entire directories.
2187 - if (command('ls-tree',$last_commit,'--',$f) =~ /^040000 tree/) {
2188 - my ($ls, $ctx) = command_output_pipe(qw/ls-tree
2189 - -r --name-only -z/,
2190 - $last_commit,'--',$f);
2191 - local $/ = "\0";
2192 - while (<$ls>) {
2193 - print $gui '0 ',0 x 40,"\t",$_ or croak $!;
2194 - print "\tD\t$_\n" unless $q;
2195 - }
2196 - print "\tD\t$f/\n" unless $q;
2197 - command_close_pipe($ls, $ctx);
2198 - return $SVN::Node::dir;
2199 - } else {
2200 - print $gui '0 ',0 x 40,"\t",$f,"\0" or croak $!;
2201 - print "\tD\t$f\n" unless $q;
2202 - return $SVN::Node::file;
2203 - }
2204 -}
2205 -
2183 sub libsvn_fetch {
2184 my ($last_commit, $paths, $rev, $author, $date, $msg) = @_;
2185 my $pool = SVN::Pool->new;
@@ -2634,8 +2611,25 @@ sub open_directory {
2611
2612 sub delete_entry {
2613 my ($self, $path, $rev, $pb) = @_;
2637 - my $t = process_rm($self->{gui}, $self->{c}, $path, $self->{q});
2638 - $self->{empty}->{$path} = 0 if $t == $SVN::Node::dir;
2614 + my $gui = $self->{gui};
2615 +
2616 + # remove entire directories.
2617 + if (command('ls-tree', $self->{c}, '--', $path) =~ /^040000 tree/) {
2618 + my ($ls, $ctx) = command_output_pipe(qw/ls-tree
2619 + -r --name-only -z/,
2620 + $self->{c}, '--', $path);
2621 + local $/ = "\0";
2622 + while (<$ls>) {
2623 + print $gui '0 ',0 x 40,"\t",$_ or croak $!;
2624 + print "\tD\t$_\n" unless $self->{q};
2625 + }
2626 + print "\tD\t$path/\n" unless $self->{q};
2627 + command_close_pipe($ls, $ctx);
2628 + $self->{empty}->{$path} = 0
2629 + } else {
2630 + print $gui '0 ',0 x 40,"\t",$path,"\0" or croak $!;
2631 + print "\tD\t$path\n" unless $self->{q};
2632 + }
2633 undef;
2634 }
2635