aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/rebaseline
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-10-31 10:14:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-31 14:37:14 +0000
commitee6784d268567bb82a47b00ab7f35802f878c1a9 (patch)
treea20c5444aace8099040384003309623aec304a72 /tools/rebaseline
parent7484dbd1df5a172ab558189f906940f26f2fa7e4 (diff)
Reuse more upload_to_android and allow removing flag on Android
Bug: skia: Change-Id: I8c84b63d01ead32bf4aa71550f6fa84ddfcf480f Reviewed-on: https://skia-review.googlesource.com/63743 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'tools/rebaseline')
-rw-r--r--tools/rebaseline/add_legacy_flag.py30
1 files changed, 2 insertions, 28 deletions
diff --git a/tools/rebaseline/add_legacy_flag.py b/tools/rebaseline/add_legacy_flag.py
index 0775d8ac5d..8a99e517b6 100644
--- a/tools/rebaseline/add_legacy_flag.py
+++ b/tools/rebaseline/add_legacy_flag.py
@@ -43,37 +43,11 @@ def insert_at(filename, pattern, offset, content):
def add_to_android(args):
- REPO_BRANCH_NAME = "flag"
sys.path.append(ANDROID_TOOLS_DIR)
import upload_to_android
- repo_binary = upload_to_android.init_work_dir(args.android_dir);
-
- # Create repo branch.
- subprocess.check_call('%s start %s .' % (repo_binary, REPO_BRANCH_NAME),
- shell=True)
-
- try:
- # Add flag to SkUserConfigManual.h.
- config_file = os.path.join('include', 'config', 'SkUserConfigManual.h')
-
- insert_at(config_file,
- "#endif // SkUserConfigManual_DEFINED\n",
- 0,
- " #define %s\n" % args.flag)
-
- subprocess.check_call('git add %s' % config_file, shell=True)
-
- message = ('Add %s\n\n'
- 'Test: Presubmit checks will test this change.' % args.flag)
-
- subprocess.check_call('git commit -m "%s"' % message, shell=True)
-
- # Upload to Android Gerrit.
- subprocess.check_call('%s upload --verify' % repo_binary, shell=True)
- finally:
- # Remove repo branch
- subprocess.check_call('%s abandon flag' % repo_binary, shell=True)
+ modifier = upload_to_android.AndroidLegacyFlagModifier(args.flag)
+ upload_to_android.upload_to_android(args.android_dir, modifier)
def add_to_chromium(args):