- 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
+ runcmd @git, qw(diff --exit-code), $tree;
+#fetch from alioth
+#do fast forward check and maybe fake merge
+# if (!is_fast_fwd(mainbranch
+# runcmd @git, qw(fetch -p ), "$alioth_git/$package.git",
+# map { lref($_).":".rref($_) }
+# (uploadbranch());
+ $dsc->{$ourdscfield} = rev_parse('HEAD');
+ $dsc->save("../$dscfn.tmp") or die $!;
+ if (!$dryrun) {
+ rename "../$dscfn.tmp","../$dscfn" or die "$dscfn $!";
+ } else {
+ print "[new .dsc left in $dscfn.tmp]\n";
+ }
+ if (!$changesfile) {
+ my $pat = "../${package}_$clogp->{Version}_*.changes";
+ my @cs = glob $pat;
+ die "$pat ?" unless @cs==1;
+ ($changesfile) = @cs;
+ }
+ my $tag = debiantag($dsc->{Version});
+ if (!check_for_git()) {
+ create_remote_git_repo();
+ }
+ runcmd_ordryrun @git, qw(push),access_giturl(),"HEAD:".rrref();
+ if ($sign) {
+ my @tag_cmd = (@git, qw(tag -s -m),
+ "Release $dsc->{Version} for $suite [dgit]");
+ push @tag_cmd, qw(-u),$keyid if defined $keyid;
+ push @tag_cmd, $tag;
+ runcmd_ordryrun @tag_cmd;
+ my @debsign_cmd = @debsign;
+ push @debsign_cmd, "-k$keyid" if defined $keyid;
+ push @debsign_cmd, $changesfile;
+ runcmd_ordryrun @debsign_cmd;
+ }
+ runcmd_ordryrun @git, qw(push),access_giturl(),"refs/tags/$tag";
+ my $host = access_cfg('upload-host');
+ my @hostarg = defined($host) ? ($host,) : ();
+ runcmd_ordryrun @dput, @hostarg, $changesfile;
+ print "dgit ok: pushed and uploaded $dsc->{Version}\n";