提交 336f1714 编写于 作者: E Eric Wong

git-svn: cleanup: avoid re-use()ing Git.pm in sub-packages

I will be using functions from Git.pm in more modules, so I
want to avoid re-importing the long argument list everywhere
it's used.

Also removed an unused command-line switch
(--no-ignore-externals) and some variables.
Signed-off-by: NEric Wong <normalperson@yhbt.net>
上级 d81bf827
......@@ -49,19 +49,28 @@
use POSIX qw/strftime/;
use IPC::Open3;
use Memoize;
use Git qw/command command_oneline command_noisy
command_output_pipe command_input_pipe command_close_pipe/;
use Git;
memoize('revisions_eq');
memoize('cmt_metadata');
memoize('get_commit_time');
BEGIN {
my $s;
foreach (qw/command command_oneline command_noisy command_output_pipe
command_input_pipe command_close_pipe/) {
$s .= "*SVN::Git::Editor::$_ = *SVN::Git::Fetcher::$_ = ".
"*$_ = *Git::$_; ";
}
eval $s;
}
my ($SVN);
my $_optimize_commits = 1 unless $ENV{GIT_SVN_NO_OPTIMIZE_COMMITS};
my $sha1 = qr/[a-f\d]{40}/;
my $sha1_short = qr/[a-f\d]{4,40}/;
my $_esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
my ($_revision,$_stdin,$_help,$_rmdir,$_edit,
$_find_copies_harder, $_l, $_cp_similarity, $_cp_remote,
$_repack, $_repack_nr, $_repack_flags, $_q,
$_message, $_file, $_no_metadata,
......@@ -70,13 +79,11 @@
$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,
$_merge, $_strategy, $_dry_run, $_ignore_nodate, $_non_recursive,
$_pager, $_color, $_prefix);
my (@_branch_from, %tree_map, %users, %rusers, %equiv);
my ($_svn_can_do_switch);
my (@_branch_from, %tree_map, %users, %rusers);
my @repo_path_split_cache;
use vars qw/$_follow_parent/;
my %fc_opts = ( 'no-ignore-externals' => \$_no_ignore_ext,
'branch|b=s' => \@_branch_from,
my %fc_opts = ( 'branch|b=s' => \@_branch_from,
'follow-parent|follow' => \$_follow_parent,
'branch-all-refs|B' => \$_branch_all_refs,
'authors-file|A=s' => \$_authors,
......@@ -117,8 +124,7 @@
'show-ignore' => [ \&show_ignore, "Show svn:ignore listings",
{ 'revision|r=i' => \$_revision } ],
rebuild => [ \&rebuild, "Rebuild git-svn metadata (after git clone)",
{ 'no-ignore-externals' => \$_no_ignore_ext,
'copy-remote|remote=s' => \$_cp_remote,
{ 'copy-remote|remote=s' => \$_cp_remote,
'upgrade' => \$_upgrade } ],
'graft-branches' => [ \&graft_branches,
'Detect merges/branches from already imported history',
......@@ -2476,8 +2482,6 @@ package SVN::Git::Fetcher;
use warnings;
use Carp qw/croak/;
use IO::File qw//;
use Git qw/command command_oneline command_noisy
command_output_pipe command_input_pipe command_close_pipe/;
# file baton members: path, mode_a, mode_b, pool, fh, blob, base
sub new {
......@@ -2684,8 +2688,6 @@ package SVN::Git::Editor;
use warnings;
use Carp qw/croak/;
use IO::File;
use Git qw/command command_oneline command_noisy
command_output_pipe command_input_pipe command_close_pipe/;
sub new {
my $class = shift;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册