Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: tools/clang/scripts/upload_revision.py

Issue 2324553003: Try to get clang upload script working on Windows. (Closed)
Patch Set: tweak Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
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: tools/clang/scripts/upload_revision.py
diff --git a/tools/clang/scripts/upload_revision.py b/tools/clang/scripts/upload_revision.py
index b6331df6cdb55a00a4b027da7179de3ba59498fb..8a7994e25519f4ebc291d3a00548c2e4ad6c4c24 100755
--- a/tools/clang/scripts/upload_revision.py
+++ b/tools/clang/scripts/upload_revision.py
@@ -21,9 +21,10 @@ THIS_DIR = os.path.dirname(__file__)
UPDATE_PY_PATH = os.path.join(THIS_DIR, "update.py")
CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..'))
+is_win = sys.platform.startswith('win32')
def PatchRevision(clang_revision, clang_sub_revision):
- with open(UPDATE_PY_PATH, 'r') as f:
+ with open(UPDATE_PY_PATH, 'rb') as f:
content = f.read()
m = re.search("CLANG_REVISION = '([0-9]+)'", content)
clang_old_revision = m.group(1)
@@ -33,13 +34,14 @@ def PatchRevision(clang_revision, clang_sub_revision):
content = re.sub("CLANG_SUB_REVISION=[0-9]+",
"CLANG_SUB_REVISION={}".format(clang_sub_revision),
content, count=1)
- with open(UPDATE_PY_PATH, 'w') as f:
+ with open(UPDATE_PY_PATH, 'wb') as f:
f.write(content)
return clang_old_revision
def Git(args):
- subprocess.check_call(["git"] + args)
+ # Needs shell=True on Windows due to git.bat in depot_tools.
+ subprocess.check_call(["git"] + args, shell=is_win)
def main():
parser = argparse.ArgumentParser(description='upload new clang revision')
@@ -54,8 +56,9 @@ def main():
clang_revision = args.clang_revision[0]
clang_sub_revision = args.clang_sub_revision
+ # Needs shell=True on Windows due to git.bat in depot_tools.
git_revision = subprocess.check_output(
- ["git", "rev-parse", "origin/master"]).strip()
+ ["git", "rev-parse", "origin/master"], shell=is_win).strip()
print "Making a patch for Clang revision r{}-{}".format(
clang_revision, clang_sub_revision)
print "Chrome revision: {}".format(git_revision)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698