summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a60377)
raw | patch | inline | side by side (parent: 8a60377)
author | Eric Wong <normalperson@yhbt.net> | |
Wed, 31 Jan 2007 11:06:56 +0000 (03:06 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:11 +0000 (00:57 -0800) |
--svn-remote allows the default remote name to be overridden (useful
for tracking multiple SVN repositories).
Signed-off-by: Eric Wong <normalperson@yhbt.net>
for tracking multiple SVN repositories).
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Documentation/git-svn.txt | patch | blob | history | |
git-svn.perl | patch | blob | history |
index 22dd7b219d60b909bb153f0672c0c254218d9a94..2914042587ed82354e6cd7caa30e0cbf9b689aeb 100644 (file)
'<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
for more information on using GIT_SVN_ID.
+-R<remote name>::
+--svn-remote <remote name>::
+ Specify the [svn-remote "<remote name>"] section to use,
+ this allows multiple repositories to be tracked.
+ Default: git-svn
+
--follow-parent::
This is especially helpful when we're tracking a directory
that has been moved around within the repository, or if we
diff --git a/git-svn.perl b/git-svn.perl
index 2afa2537b9c1af92700777f9426f59de82d0b31c..cc5736d793c1c286c763b50d5c15423816126f43 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
use warnings;
use strict;
use vars qw/ $AUTHOR $VERSION
- $SVN_URL
- $GIT_SVN_INDEX $GIT_SVN
- $GIT_DIR $GIT_SVN_DIR $REVDB
- $_follow_parent $sha1 $sha1_short $_revision
- $_cp_remote $_upgrade $_q
- $_authors %users/;
+ $sha1 $sha1_short $_revision
+ $_q $_authors %users/;
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
$VERSION = '@@GIT_VERSION@@';
$Git::SVN::default_repo_id = 'git-svn';
$Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
-my $LC_ALL = $ENV{LC_ALL};
$Git::SVN::Log::TZ = $ENV{TZ};
-# make sure the svn binary gives consistent output between locales and TZs:
$ENV{TZ} = 'UTC';
-$ENV{LC_ALL} = 'C';
$| = 1; # unbuffer STDOUT
sub fatal (@) { print STDERR @_; exit 1 }
$sha1_short = qr/[a-f\d]{4,40}/;
my ($_stdin, $_help, $_edit,
$_repack, $_repack_nr, $_repack_flags,
- $_message, $_file, $_no_metadata,
+ $_message, $_file,
$_template, $_shared,
- $_version, $_upgrade,
+ $_version,
$_merge, $_strategy, $_dry_run,
$_prefix);
my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
'config-dir=s' => \$Git::SVN::Ra::config_dir,
'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache );
-my %fc_opts = ( 'follow-parent|follow' => \$_follow_parent,
+my %fc_opts = ( 'follow-parent|follow' => \$Git::SVN::_follow_parent,
'authors-file|A=s' => \$_authors,
'repack:i' => \$_repack,
- 'no-metadata' => \$_no_metadata,
+ 'no-metadata' => \$Git::SVN::_no_metadata,
'quiet|q' => \$_q,
'repack-flags|repack-args|repack-opts=s' => \$_repack_flags,
%remote_opts );
my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
read_repo_config(\%opts);
-my $rv = GetOptions(%opts, 'help|H|h' => \$_help,
- 'version|V' => \$_version,
- 'minimize-connections' =>
- \$Git::SVN::Migration::_minimize,
- 'id|i=s' => \$Git::SVN::default_ref_id);
+my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
+ 'minimize-connections' => \$Git::SVN::Migration::_minimize,
+ 'id|i=s' => \$Git::SVN::default_ref_id,
+ 'svn-remote|remote|R=s' => \$Git::SVN::default_repo_id);
exit 1 if (!$rv && $cmd ne 'log');
usage(0) if $_help;
package Git::SVN;
use strict;
use warnings;
-use vars qw/$default_repo_id $default_ref_id/;
+use vars qw/$default_repo_id $default_ref_id $_no_metadata $_follow_parent/;
use Carp qw/croak/;
use File::Path qw/mkpath/;
use IPC::Open3;
defined(my $pid = open3(my $msg_fh, my $out_fh, '>&STDERR', @exec))
or croak $!;
print $msg_fh $log_entry->{log} or croak $!;
- print $msg_fh "\ngit-svn-id: ", $self->full_url, '@',
- $log_entry->{revision}, ' ',
- $self->ra->uuid, "\n" or croak $!;
+ unless ($_no_metadata) {
+ print $msg_fh "\ngit-svn-id: ", $self->full_url, '@',
+ $log_entry->{revision}, ' ',
+ $self->ra->uuid, "\n" or croak $!;
+ }
$msg_fh->flush == 0 or croak $!;
close $msg_fh or croak $!;
chomp(my $commit = do { local $/; <$out_fh> });
sub find_parent_branch {
my ($self, $paths, $rev) = @_;
- return undef unless $::_follow_parent;
+ return undef unless $_follow_parent;
unless (defined $paths) {
$self->ra->get_log([$self->{path}], $rev, $rev, 0, 1, 1,
sub { $paths = dup_changed_paths($_[0]) });
$gs = Git::SVN->init($new_url, '', $ref_id, $ref_id);
}
my ($r0, $parent) = $gs->find_rev_before($r, 1);
- if ($::_follow_parent && (!defined $r0 || !defined $parent)) {
+ if ($_follow_parent && (!defined $r0 || !defined $parent)) {
$gs->fetch(0, $r);
($r0, $parent) = $gs->last_rev_commit;
}