Browse Source

Use git log to look at commit changes

Hamilton Turner 11 years ago
parent
commit
e927fa542b
1 changed files with 5 additions and 11 deletions
  1. 5 11
      toolset/run-ci.py

+ 5 - 11
toolset/run-ci.py

@@ -39,15 +39,9 @@ class CIRunnner:
     self.mode = mode
     self.mode = mode
 
 
     try:
     try:
-      is_pull_req = (os.environ['TRAVIS_PULL_REQUEST'] != "false")
-      if is_pull_req:
-        # For pull requests, this is the Github auto-merge commit
-        # which is exactly what we want to see
-        self.commit_range = os.environ['TRAVIS_COMMIT']
-      else:  
-        self.commit_range = os.environ['TRAVIS_COMMIT_RANGE']
-        if self.commit_range == "":
-          self.commit_range = os.environ['TRAVIS_COMMIT']
+      self.commit_range = os.environ['TRAVIS_COMMIT_RANGE']
+      if self.commit_range == "":
+          self.commit_range = "-1 %s" % os.environ['TRAVIS_COMMIT']
     except KeyError:
     except KeyError:
       log.warning("I should only be used for automated integration tests e.g. Travis-CI")
       log.warning("I should only be used for automated integration tests e.g. Travis-CI")
       log.warning("Were you looking for run-tests.py?")
       log.warning("Were you looking for run-tests.py?")
@@ -107,8 +101,8 @@ class CIRunnner:
       open(fname, 'a').close()
       open(fname, 'a').close()
 
 
     log.info("Using commit range %s", self.commit_range)
     log.info("Using commit range %s", self.commit_range)
-    log.info("Running `git diff --name-only %s`" % self.commit_range)
-    changes = subprocess.check_output("git diff --name-only %s" % self.commit_range, shell=True)
+    log.info("Running `git log --name-only -m --pretty=\"format:\" %s`" % self.commit_range)
+    changes = subprocess.check_output("git log --name-only -m --pretty=\"format:\" %s" % self.commit_range, shell=True)
     log.info(changes)
     log.info(changes)
 
 
     # Look for changes to core TFB framework code
     # Look for changes to core TFB framework code