зеркало из https://github.com/microsoft/git.git
Merge git://bogomips.org/git-svn
* git://bogomips.org/git-svn: git-svn: teach find-rev to find near matches git svn: do not overescape URLs (fallback case) Git::SVN::Editor::T: pass $deletions to ->A and ->D
This commit is contained in:
Коммит
02f55e660c
|
@ -346,6 +346,16 @@ Any other arguments are passed directly to 'git log'
|
||||||
corresponding git commit hash (this can optionally be followed by a
|
corresponding git commit hash (this can optionally be followed by a
|
||||||
tree-ish to specify which branch should be searched). When given a
|
tree-ish to specify which branch should be searched). When given a
|
||||||
tree-ish, returns the corresponding SVN revision number.
|
tree-ish, returns the corresponding SVN revision number.
|
||||||
|
+
|
||||||
|
--before;;
|
||||||
|
Don't require an exact match if given an SVN revision, instead find
|
||||||
|
the commit corresponding to the state of the SVN repository (on the
|
||||||
|
current branch) at the specified revision.
|
||||||
|
+
|
||||||
|
--after;;
|
||||||
|
Don't require an exact match if given an SVN revision; if there is
|
||||||
|
not an exact match return the closest match searching forward in the
|
||||||
|
history.
|
||||||
|
|
||||||
'set-tree'::
|
'set-tree'::
|
||||||
You should consider using 'dcommit' instead of this command.
|
You should consider using 'dcommit' instead of this command.
|
||||||
|
|
12
git-svn.perl
12
git-svn.perl
|
@ -114,6 +114,7 @@ my ($_stdin, $_help, $_edit,
|
||||||
$_message, $_file, $_branch_dest,
|
$_message, $_file, $_branch_dest,
|
||||||
$_template, $_shared,
|
$_template, $_shared,
|
||||||
$_version, $_fetch_all, $_no_rebase, $_fetch_parent,
|
$_version, $_fetch_all, $_no_rebase, $_fetch_parent,
|
||||||
|
$_before, $_after,
|
||||||
$_merge, $_strategy, $_preserve_merges, $_dry_run, $_local,
|
$_merge, $_strategy, $_preserve_merges, $_dry_run, $_local,
|
||||||
$_prefix, $_no_checkout, $_url, $_verbose,
|
$_prefix, $_no_checkout, $_url, $_verbose,
|
||||||
$_commit_url, $_tag, $_merge_info, $_interactive);
|
$_commit_url, $_tag, $_merge_info, $_interactive);
|
||||||
|
@ -258,7 +259,8 @@ my %cmd = (
|
||||||
} ],
|
} ],
|
||||||
'find-rev' => [ \&cmd_find_rev,
|
'find-rev' => [ \&cmd_find_rev,
|
||||||
"Translate between SVN revision numbers and tree-ish",
|
"Translate between SVN revision numbers and tree-ish",
|
||||||
{} ],
|
{ 'before' => \$_before,
|
||||||
|
'after' => \$_after } ],
|
||||||
'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
|
'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
|
||||||
{ 'merge|m|M' => \$_merge,
|
{ 'merge|m|M' => \$_merge,
|
||||||
'verbose|v' => \$_verbose,
|
'verbose|v' => \$_verbose,
|
||||||
|
@ -1191,7 +1193,13 @@ sub cmd_find_rev {
|
||||||
"$head history\n";
|
"$head history\n";
|
||||||
}
|
}
|
||||||
my $desired_revision = substr($revision_or_hash, 1);
|
my $desired_revision = substr($revision_or_hash, 1);
|
||||||
$result = $gs->rev_map_get($desired_revision, $uuid);
|
if ($_before) {
|
||||||
|
$result = $gs->find_rev_before($desired_revision, 1);
|
||||||
|
} elsif ($_after) {
|
||||||
|
$result = $gs->find_rev_after($desired_revision, 1);
|
||||||
|
} else {
|
||||||
|
$result = $gs->rev_map_get($desired_revision, $uuid);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
my (undef, $rev, undef) = cmt_metadata($revision_or_hash);
|
my (undef, $rev, undef) = cmt_metadata($revision_or_hash);
|
||||||
$result = $rev;
|
$result = $rev;
|
||||||
|
|
|
@ -358,12 +358,12 @@ sub T {
|
||||||
mode_a => $m->{mode_a}, mode_b => '000000',
|
mode_a => $m->{mode_a}, mode_b => '000000',
|
||||||
sha1_a => $m->{sha1_a}, sha1_b => '0' x 40,
|
sha1_a => $m->{sha1_a}, sha1_b => '0' x 40,
|
||||||
chg => 'D', file_b => $m->{file_b}
|
chg => 'D', file_b => $m->{file_b}
|
||||||
});
|
}, $deletions);
|
||||||
$self->A({
|
$self->A({
|
||||||
mode_a => '000000', mode_b => $m->{mode_b},
|
mode_a => '000000', mode_b => $m->{mode_b},
|
||||||
sha1_a => '0' x 40, sha1_b => $m->{sha1_b},
|
sha1_a => '0' x 40, sha1_b => $m->{sha1_b},
|
||||||
chg => 'A', file_b => $m->{file_b}
|
chg => 'A', file_b => $m->{file_b}
|
||||||
});
|
}, $deletions);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ sub _canonicalize_url_path {
|
||||||
|
|
||||||
my @parts;
|
my @parts;
|
||||||
foreach my $part (split m{/+}, $uri_path) {
|
foreach my $part (split m{/+}, $uri_path) {
|
||||||
$part =~ s/([^~\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg;
|
$part =~ s/([^!\$%&'()*+,.\/\w:=\@_`~-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg;
|
||||||
push @parts, $part;
|
push @parts, $part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче