From cc79f092ba098543d253884dc9dc2be3c30cd282 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 26 Sep 2010 11:46:01 -0700 Subject: autobuild: exit immediately if no changes from master we don't need to test master in autobuild --- script/autobuild.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/script/autobuild.py b/script/autobuild.py index f75ccd7fff..856ea625e5 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -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) -- cgit