git-svn: don't consider SVN URL usernames significant when comparing
http://foo@blah.com/path is the same as http://blah.com/path, so remove usernames from URLs before storing them in commits, and when reading them from commits. Signed-off-by: Eric Wong <normalperson@yhbt.net>maint
parent
5253dc33b7
commit
18ea92bd81
|
@ -1847,6 +1847,8 @@ sub make_log_entry {
|
||||||
$full_url =~ s#^\Q$svm->{replace}\E(/|$)#$svm->{source}$1# or
|
$full_url =~ s#^\Q$svm->{replace}\E(/|$)#$svm->{source}$1# or
|
||||||
die "Failed to replace '$svm->{replace}' with ",
|
die "Failed to replace '$svm->{replace}' with ",
|
||||||
"'$svm->{source}' in $full_url\n";
|
"'$svm->{source}' in $full_url\n";
|
||||||
|
# throw away username for storing in records
|
||||||
|
remove_username($full_url);
|
||||||
$log_entry{metadata} = "$full_url\@$r $uuid";
|
$log_entry{metadata} = "$full_url\@$r $uuid";
|
||||||
$log_entry{svm_revision} = $r;
|
$log_entry{svm_revision} = $r;
|
||||||
$email ||= "$author\@$uuid"
|
$email ||= "$author\@$uuid"
|
||||||
|
@ -1915,12 +1917,14 @@ sub rebuild {
|
||||||
my ($rev_list, $ctx) = command_output_pipe("rev-list", $self->refname);
|
my ($rev_list, $ctx) = command_output_pipe("rev-list", $self->refname);
|
||||||
my $latest;
|
my $latest;
|
||||||
my $full_url = $self->full_url;
|
my $full_url = $self->full_url;
|
||||||
|
remove_username($full_url);
|
||||||
my $svn_uuid;
|
my $svn_uuid;
|
||||||
while (<$rev_list>) {
|
while (<$rev_list>) {
|
||||||
chomp;
|
chomp;
|
||||||
my $c = $_;
|
my $c = $_;
|
||||||
die "Non-SHA1: $c\n" unless $c =~ /^$::sha1$/o;
|
die "Non-SHA1: $c\n" unless $c =~ /^$::sha1$/o;
|
||||||
my ($url, $rev, $uuid) = ::cmt_metadata($c);
|
my ($url, $rev, $uuid) = ::cmt_metadata($c);
|
||||||
|
remove_username($url);
|
||||||
|
|
||||||
# ignore merges (from set-tree)
|
# ignore merges (from set-tree)
|
||||||
next if (!defined $rev || !$uuid);
|
next if (!defined $rev || !$uuid);
|
||||||
|
@ -2094,6 +2098,10 @@ sub uri_encode {
|
||||||
$f
|
$f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub remove_username {
|
||||||
|
$_[0] =~ s{^([^:]*://)[^@]+@}{$1};
|
||||||
|
}
|
||||||
|
|
||||||
package Git::SVN::Prompt;
|
package Git::SVN::Prompt;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
Loading…
Reference in New Issue