1414use Git::SVN::Log;
1515use Git::SVN::Utils qw( fatal can_compress) ;
1616
17+ use Git qw(
18+ git_cmd_try
19+ command
20+ command_oneline
21+ command_noisy
22+ command_output_pipe
23+ command_close_pipe
24+ command_bidi_pipe
25+ command_close_bidi_pipe
26+ ) ;
27+
28+
1729# From which subdir have we been invoked?
1830my $cmd_dir_prefix = eval {
1931 command_oneline([qw/ rev-parse --show-prefix/ ], STDERR => 0)
@@ -75,24 +87,13 @@ sub _req_svn {
7587use File::Find;
7688use Getopt::Long qw/ :config gnu_getopt no_ignore_case auto_abbrev/ ;
7789use IPC::Open3;
78- use Git;
7990use Git::SVN::Editor qw/ / ;
8091use Git::SVN::Fetcher qw/ / ;
8192use Git::SVN::Ra qw/ / ;
8293use Git::SVN::Prompt qw/ / ;
8394use Memoize; # core since 5.8.0, Jul 2002
8495
8596BEGIN {
86- # import functions from Git into our packages, en masse
87- no strict ' refs' ;
88- foreach (qw/ command command_oneline command_noisy command_output_pipe
89- command_input_pipe command_close_pipe
90- command_bidi_pipe command_close_bidi_pipe/ ) {
91- for my $package ( qw( Git::SVN::Migration) ,
92- __PACKAGE__ ) {
93- *{" ${package} ::$_ " } = \&{" Git::$_ " };
94- }
95- }
9697 Memoize::memoize ' Git::config' ;
9798 Memoize::memoize ' Git::config_bool' ;
9899}
@@ -2079,7 +2080,14 @@ package Git::SVN::Migration;
20792080use Carp qw/ croak/ ;
20802081use File::Path qw/ mkpath/ ;
20812082use File::Basename qw/ dirname basename/ ;
2082- use vars qw/ $_minimize/ ;
2083+
2084+ our $_minimize;
2085+ use Git qw(
2086+ command
2087+ command_noisy
2088+ command_output_pipe
2089+ command_close_pipe
2090+ ) ;
20832091
20842092sub migrate_from_v0 {
20852093 my $git_dir = $ENV {GIT_DIR };
@@ -2188,6 +2196,7 @@ sub migrate_from_v2 {
21882196 read_old_urls(\%l_map , ' ' , " $ENV {GIT_DIR}/svn" );
21892197 my $migrated = 0;
21902198
2199+ require Git::SVN;
21912200 foreach my $ref_id (sort keys %l_map ) {
21922201 eval { Git::SVN-> init($l_map {$ref_id }, ' ' , undef , $ref_id ) };
21932202 if ($@ ) {
@@ -2199,6 +2208,9 @@ sub migrate_from_v2 {
21992208}
22002209
22012210sub minimize_connections {
2211+ require Git::SVN;
2212+ require Git::SVN::Ra;
2213+
22022214 my $r = Git::SVN::read_all_remotes();
22032215 my $new_urls = {};
22042216 my $root_repos = {};
0 commit comments