autobuild: exit immediately if no changes from master
authorAndrew Tridgell <tridge@samba.org>
Sun, 26 Sep 2010 18:46:01 +0000 (11:46 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 26 Sep 2010 19:51:02 +0000 (19:51 +0000)
we don't need to test master in autobuild

script/autobuild.py

index f75ccd7fffbb16c94ffcd4e9d7b849c45d81717e..856ea625e538e940fafd15c4bd7b861d804d6436 100755 (executable)
@@ -72,13 +72,17 @@ retry_task = [ '''set -e
                 done
                ''' % samba_master]
 
-def run_cmd(cmd, dir=".", show=None):
+def run_cmd(cmd, dir=".", show=None, output=False):
     cwd = os.getcwd()
     os.chdir(dir)
     if show is None:
         show = options.verbose
     if show:
         print("Running: '%s' in '%s'" % (cmd, dir))
+    if output:
+        ret = Popen([cmd], shell=True, stdout=PIPE).communicate()[0]
+        os.chdir(cwd)
+        return ret
     ret = os.system(cmd)
     os.chdir(cwd)
     if ret != 0:
@@ -254,6 +258,10 @@ def rebase_tree(url):
         run_cmd("git rebase --whitespace=fix master/master", show=True, dir=test_master)
     else:
         run_cmd("git rebase master/master", show=True, dir=test_master)
+    diff = run_cmd("git --no-pager diff HEAD master/master", dir=test_master, output=True)
+    if diff == '':
+        print("No differences between HEAD and master/master - exiting")
+        sys.exit(0)
 
 def push_to(url):
     print("Pushing to %s" % url)