1111$VERSION = ' @@GIT_VERSION@@' ;
1212
1313use Carp qw/ croak/ ;
14- use Digest::MD5;
15- use IO::File qw/ / ;
1614use File::Basename qw/ dirname basename/ ;
1715use File::Path qw/ mkpath/ ;
1816use File::Spec;
19- use File::Find;
2017use Getopt::Long qw/ :config gnu_getopt no_ignore_case auto_abbrev/ ;
21- use IPC::Open3;
2218use Memoize;
2319
2420use Git::SVN;
@@ -298,7 +294,6 @@ sub _req_svn {
298294 {} ],
299295);
300296
301- use Term::ReadLine;
302297package FakeTerm ;
303298sub new {
304299 my ($class , $reason ) = @_ ;
@@ -313,6 +308,7 @@ package main;
313308my $term ;
314309sub term_init {
315310 $term = eval {
311+ require Term::ReadLine;
316312 $ENV {" GIT_SVN_NOTTY" }
317313 ? new Term::ReadLine ' git-svn' , \*STDIN , \*STDOUT
318314 : new Term::ReadLine ' git-svn' ;
@@ -1173,6 +1169,7 @@ sub cmd_branch {
11731169 }
11741170
11751171 ::_req_svn();
1172+ require SVN::Client;
11761173
11771174 my $ctx = SVN::Client-> new(
11781175 config => SVN::Core::config_get_config(
@@ -1693,11 +1690,13 @@ sub cmd_reset {
16931690}
16941691
16951692sub cmd_gc {
1693+ require File::Find;
16961694 if (!can_compress()) {
16971695 warn " Compress::Zlib could not be found; unhandled.log " .
16981696 " files will not be compressed.\n " ;
16991697 }
1700- find({ wanted => \&gc_directory, no_chdir => 1}, " $ENV {GIT_DIR}/svn" );
1698+ File::Find::find({ wanted => \&gc_directory, no_chdir => 1},
1699+ " $ENV {GIT_DIR}/svn" );
17011700}
17021701
17031702# ########################## utility functions #########################
@@ -2122,6 +2121,7 @@ sub find_file_type_and_diff_status {
21222121sub md5sum {
21232122 my $arg = shift ;
21242123 my $ref = ref $arg ;
2124+ require Digest::MD5;
21252125 my $md5 = Digest::MD5-> new();
21262126 if ($ref eq ' GLOB' || $ref eq ' IO::File' || $ref eq ' File::Temp' ) {
21272127 $md5 -> addfile($arg ) or croak $! ;
@@ -2148,6 +2148,7 @@ sub gc_directory {
21482148 $gz -> gzwrite($str ) or
21492149 die " Unable to write: " .$gz -> gzerror()." !\n " ;
21502150 }
2151+ no warnings ' once' ; # $File::Find::name would warn
21512152 unlink $_ or die " unlink $File::Find::name : $! \n " ;
21522153 } elsif (-f $_ && basename($_ ) eq " index" ) {
21532154 unlink $_ or die " unlink $_ : $! \n " ;
0 commit comments