chiark / gitweb /
Do write .fdroidvcs if the clone succeeded
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 9 Jul 2014 08:30:28 +0000 (10:30 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 9 Jul 2014 08:30:28 +0000 (10:30 +0200)
If the clone succeeded but the checkout failed, it didn't. Now it does, by
keeping the exception and raising it a bit later.

fdroidserver/common.py

index c542aa2d765d73ced6feb72b4259a6cd5f09096a..3e241194e3f1785e6f919921211735b3b339b08e 100644 (file)
@@ -406,13 +406,21 @@ class vcs:
         if deleterepo:
             shutil.rmtree(self.local)
 
-        self.gotorevisionx(rev)
+        exc = None
+
+        try:
+            self.gotorevisionx(rev)
+        except FDroidException, e:
+            exc = e
 
         # If necessary, write the .fdroidvcs file.
-        if writeback:
+        if writeback and not self.clone_failed:
             with open(fdpath, 'w') as f:
                 f.write(cdata)
 
+        if exc is not None:
+            raise exc
+
     # Derived classes need to implement this. It's called once basic checking
     # has been performend.
     def gotorevisionx(self, rev):