summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-04-28 20:05:20 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-04-28 20:05:20 -0400
commitec771a7084ed9352ac6b14ed6ff437e67aba0f0b (patch)
treebc463afbbf8039dfba2c8f025c09f6b5cfa93fd1 /git-svn.perl
parent475d1b333a03b0c13cbbc4ebf395fe11c989f931 (diff)
parent71e2e5993b6f2afdfda0cc92e0d55e84c9f876b0 (diff)
downloadgit-ec771a7084ed9352ac6b14ed6ff437e67aba0f0b.tar.gz
Merge commit 'jc/maint' into gfi-maint
* commit 'jc/maint': (35 commits) Update git-http-fetch documentation Update git-local-fetch documentation Update git-http-push documentation Update -L documentation for git-blame/git-annotate Update git-grep documentation Update git-fmt-merge documentation Document additional options for git-fetch Removing -n option from git-diff-files documentation Start preparing for 1.5.1.3 Sanitize @to recipients. git-svn: Ignore usernames in URLs in find_by_url Document --dry-run and envelope-sender for git-send-email. Allow users to optionally specify their envelope sender. Ensure clean addresses are always used with Net::SMTP Validate @recipients before using it for sendmail and Net::SMTP. Perform correct quoting of recipient names. Change the scope of the $cc variable as it is not needed outside of send_message. Debugging cleanup improvements Prefix Dry- to the message status to denote dry-runs. Document --dry-run parameter to send-email. ...
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl19
1 files changed, 13 insertions, 6 deletions
diff --git a/git-svn.perl b/git-svn.perl
index efc4c88a4e..7b5f8ab3be 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -771,19 +771,19 @@ sub cmt_metadata {
sub working_head_info {
my ($head, $refs) = @_;
my ($fh, $ctx) = command_output_pipe('rev-list', $head);
- while (<$fh>) {
- chomp;
- my ($url, $rev, $uuid) = cmt_metadata($_);
+ while (my $hash = <$fh>) {
+ chomp($hash);
+ my ($url, $rev, $uuid) = cmt_metadata($hash);
if (defined $url && defined $rev) {
if (my $gs = Git::SVN->find_by_url($url)) {
my $c = $gs->rev_db_get($rev);
- if ($c && $c eq $_) {
+ if ($c && $c eq $hash) {
close $fh; # break the pipe
return ($url, $rev, $uuid, $gs);
}
}
}
- unshift @$refs, $_ if $refs;
+ unshift @$refs, $hash if $refs;
}
command_close_pipe($fh, $ctx);
(undef, undef, undef, undef);
@@ -1064,7 +1064,10 @@ sub init_remote_config {
sub find_by_url { # repos_root and, path are optional
my ($class, $full_url, $repos_root, $path) = @_;
+
return undef unless defined $full_url;
+ remove_username($full_url);
+ remove_username($repos_root) if defined $repos_root;
my $remotes = read_all_remotes();
if (defined $full_url && defined $repos_root && !defined $path) {
$path = $full_url;
@@ -1072,6 +1075,7 @@ sub find_by_url { # repos_root and, path are optional
}
foreach my $repo_id (keys %$remotes) {
my $u = $remotes->{$repo_id}->{url} or next;
+ remove_username($u);
next if defined $repos_root && $repos_root ne $u;
my $fetch = $remotes->{$repo_id}->{fetch} || {};
@@ -1866,11 +1870,14 @@ sub make_log_entry {
} elsif ($self->use_svnsync_props) {
my $full_url = $self->svnsync->{url};
$full_url .= "/$self->{path}" if length $self->{path};
+ remove_username($full_url);
my $uuid = $self->svnsync->{uuid};
$log_entry{metadata} = "$full_url\@$rev $uuid";
$email ||= "$author\@$uuid"
} else {
- $log_entry{metadata} = $self->metadata_url. "\@$rev " .
+ my $url = $self->metadata_url;
+ remove_username($url);
+ $log_entry{metadata} = "$url\@$rev " .
$self->ra->get_uuid;
$email ||= "$author\@" . $self->ra->get_uuid;
}