summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Frécinaux <code@istique.net>2007-01-08 03:07:37 (GMT)
committerSteve Frécinaux <code@istique.net>2007-01-08 03:07:37 (GMT)
commit1aa5ca46b499f598f6c993f9313f1c55ee1f0b52 (patch)
treed42099f0ff6bbdc6c954ea1ed47f1db2420b2692
parentc6b7c003531c25dae9bbf8d454589169a0e6a4f9 (diff)
downloadgit-bugzilla-1aa5ca46b499f598f6c993f9313f1c55ee1f0b52.tar.gz
git-bugzilla-1aa5ca46b499f598f6c993f9313f1c55ee1f0b52.tar.xz
Add --dry-run capability
-rwxr-xr-xgit-send-bugzilla.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-send-bugzilla.pl b/git-send-bugzilla.pl
index af3e3fe..03783d2 100755
--- a/git-send-bugzilla.pl
+++ b/git-send-bugzilla.pl
@@ -56,6 +56,7 @@ my $since = "";
my $until = "";
my $numbered = 0;
my $start_number = 1;
+my $dry_run = 0;
my $help = 0;
# Parse options
@@ -64,9 +65,10 @@ GetOptions("bug|b=i" => \$bugid,
"password|p=s" => \$password,
"numbered|n" => \$numbered,
"start-number" => \$start_number,
- "help|h|?" => $help);
+ "dry-run" => \$dry_run,
+ "help|h|?" => \$help);
-print <<EOF and exit(!$help) unless ($bugid > 0 and $username and $password and !$help);
+print <<EOF and exit !$help unless $dry_run or ($bugid > 0 and $username and $password) and !$help;
Usage: git-send-bugzilla [options] <since>[..<until>]
Options:
@@ -94,7 +96,7 @@ close REVLIST;
die "No patch to send\n" if @revisions eq 0;
-authenticate $username, $password;
+authenticate $username, $password unless $dry_run;
print "Attaching patches...\n";
my $i = $start_number;
@@ -119,7 +121,7 @@ for my $rev (@revisions) {
print " - $description\n";
- add_attachment $bugid, $patch, $description, $comment;
+ add_attachment $bugid, $patch, $description, $comment unless $dry_run;
$i++;
}