提交 51856904 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-7988 add info in the buffer with comments to exclude lines

上级 64111dbf
...@@ -8,7 +8,7 @@ use Data::Dumper; ...@@ -8,7 +8,7 @@ use Data::Dumper;
my $editor = $ENV{"EDITOR"} || $ENV{"VISUAL"} || `which emacs` || `which vi`; my $editor = $ENV{"EDITOR"} || $ENV{"VISUAL"} || `which emacs` || `which vi`;
my $default_versions = "1.7 1.6"; my $default_versions = "1.7 1.6";
my $default_components = "freeswitch-core"; my $default_components = "freeswitch-core";
my $desc_head = "; Enter the description lines beginning with a ; will be ignored.\n";
sub getpass { sub getpass {
...@@ -35,19 +35,25 @@ sub getfield { ...@@ -35,19 +35,25 @@ sub getfield {
sub get_text { sub get_text {
my $text = shift; my $text = shift;
my $notes = shift;
my @chars = ("A".."Z", "a".."z"); my @chars = ("A".."Z", "a".."z");
my $string; my $string;
$string .= $chars[rand @chars] for 1..8; $string .= $chars[rand @chars] for 1..8;
if ($text) { if ($text || $notes) {
open O, ">/tmp/TEXT.$string"; open O, ">/tmp/TEXT.$string";
print O $text; if ($notes) {
print O $notes;
}
if ($text) {
print O $text;
}
close O; close O;
} }
system("$editor /tmp/TEXT.$string"); system("$editor /tmp/TEXT.$string");
my $newtext = `cat /tmp/TEXT.$string`; my $newtext = `cat /tmp/TEXT.$string | grep -v "^\\;"`;
unlink("/tmp/TEXT.$string"); unlink("/tmp/TEXT.$string");
return $newtext; return $newtext;
} }
...@@ -167,9 +173,9 @@ if ($opts{askall}) { ...@@ -167,9 +173,9 @@ if ($opts{askall}) {
$opts{hash} = getfield("GIT Hash: ", $opts{hash}); $opts{hash} = getfield("GIT Hash: ", $opts{hash});
if ($opts{noedit}) { if ($opts{noedit}) {
$opts{desc} = getfield("Description: ", $opts{desc}); $opts{desc} = getfield("Description: ", $opts{desc}, $desc_head);
} else { } else {
$opts{desc} = get_text($opts{desc}); $opts{desc} = get_text($opts{desc}, $desc_head);
} }
} }
...@@ -177,7 +183,7 @@ if (!$opts{desc}) { ...@@ -177,7 +183,7 @@ if (!$opts{desc}) {
if ($opts{noedit}) { if ($opts{noedit}) {
$opts{desc} = getfield("Description: ", $opts{desc}); $opts{desc} = getfield("Description: ", $opts{desc});
} else { } else {
$opts{desc} = get_text($opts{desc}); $opts{desc} = get_text($opts{desc}, $desc_head);
} }
if (!$opts{desc}) { if (!$opts{desc}) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论