Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerChrome.py

Issue 30062555: Noissue - Add '.revision'-file to devbuilds
Patch Set: Created Oct. 11, 2019, 11:48 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index 42fff4d8d908559a8bb08a0591a7fbdfa6a1a1dd..1845c2e7b980ce427585da6a3e04ebcaa861a7fe 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -354,6 +354,12 @@ def add_devenv_requirements(files, metadata, params):
)
+def add_revision_file(base_dir, files):
+ if os.path.exists(os.path.join(base_dir, '.git')):
+ cmd = ['git', 'rev-parse', 'HEAD']
+ files['.revision'] = subprocess.check_output(cmd, cwd=base_dir).strip()
+
+
def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuild=False, keyFile=None, devenv=False):
metadata = readMetadata(baseDir, type)
version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum)
@@ -392,6 +398,10 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
import_locales(params, files)
files['manifest.json'] = createManifest(params, files)
+
+ if not releaseBuild and not devenv:
+ add_revision_file(baseDir, files)
Sebastian Noack 2019/10/11 21:18:43 Splitting this out into a function seems unnecessa
tlucas 2019/10/14 12:14:54 Done.
+
if type == 'chrome':
fix_translations_for_chrome(files)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld