git-svn: cleanup: move editor-specific variables into the editor namespace
Also removed some unused/redundant functions. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Jan 29, 2007 at 00:07 UTC
24e22aa8a5762b11a8025c6ad82c945828667d0f
1 file changed
+12
-25
git-svn.perl
+12
-25
@@ -8,8 +8,8 @@ use vars qw/ $AUTHOR $VERSION
8
$GIT_SVN_INDEX $GIT_SVN
9
$GIT_DIR $GIT_SVN_DIR $REVDB
10
$_follow_parent $sha1 $sha1_short $_revision
11
- $_cp_remote $_upgrade $_rmdir $_q $_cp_similarity
12
- $_find_copies_harder $_l $_authors %users/;
11
+ $_cp_remote $_upgrade $_q
12
+ $_authors %users/;
13
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
14
$VERSION = '@@GIT_VERSION@@';
15
@@ -83,10 +83,10 @@ my %multi_opts = ( 'trunk|T=s' => \$_trunk,
83
'branches|b=s' => \$_branches );
84
my %init_opts = ( 'template=s' => \$_template, 'shared' => \$_shared );
85
my %cmt_opts = ( 'edit|e' => \$_edit,
86
- 'rmdir' => \$_rmdir,
87
- 'find-copies-harder' => \$_find_copies_harder,
88
- 'l=i' => \$_l,
89
- 'copy-similarity|C=i'=> \$_cp_similarity
86
+ 'rmdir' => \$SVN::Git::Editor::_rmdir,
87
+ 'find-copies-harder' => \$SVN::Git::Editor::_find_copies_harder,
88
+ 'l=i' => \$SVN::Git::Editor::_rename_limit,
89
+ 'copy-similarity|C=i'=> \$SVN::Git::Editor::_cp_similarity
90
);
91
92
my %cmd = (
@@ -1559,19 +1559,6 @@ sub _read_password {
1559
1560
package main;
1561
1562
-sub uri_encode {
1563
- my ($f) = @_;
1564
- $f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#uc sprintf("%%%02x",ord($1))#eg;
1565
- $f
1566
-}
1567
-
1568
-sub uri_decode {
1569
- my ($f) = @_;
1570
- $f =~ tr/+/ /;
1571
- $f =~ s/%([A-F0-9]{2})/chr hex($1)/ge;
1572
- $f
1573
-}
1574
-
1562
{
1563
my $kill_stupid_warnings = $SVN::Node::none.$SVN::Node::file.
1564
$SVN::Node::dir.$SVN::Node::unknown.
@@ -1806,7 +1793,7 @@ sub close_edit {
1793
}
1794
1795
package SVN::Git::Editor;
1809
-use vars qw/@ISA/;
1796
+use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/;
1797
use strict;
1798
use warnings;
1799
use Carp qw/croak/;
@@ -1846,13 +1833,13 @@ sub new {
1833
sub generate_diff {
1834
my ($tree_a, $tree_b) = @_;
1835
my @diff_tree = qw(diff-tree -z -r);
1849
- if ($::_cp_similarity) {
1850
- push @diff_tree, "-C$::_cp_similarity";
1836
+ if ($_cp_similarity) {
1837
+ push @diff_tree, "-C$_cp_similarity";
1838
} else {
1839
push @diff_tree, '-C';
1840
}
1854
- push @diff_tree, '--find-copies-harder' if $::_find_copies_harder;
1855
- push @diff_tree, "-l$::_l" if defined $::_l;
1841
+ push @diff_tree, '--find-copies-harder' if $_find_copies_harder;
1842
+ push @diff_tree, "-l$_rename_limit" if defined $_rename_limit;
1843
push @diff_tree, $tree_a, $tree_b;
1844
my ($diff_fh, $ctx) = command_output_pipe(@diff_tree);
1845
local $/ = "\0";
@@ -2163,7 +2150,7 @@ sub apply_diff {
2150
fatal("Invalid change type: $f\n");
2151
}
2152
}
2166
- $self->rmdirs if $::_rmdir;
2153
+ $self->rmdirs if $_rmdir;
2154
if (@$mods == 0) {
2155
$self->abort_edit;
2156
} else {