Skip to content

Commit 72827aa

Browse files
jrnEric Wong
authored andcommitted
git-svn: rename SVN::Git::* packages to Git::SVN::*
Using names in the Git:: namespace means these cannot conflict with a hypothetical binding teaching Subversion to interact with git repositories. Currently the packages are private to git-svn.perl so the choice of name isn't likely to make much difference. This change is mainly meant as preparation for splitting out the packages in question as modules on the public search path. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Eric Wong <[email protected]>
1 parent c102f4c commit 72827aa

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

git-svn.perl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ sub _req_svn {
6868
}
6969
my $can_compress = eval { require Compress::Zlib; 1};
7070
push @Git::SVN::Ra::ISA, 'SVN::Ra';
71-
push @SVN::Git::Editor::ISA, 'SVN::Delta::Editor';
72-
push @SVN::Git::Fetcher::ISA, 'SVN::Delta::Editor';
71+
push @Git::SVN::Editor::ISA, 'SVN::Delta::Editor';
72+
push @Git::SVN::Fetcher::ISA, 'SVN::Delta::Editor';
7373
use Carp qw/croak/;
7474
use Digest::MD5;
7575
use IO::File qw//;
@@ -89,7 +89,7 @@ BEGIN
8989
foreach (qw/command command_oneline command_noisy command_output_pipe
9090
command_input_pipe command_close_pipe
9191
command_bidi_pipe command_close_bidi_pipe/) {
92-
for my $package ( qw(SVN::Git::Editor SVN::Git::Fetcher
92+
for my $package ( qw(Git::SVN::Editor Git::SVN::Fetcher
9393
Git::SVN::Migration Git::SVN::Log Git::SVN),
9494
__PACKAGE__) {
9595
*{"${package}::$_"} = \&{"Git::$_"};
@@ -111,12 +111,12 @@ BEGIN
111111
$_prefix, $_no_checkout, $_url, $_verbose,
112112
$_git_format, $_commit_url, $_tag, $_merge_info, $_interactive);
113113
$Git::SVN::_follow_parent = 1;
114-
$SVN::Git::Fetcher::_placeholder_filename = ".gitignore";
114+
$Git::SVN::Fetcher::_placeholder_filename = ".gitignore";
115115
$_q ||= 0;
116116
my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
117117
'config-dir=s' => \$Git::SVN::Ra::config_dir,
118118
'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
119-
'ignore-paths=s' => \$SVN::Git::Fetcher::_ignore_regex,
119+
'ignore-paths=s' => \$Git::SVN::Fetcher::_ignore_regex,
120120
'ignore-refs=s' => \$Git::SVN::Ra::_ignore_refs_regex );
121121
my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
122122
'authors-file|A=s' => \$_authors,
@@ -149,10 +149,10 @@ BEGIN
149149
'rewrite-uuid=s' => sub { $icv{rewriteUUID} = $_[1] },
150150
%remote_opts );
151151
my %cmt_opts = ( 'edit|e' => \$_edit,
152-
'rmdir' => \$SVN::Git::Editor::_rmdir,
153-
'find-copies-harder' => \$SVN::Git::Editor::_find_copies_harder,
154-
'l=i' => \$SVN::Git::Editor::_rename_limit,
155-
'copy-similarity|C=i'=> \$SVN::Git::Editor::_cp_similarity
152+
'rmdir' => \$Git::SVN::Editor::_rmdir,
153+
'find-copies-harder' => \$Git::SVN::Editor::_find_copies_harder,
154+
'l=i' => \$Git::SVN::Editor::_rename_limit,
155+
'copy-similarity|C=i'=> \$Git::SVN::Editor::_cp_similarity
156156
);
157157

158158
my %cmd = (
@@ -164,9 +164,9 @@ BEGIN
164164
clone => [ \&cmd_clone, "Initialize and fetch revisions",
165165
{ 'revision|r=s' => \$_revision,
166166
'preserve-empty-dirs' =>
167-
\$SVN::Git::Fetcher::_preserve_empty_dirs,
167+
\$Git::SVN::Fetcher::_preserve_empty_dirs,
168168
'placeholder-filename=s' =>
169-
\$SVN::Git::Fetcher::_placeholder_filename,
169+
\$Git::SVN::Fetcher::_placeholder_filename,
170170
%fc_opts, %init_opts } ],
171171
init => [ \&cmd_init, "Initialize a repo for tracking" .
172172
" (requires URL argument)",
@@ -464,15 +464,15 @@ sub do_git_init_db {
464464
command_noisy('config', "$pfx.$i", $icv{$i});
465465
$set = $i;
466466
}
467-
my $ignore_paths_regex = \$SVN::Git::Fetcher::_ignore_regex;
467+
my $ignore_paths_regex = \$Git::SVN::Fetcher::_ignore_regex;
468468
command_noisy('config', "$pfx.ignore-paths", $$ignore_paths_regex)
469469
if defined $$ignore_paths_regex;
470470
my $ignore_refs_regex = \$Git::SVN::Ra::_ignore_refs_regex;
471471
command_noisy('config', "$pfx.ignore-refs", $$ignore_refs_regex)
472472
if defined $$ignore_refs_regex;
473473

474-
if (defined $SVN::Git::Fetcher::_preserve_empty_dirs) {
475-
my $fname = \$SVN::Git::Fetcher::_placeholder_filename;
474+
if (defined $Git::SVN::Fetcher::_preserve_empty_dirs) {
475+
my $fname = \$Git::SVN::Fetcher::_placeholder_filename;
476476
command_noisy('config', "$pfx.preserve-empty-dirs", 'true');
477477
command_noisy('config', "$pfx.placeholder-filename", $$fname);
478478
}
@@ -942,7 +942,7 @@ sub cmd_dcommit {
942942
},
943943
mergeinfo => $_merge_info,
944944
svn_path => '');
945-
if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
945+
if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
946946
print "No changes\n$d~1 == $d\n";
947947
} elsif ($parents->{$d} && @{$parents->{$d}}) {
948948
$gs->{inject_parents_dcommit}->{$cmt_rev} =
@@ -1066,8 +1066,8 @@ sub cmd_branch {
10661066
" with the --destination argument.\n";
10671067
}
10681068
foreach my $g (@{$allglobs}) {
1069-
# SVN::Git::Editor could probably be moved to Git.pm..
1070-
my $re = SVN::Git::Editor::glob2pat($g->{path}->{left});
1069+
# Git::SVN::Editor could probably be moved to Git.pm..
1070+
my $re = Git::SVN::Editor::glob2pat($g->{path}->{left});
10711071
if ($_branch_dest =~ /$re/) {
10721072
$glob = $g;
10731073
last;
@@ -1425,7 +1425,7 @@ sub cmd_commit_diff {
14251425
tree_b => $tb,
14261426
editor_cb => sub { print "Committed r$_[0]\n" },
14271427
svn_path => $svn_path );
1428-
if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
1428+
if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
14291429
print "No changes\n$ta == $tb\n";
14301430
}
14311431
}
@@ -3157,7 +3157,7 @@ sub find_parent_branch {
31573157
# at the moment), so we can't rely on it
31583158
$self->{last_rev} = $r0;
31593159
$self->{last_commit} = $parent;
3160-
$ed = SVN::Git::Fetcher->new($self, $gs->{path});
3160+
$ed = Git::SVN::Fetcher->new($self, $gs->{path});
31613161
$gs->ra->gs_do_switch($r0, $rev, $gs,
31623162
$self->full_url, $ed)
31633163
or die "SVN connection failed somewhere...\n";
@@ -3175,7 +3175,7 @@ sub find_parent_branch {
31753175
} else {
31763176
print STDERR "Following parent with do_update\n"
31773177
unless $::_q > 1;
3178-
$ed = SVN::Git::Fetcher->new($self);
3178+
$ed = Git::SVN::Fetcher->new($self);
31793179
$self->ra->gs_do_update($rev, $rev, $self, $ed)
31803180
or die "SVN connection failed somewhere...\n";
31813181
}
@@ -3198,7 +3198,7 @@ sub do_fetch {
31983198
push @{$log_entry->{parents}}, $lc;
31993199
return $log_entry;
32003200
}
3201-
$ed = SVN::Git::Fetcher->new($self);
3201+
$ed = Git::SVN::Fetcher->new($self);
32023202
$last_rev = $self->{last_rev};
32033203
$ed->{c} = $lc;
32043204
@parents = ($lc);
@@ -3207,7 +3207,7 @@ sub do_fetch {
32073207
if (my $log_entry = $self->find_parent_branch($paths, $rev)) {
32083208
return $log_entry;
32093209
}
3210-
$ed = SVN::Git::Fetcher->new($self);
3210+
$ed = Git::SVN::Fetcher->new($self);
32113211
}
32123212
unless ($self->ra->gs_do_update($last_rev, $rev, $self, $ed)) {
32133213
die "SVN connection failed somewhere...\n";
@@ -3912,7 +3912,7 @@ sub set_tree {
39123912
editor_cb => sub {
39133913
$self->set_tree_cb($log_entry, $tree, @_) },
39143914
svn_path => $self->{path} );
3915-
if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
3915+
if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
39163916
print "No changes\nr$self->{last_rev} = $tree\n";
39173917
}
39183918
}
@@ -4328,7 +4328,7 @@ sub remove_username {
43284328
$_[0] =~ s{^([^:]*://)[^@]+@}{$1};
43294329
}
43304330

4331-
package SVN::Git::Fetcher;
4331+
package Git::SVN::Fetcher;
43324332
use vars qw/@ISA $_ignore_regex $_preserve_empty_dirs $_placeholder_filename
43334333
@deleted_gpath %added_placeholder $repo_id/;
43344334
use strict;
@@ -4831,7 +4831,7 @@ sub stash_placeholder_list {
48314831
}
48324832
}
48334833

4834-
package SVN::Git::Editor;
4834+
package Git::SVN::Editor;
48354835
use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/;
48364836
use strict;
48374837
use warnings;

0 commit comments

Comments
 (0)