+
+sub push () {
+ runcmd qw(git diff --quiet HEAD);
+ my $clogp = parsechangelog();
+ $package = $clogp->{Source};
+ my $dscfn = "${package}_$clogp->{Version}.dsc";
+ stat $dscfn or die "$dscfn $!";
+ $dsc = parsecontrol("../$dscfn");
+ prep_ud();
+ chdir $ud or die $!;
+ print "checking that $dscfn corresponds to HEAD\n";
+ runcmd qw(dpkg-source -x --), "../../../../$dscfn";
+ my $tree = mktree_in_ud_from_only_subdir();
+ chdir '../../../..' or die $!;
+ runcmd qw(git diff --exit-code), $tree;
+ runcmd qw(git fetch), $alioth_git,
+ map { "$_:refs/remotes/$remotename/$_" }
+ (mainbranch(), uploadbranch());
+ die <<END;
+ if (!is_fast_fwd(mainbranch
+xxx introduce remote_lref
+xxx use remote_lref everywhere
+
+fetch from alioth
+do fast forward check and maybe fake merge
+push to uploading
+dput
+push to main
+END
+}
+
+sub cmd_clone {
+ if (@ARGV==1) {
+ ($package) = @ARGV;
+ } elsif (@ARGV==2) {
+ ($package,$suite) = @ARGV;
+ } else {
+ die;
+ }
+ clone();
+}
+
+sub parseopts () {
+ die if @ARGV && $ARGV[0] =~ m/^\-/;
+}
+
+parseopts();
+die unless @ARGV;
+my $cmd = shift @ARGV;
+parseopts();
+
+{ no strict qw(refs); &{"cmd_$cmd"}(); }