+ return ($new_upstream, $new_upstream_version);
+}
+
+sub cmd_new_upstream () {
+ # automatically and unconditionally launders before rebasing
+ # if rebase --abort is used, laundering has still been done
+
+ my %pieces;
+
+ badusage "need NEW-VERSION [UPS-COMMITTISH]" unless @ARGV >= 1;
+
+ # parse args - low commitment
+ my $spec_version = shift @ARGV;
+ my $new_version = (new Dpkg::Version $spec_version, check => 1);
+ fail "bad version number \`$spec_version'" unless defined $new_version;
+ if ($new_version->is_native()) {
+ $new_version = (new Dpkg::Version "$spec_version-1", check => 1);
+ }
+
+ my $new_upstream = shift @ARGV;
+ my $new_upstream_version;
+ ($new_upstream, $new_upstream_version) =
+ resolve_upstream_version $new_upstream, $new_version;
+