chiark / gitweb /
Ordering improvement in push: don't add dsc field until git push done.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 12:21:31 +0000 (13:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 12:21:31 +0000 (13:21 +0100)
debian/changelog
dgit

index dc9e5ab..af327be 100644 (file)
@@ -7,6 +7,7 @@ dgit (0.4) experimental; urgency=low
   * Much better error messages.
   * Better error checking when parsing RFC822-style control data.
   * Better checking that the supplied .dsc and debian/changes correspond.
+  * Ordering improvement in push: don't add dsc field until git push done.
 
  --
 
diff --git a/dgit b/dgit
index fcc792d..7f13eec 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -761,11 +761,6 @@ sub dopush () {
 #        (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}_c$version_*.changes";
        my @cs = glob "../$pat";
@@ -779,6 +774,11 @@ sub dopush () {
        create_remote_git_repo();
     }
     runcmd_ordryrun @git, qw(push),access_giturl(),"HEAD:".rrref();
+    if (!$dryrun) {
+       rename "../$dscfn.tmp","../$dscfn" or die "$dscfn $!";
+    } else {
+       print "[new .dsc left in $dscfn.tmp]\n";
+    }
     if ($sign) {
        my @tag_cmd = (@git, qw(tag -s -m),
                       "Release $dversion for $csuite [dgit]");