Skip to content

Commit e96cdba

Browse files
schwernEric Wong
authored andcommitted
Load all the modules in one place and before running code.
Just makes the code easier to follow. No functional change. Also eliminate an unused lexical $SVN. Signed-off-by: Eric Wong <normalperson@yhbt.net>
1 parent b772cb9 commit e96cdba

1 file changed

Lines changed: 21 additions & 23 deletions

File tree

git-svn.perl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,26 @@
1010
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
1111
$VERSION = '@@GIT_VERSION@@';
1212

13+
use Carp qw/croak/;
14+
use Digest::MD5;
15+
use IO::File qw//;
16+
use File::Basename qw/dirname basename/;
17+
use File::Path qw/mkpath/;
18+
use File::Spec;
19+
use File::Find;
20+
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
21+
use IPC::Open3;
22+
use Memoize;
23+
1324
use Git::SVN;
25+
use Git::SVN::Editor;
26+
use Git::SVN::Fetcher;
27+
use Git::SVN::Ra;
28+
use Git::SVN::Prompt;
1429
use Git::SVN::Log;
1530
use Git::SVN::Migration;
16-
use Git::SVN::Utils qw(fatal can_compress);
1731

32+
use Git::SVN::Utils qw(fatal can_compress);
1833
use Git qw(
1934
git_cmd_try
2035
command
@@ -26,6 +41,11 @@
2641
command_close_bidi_pipe
2742
);
2843

44+
BEGIN {
45+
Memoize::memoize 'Git::config';
46+
Memoize::memoize 'Git::config_bool';
47+
}
48+
2949

3050
# From which subdir have we been invoked?
3151
my $cmd_dir_prefix = eval {
@@ -79,28 +99,6 @@ sub _req_svn {
7999
}
80100
}
81101

82-
use Carp qw/croak/;
83-
use Digest::MD5;
84-
use IO::File qw//;
85-
use File::Basename qw/dirname basename/;
86-
use File::Path qw/mkpath/;
87-
use File::Spec;
88-
use File::Find;
89-
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
90-
use IPC::Open3;
91-
use Git::SVN::Editor qw//;
92-
use Git::SVN::Fetcher qw//;
93-
use Git::SVN::Ra qw//;
94-
use Git::SVN::Prompt qw//;
95-
use Memoize; # core since 5.8.0, Jul 2002
96-
97-
BEGIN {
98-
Memoize::memoize 'Git::config';
99-
Memoize::memoize 'Git::config_bool';
100-
}
101-
102-
my ($SVN);
103-
104102
$sha1 = qr/[a-f\d]{40}/;
105103
$sha1_short = qr/[a-f\d]{4,40}/;
106104
my ($_stdin, $_help, $_edit,

0 commit comments

Comments
 (0)