From 190a725b60c19cac977a132122b6222667b9a3fb Mon Sep 17 00:00:00 2001 From: Diego Wilson Date: Thu, 14 Sep 2017 15:50:17 -0700 Subject: [PATCH] repo_diff: sync tip of branches of no tag is given Not all Android source trees support build IDs and tags. When no build tag is requested, rather than try to match the build IDs just sync the branch tips of the upstream and downstream source trees. Also select two Android Oreo release candidates as the default branches. The fact that there are frozen branches and that the diff is small serve as a good showcase of the tool. Change-Id: Ifdefd79fb6b32c6b83e0aee390dd5a435b6a61fc --- tools/repo_diff/repo_diff_android.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/repo_diff/repo_diff_android.py b/tools/repo_diff/repo_diff_android.py index 5074ff54f..7868df27a 100644 --- a/tools/repo_diff/repo_diff_android.py +++ b/tools/repo_diff/repo_diff_android.py @@ -20,9 +20,9 @@ DOWNSTREAM_WORKSPACE = "downstream" UPSTREAM_WORKSPACE = "upstream" DEFAULT_MANIFEST_URL = "https://android.googlesource.com/platform/manifest" -DEFAULT_MANIFEST_BRANCH = "oreo-dev" +DEFAULT_MANIFEST_BRANCH = "android-8.0.0_r10" DEFAULT_UPSTREAM_MANIFEST_URL = "https://android.googlesource.com/platform/manifest" -DEFAULT_UPSTREAM_MANIFEST_BRANCH = "master" +DEFAULT_UPSTREAM_MANIFEST_BRANCH = "android-8.0.0_r1" SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) DEFAULT_EXCLUSIONS_FILE = os.path.join(SCRIPT_DIR, "exclusions.txt") @@ -118,6 +118,8 @@ def repo_sync_specific_release(url, branch, tag, workspace): repo_init(url, branch, workspace) if tag: rev = get_commit_with_keyword(manifest_path, tag) + if not rev: + raise(ValueError("could not find a manifest revision for tag " + tag)) repo_init(url, rev, workspace) repo_sync(workspace) @@ -135,8 +137,12 @@ def diff(manifest_url, manifest_branch, tag, upstream_manifest_url, tag, workspace) - # get the build_id so that we know which rev of upstream we need - build_id = get_build_id(workspace) + build_id = None + if tag: + # get the build_id so that we know which rev of upstream we need + build_id = get_build_id(workspace) + if not build_id: + raise(ValueError("Error: could not find the Build ID of " + workspace)) # repo sync upstream source tree repo_sync_specific_release(