diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-11 18:45:57 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-11 20:55:29 +0000 |
commit | 1405aa3c39a53ad6364622ecd2e18d892b2a1f09 (patch) | |
tree | d97a94b80ea7f2aae56659496264e2a53ae0453a | |
parent | 632f09ccf1247e6eb3be5741d3bcca39b4aa4430 (diff) |
dgit: Make rpush be a configurable alias like push
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | dgit | 10 | ||||
-rwxr-xr-x | tests/tests/rpush | 2 | ||||
-rwxr-xr-x | tests/tests/rpush-quilt | 2 |
3 files changed, 11 insertions, 3 deletions
@@ -5117,6 +5117,14 @@ sub cmd_push { f_ 'dgit push, but dgit.default.push-subcmd set to %s', $spec }); } +sub cmd_rpush { + some_push_alias('rpush', \&cmd_rpush_source, \&cmd_rpush_built, + [qw(dgit.default.rpush-subcmd + dgit.default.push-subcmd)], sub { + my ($spec) = @_; + f_ 'dgit rpush, but dgit.default.[r]push-subcmd set to %s', $spec + }); +} sub some_push_alias ($$@) { my ($verb, $if_source, $if_built, $cfgs, $badvalue_msg) = @_; my $spec = cfg @$cfgs; @@ -5221,7 +5229,7 @@ sub pre_rpush () { not_necessarily_a_tree(); } sub cmd_rpush_source { rpush_core('push-source'); } sub cmd_rpush_built { rpush_core('push'); } -sub cmd_rpush { cmd_rpush_built; } + sub rpush_core ($) { ($rpush_verb) = @_; diff --git a/tests/tests/rpush b/tests/tests/rpush index 3ccf605..9bff006 100755 --- a/tests/tests/rpush +++ b/tests/tests/rpush @@ -21,7 +21,7 @@ t-dgit --dpkg-buildpackage:-d build mkdir $tmp/empty cd $tmp/empty -t-dgit --ssh=$troot/ssh rpush somehost:$tmp/$p +t-dgit --ssh=$troot/ssh rpush-built somehost:$tmp/$p cd $tmp/$p t-pushed-good dgit/sid diff --git a/tests/tests/rpush-quilt b/tests/tests/rpush-quilt index bb49fc6..aca403a 100755 --- a/tests/tests/rpush-quilt +++ b/tests/tests/rpush-quilt @@ -11,7 +11,7 @@ t-dgit -wgf --quilt=gbp --dgit-view-save=split.b build-source mkdir $tmp/empty cd $tmp/empty t-dgit --quilt=gbp --dgit-view-save=split.p \ - --ssh=$troot/ssh rpush somehost:$tmp/$p + --ssh=$troot/ssh rpush-built somehost:$tmp/$p cd $tmp/$p t-gbp-pushed-good |