chiark / gitweb /
Easier multiline strings
[fdroidserver.git] / fdroidserver / common.py
index e2e64cebe4d253009d4b88f426d3f0244ccd7df5..bdc6da2e5fa80e0f8ccb6d8aad336bfee9e01c9d 100644 (file)
@@ -351,7 +351,9 @@ class vcs:
                     writeback = False
                 else:
                     deleterepo = True
-                    logging.info("Repository details changed - deleting")
+                    logging.info(
+                        "Repository details for {0} changed - deleting"
+                        .format(self.local))
             else:
                 deleterepo = True
                 logging.info("Repository details missing - deleting")
@@ -434,8 +436,9 @@ class vcs_git(vcs):
                 if p.returncode != 0:
                     raise VCSException("Git fetch failed")
                 self.refreshed = True
-        # Check out the appropriate revision
-        rev = str(rev if rev else 'origin/master')
+        # origin/HEAD is the HEAD of the remote, e.g. the "default branch" on
+        # a github repo. Most of the time this is the same as origin/master.
+        rev = str(rev if rev else 'origin/HEAD')
         p = SilentPopen(['git', 'checkout', '-f', rev], cwd=self.local)
         if p.returncode != 0:
             raise VCSException("Git checkout failed")
@@ -480,9 +483,9 @@ class vcs_git(vcs):
 
     def latesttags(self, alltags, number):
         self.checkrepo()
-        p = SilentPopen(['echo "' + '\n'.join(alltags) + '" | \
-                xargs -I@ git log --format=format:"%at @%n" -1 @ | \
-                sort -n | awk \'{print $2}\''],
+        p = SilentPopen(['echo "' + '\n'.join(alltags) + '" | '
+                        + 'xargs -I@ git log --format=format:"%at @%n" -1 @ | '
+                        + 'sort -n | awk \'{print $2}\''],
                         cwd=self.local, shell=True)
         return p.stdout.splitlines()[-number:]