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 <jrnieder@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>

Jonathan Nieder committed May 28, 2012 at 02:00 UTC 72827aa468b467157643bb3689c8786e86e4a58c
1 file changed +25 -25
git-svn.perl
+25 -25
@@ -68,8 +68,8 @@ sub _req_svn {
68 }
69 my $can_compress = eval { require Compress::Zlib; 1};
70 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';
73 use Carp qw/croak/;
74 use Digest::MD5;
75 use IO::File qw//;
@@ -89,7 +89,7 @@ BEGIN {
89 foreach (qw/command command_oneline command_noisy command_output_pipe
90 command_input_pipe command_close_pipe
91 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
93 Git::SVN::Migration Git::SVN::Log Git::SVN),
94 __PACKAGE__) {
95 *{"${package}::$_"} = \&{"Git::$_"};
@@ -111,12 +111,12 @@ my ($_stdin, $_help, $_edit,
111 $_prefix, $_no_checkout, $_url, $_verbose,
112 $_git_format, $_commit_url, $_tag, $_merge_info, $_interactive);
113 $Git::SVN::_follow_parent = 1;
114 -$SVN::Git::Fetcher::_placeholder_filename = ".gitignore";
114 +$Git::SVN::Fetcher::_placeholder_filename = ".gitignore";
115 $_q ||= 0;
116 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
117 'config-dir=s' => \$Git::SVN::Ra::config_dir,
118 '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,
120 'ignore-refs=s' => \$Git::SVN::Ra::_ignore_refs_regex );
121 my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
122 'authors-file|A=s' => \$_authors,
@@ -149,10 +149,10 @@ my %init_opts = ( 'template=s' => \$_template, 'shared:s' => \$_shared,
149 'rewrite-uuid=s' => sub { $icv{rewriteUUID} = $_[1] },
150 %remote_opts );
151 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
156 );
157
158 my %cmd = (
@@ -164,9 +164,9 @@ my %cmd = (
164 clone => [ \&cmd_clone, "Initialize and fetch revisions",
165 { 'revision|r=s' => \$_revision,
166 'preserve-empty-dirs' =>
167 - \$SVN::Git::Fetcher::_preserve_empty_dirs,
167 + \$Git::SVN::Fetcher::_preserve_empty_dirs,
168 'placeholder-filename=s' =>
169 - \$SVN::Git::Fetcher::_placeholder_filename,
169 + \$Git::SVN::Fetcher::_placeholder_filename,
170 %fc_opts, %init_opts } ],
171 init => [ \&cmd_init, "Initialize a repo for tracking" .
172 " (requires URL argument)",
@@ -464,15 +464,15 @@ sub do_git_init_db {
464 command_noisy('config', "$pfx.$i", $icv{$i});
465 $set = $i;
466 }
467 - my $ignore_paths_regex = \$SVN::Git::Fetcher::_ignore_regex;
467 + my $ignore_paths_regex = \$Git::SVN::Fetcher::_ignore_regex;
468 command_noisy('config', "$pfx.ignore-paths", $$ignore_paths_regex)
469 if defined $$ignore_paths_regex;
470 my $ignore_refs_regex = \$Git::SVN::Ra::_ignore_refs_regex;
471 command_noisy('config', "$pfx.ignore-refs", $$ignore_refs_regex)
472 if defined $$ignore_refs_regex;
473
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;
476 command_noisy('config', "$pfx.preserve-empty-dirs", 'true');
477 command_noisy('config', "$pfx.placeholder-filename", $$fname);
478 }
@@ -942,7 +942,7 @@ sub cmd_dcommit {
942 },
943 mergeinfo => $_merge_info,
944 svn_path => '');
945 - if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
945 + if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
946 print "No changes\n$d~1 == $d\n";
947 } elsif ($parents->{$d} && @{$parents->{$d}}) {
948 $gs->{inject_parents_dcommit}->{$cmt_rev} =
@@ -1066,8 +1066,8 @@ sub cmd_branch {
1066 " with the --destination argument.\n";
1067 }
1068 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});
1071 if ($_branch_dest =~ /$re/) {
1072 $glob = $g;
1073 last;
@@ -1425,7 +1425,7 @@ sub cmd_commit_diff {
1425 tree_b => $tb,
1426 editor_cb => sub { print "Committed r$_[0]\n" },
1427 svn_path => $svn_path );
1428 - if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
1428 + if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
1429 print "No changes\n$ta == $tb\n";
1430 }
1431 }
@@ -3157,7 +3157,7 @@ sub find_parent_branch {
3157 # at the moment), so we can't rely on it
3158 $self->{last_rev} = $r0;
3159 $self->{last_commit} = $parent;
3160 - $ed = SVN::Git::Fetcher->new($self, $gs->{path});
3160 + $ed = Git::SVN::Fetcher->new($self, $gs->{path});
3161 $gs->ra->gs_do_switch($r0, $rev, $gs,
3162 $self->full_url, $ed)
3163 or die "SVN connection failed somewhere...\n";
@@ -3175,7 +3175,7 @@ sub find_parent_branch {
3175 } else {
3176 print STDERR "Following parent with do_update\n"
3177 unless $::_q > 1;
3178 - $ed = SVN::Git::Fetcher->new($self);
3178 + $ed = Git::SVN::Fetcher->new($self);
3179 $self->ra->gs_do_update($rev, $rev, $self, $ed)
3180 or die "SVN connection failed somewhere...\n";
3181 }
@@ -3198,7 +3198,7 @@ sub do_fetch {
3198 push @{$log_entry->{parents}}, $lc;
3199 return $log_entry;
3200 }
3201 - $ed = SVN::Git::Fetcher->new($self);
3201 + $ed = Git::SVN::Fetcher->new($self);
3202 $last_rev = $self->{last_rev};
3203 $ed->{c} = $lc;
3204 @parents = ($lc);
@@ -3207,7 +3207,7 @@ sub do_fetch {
3207 if (my $log_entry = $self->find_parent_branch($paths, $rev)) {
3208 return $log_entry;
3209 }
3210 - $ed = SVN::Git::Fetcher->new($self);
3210 + $ed = Git::SVN::Fetcher->new($self);
3211 }
3212 unless ($self->ra->gs_do_update($last_rev, $rev, $self, $ed)) {
3213 die "SVN connection failed somewhere...\n";
@@ -3912,7 +3912,7 @@ sub set_tree {
3912 editor_cb => sub {
3913 $self->set_tree_cb($log_entry, $tree, @_) },
3914 svn_path => $self->{path} );
3915 - if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
3915 + if (!Git::SVN::Editor->new(\%ed_opts)->apply_diff) {
3916 print "No changes\nr$self->{last_rev} = $tree\n";
3917 }
3918 }
@@ -4328,7 +4328,7 @@ sub remove_username {
4328 $_[0] =~ s{^([^:]*://)[^@]+@}{$1};
4329 }
4330
4331 -package SVN::Git::Fetcher;
4331 +package Git::SVN::Fetcher;
4332 use vars qw/@ISA $_ignore_regex $_preserve_empty_dirs $_placeholder_filename
4333 @deleted_gpath %added_placeholder $repo_id/;
4334 use strict;
@@ -4831,7 +4831,7 @@ sub stash_placeholder_list {
4831 }
4832 }
4833
4834 -package SVN::Git::Editor;
4834 +package Git::SVN::Editor;
4835 use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/;
4836 use strict;
4837 use warnings;