提交 ec9d00d0 编写于 作者: E Eric Wong 提交者: Junio C Hamano

git-svn: fix commit --edit flag when using SVN:: libraries

Trying to open an interactive editor in the console while stdout is
being piped to the parent process doesn't work out very well.
Signed-off-by: NEric Wong <normalperson@yhbt.net>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 bbc932c8
...@@ -479,17 +479,18 @@ sub commit_lib { ...@@ -479,17 +479,18 @@ sub commit_lib {
my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : (); my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$"; my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$";
foreach my $c (@revs) {
# fork for each commit because there's a memory leak I
# can't track down... (it's probably in the SVN code)
defined(my $pid = open my $fh, '-|') or croak $!;
if (!$pid) {
if (defined $LC_ALL) { if (defined $LC_ALL) {
$ENV{LC_ALL} = $LC_ALL; $ENV{LC_ALL} = $LC_ALL;
} else { } else {
delete $ENV{LC_ALL}; delete $ENV{LC_ALL};
} }
foreach my $c (@revs) {
my $log_msg = get_commit_message($c, $commit_msg); my $log_msg = get_commit_message($c, $commit_msg);
# fork for each commit because there's a memory leak I
# can't track down... (it's probably in the SVN code)
defined(my $pid = open my $fh, '-|') or croak $!;
if (!$pid) {
my $ed = SVN::Git::Editor->new( my $ed = SVN::Git::Editor->new(
{ r => $r_last, { r => $r_last,
ra => $SVN, ra => $SVN,
...@@ -535,6 +536,7 @@ sub commit_lib { ...@@ -535,6 +536,7 @@ sub commit_lib {
($r_last, $cmt_last) = ($r_new, $cmt_new); ($r_last, $cmt_last) = ($r_new, $cmt_new);
} }
} }
$ENV{LC_ALL} = 'C';
unlink $commit_msg; unlink $commit_msg;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册