Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-01 14:30:31 +0300
committerEric Wong <normalperson@yhbt.net>2007-02-23 11:57:11 +0300
commitd8115c5104dbee29433a7f33a3e0d3e1738a581e (patch)
treeb301c2b62aa8d5cd4c7dcbe0a4363a86d02c1810 /git-svn.perl
parentce4b4af7ff36d4e4999da937dffd2f9a3a420277 (diff)
git-svn: don't write to the config file from --follow-parent
Having 'fetch' entries in the config file created from --follow-parent is wasteful because it can cause *future* of invocations to follow revisions we were never interested in in the first place. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl20
1 files changed, 11 insertions, 9 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 1e3a3c08f1..a2db73fe00 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -724,7 +724,7 @@ sub find_existing_remote {
}
sub init_remote_config {
- my ($self, $url) = @_;
+ my ($self, $url, $no_write) = @_;
$url =~ s!/+$!!; # strip trailing slash
my $r = read_all_remotes();
my $existing = find_existing_remote($url, $r);
@@ -769,19 +769,21 @@ sub init_remote_config {
die "svn-remote.$xrepo_id.fetch already set to track ",
"$xpath:refs/remotes/", $self->refname, "\n";
}
- command_noisy('config',
- "svn-remote.$self->{repo_id}.url", $url);
- command_noisy('config', '--add',
- "svn-remote.$self->{repo_id}.fetch",
- "$self->{path}:".$self->refname);
+ unless ($no_write) {
+ command_noisy('config',
+ "svn-remote.$self->{repo_id}.url", $url);
+ command_noisy('config', '--add',
+ "svn-remote.$self->{repo_id}.fetch",
+ "$self->{path}:".$self->refname);
+ }
$self->{url} = $url;
}
sub init {
- my ($class, $url, $path, $repo_id, $ref_id) = @_;
+ my ($class, $url, $path, $repo_id, $ref_id, $no_write) = @_;
my $self = _new($class, $repo_id, $ref_id, $path);
if (defined $url) {
- $self->init_remote_config($url);
+ $self->init_remote_config($url, $no_write);
}
$self;
}
@@ -1112,7 +1114,7 @@ sub find_parent_branch {
# just grow a tail if we're not unique enough :x
$ref_id .= '-' while find_ref($ref_id);
print STDERR "Initializing parent: $ref_id\n";
- $gs = Git::SVN->init($new_url, '', $ref_id, $ref_id);
+ $gs = Git::SVN->init($new_url, '', $ref_id, $ref_id, 1);
}
my ($r0, $parent) = $gs->find_rev_before($r, 1);
if ($_follow_parent && (!defined $r0 || !defined $parent)) {