|
|
@ -1,5 +1,7 @@ |
|
|
|
import os |
|
|
|
import os |
|
|
|
import subprocess |
|
|
|
import subprocess |
|
|
|
|
|
|
|
from selfdrive.swaglog import cloudlog |
|
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")) as _versionf: |
|
|
|
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")) as _versionf: |
|
|
|
version = _versionf.read().split('"')[1] |
|
|
|
version = _versionf.read().split('"')[1] |
|
|
|
|
|
|
|
|
|
|
@ -12,9 +14,18 @@ try: |
|
|
|
branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip() |
|
|
|
branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip() |
|
|
|
branch = 'origin/' + branch |
|
|
|
branch = 'origin/' + branch |
|
|
|
dirty = subprocess.call(["git", "diff-index", "--quiet", branch, "--"]) != 0 |
|
|
|
dirty = subprocess.call(["git", "diff-index", "--quiet", branch, "--"]) != 0 |
|
|
|
|
|
|
|
if dirty: |
|
|
|
|
|
|
|
dirty_files = subprocess.check_output(["git", "diff-index", "--name-only", branch, "--"]) |
|
|
|
|
|
|
|
commit = subprocess.check_output(["git", "rev-parse", "--verify", "HEAD"]).rstrip() |
|
|
|
|
|
|
|
origin_commit = subprocess.check_output(["git", "rev-parse", "--verify", branch]).rstrip() |
|
|
|
|
|
|
|
cloudlog.event("dirty comma branch", vesion=version, dirty=dirty, origin=origin, branch=branch, dirty_files=dirty_files, commit=commit, origin_commit=origin_commit) |
|
|
|
else: |
|
|
|
else: |
|
|
|
dirty = True |
|
|
|
dirty = True |
|
|
|
except subprocess.CalledProcessError: |
|
|
|
except subprocess.CalledProcessError: |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
cloudlog.exception("git subprocess failed while finding version") |
|
|
|
|
|
|
|
except: |
|
|
|
|
|
|
|
pass |
|
|
|
dirty = True |
|
|
|
dirty = True |
|
|
|
|
|
|
|
|
|
|
|
# put this here |
|
|
|
# put this here |
|
|
|