diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-02 21:15:15 -0700 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-07-26 22:52:28 +0100 |
commit | dfe552723d6904f4a16a95d5a13fdec43cbb10c8 (patch) | |
tree | c5929951b303224d275d1fb0560c59c54185e52b | |
parent | c5fa3c2b04ef704afb6273a8d25f060e4fff96ad (diff) |
cmd_push: Factor out all prep code
Will be re-used by cmd_push_source.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | dgit | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -4492,9 +4492,9 @@ END pull(); } -sub cmd_push { +sub prep_push () { parseopts(); - badusage "-p is not allowed with dgit push" if defined $package; + badusage "-p is not allowed with dgit $subcommand" if defined $package; check_not_dirty(); my $clogp = parsechangelog(); $package = getfield $clogp, 'Source'; @@ -4503,7 +4503,7 @@ sub cmd_push { } elsif (@ARGV==1) { ($specsuite) = (@ARGV); } else { - badusage "incorrect arguments to dgit push"; + badusage "incorrect arguments to dgit $subcommand"; } $isuite = getfield $clogp, 'Distribution'; pushing(); @@ -4516,9 +4516,13 @@ sub cmd_push { if (defined $specsuite && $specsuite ne $isuite && $specsuite ne $csuite) { - fail "dgit push: changelog specifies $isuite ($csuite)". + fail "dgit $subcommand: changelog specifies $isuite ($csuite)". " but command line specifies $specsuite"; } +} + +sub cmd_push { + prep_push(); dopush(); } |