ソースを参照

fail gracefully if git rebase-update is called in cog

Bug: 339231299
Change-Id: I2becec27c0b3f8d7b5e70c1eb7fe861c67f33e42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539474
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Yiwei Zhang 1 年間 前
コミット
2ae9ede018
1 ファイル変更7 行追加0 行削除
  1. 7 0
      git_rebase_update.py

+ 7 - 0
git_rebase_update.py

@@ -16,6 +16,7 @@ import os
 from fnmatch import fnmatch
 from fnmatch import fnmatch
 from pprint import pformat
 from pprint import pformat
 
 
+import gclient_utils
 import git_common as git
 import git_common as git
 
 
 STARTING_BRANCH_KEY = 'depot-tools.rebase-update.starting-branch'
 STARTING_BRANCH_KEY = 'depot-tools.rebase-update.starting-branch'
@@ -232,6 +233,12 @@ def rebase_branch(branch, parent, start_hash):
 
 
 
 
 def main(args=None):
 def main(args=None):
+    if gclient_utils.IsEnvCog():
+        print(
+            'rebase-update command is not supported. Please navigate to source '
+            'control view in the activity bar to rebase your changes.',
+            file=sys.stderr)
+        return 1
     parser = argparse.ArgumentParser()
     parser = argparse.ArgumentParser()
     parser.add_argument('--verbose', '-v', action='store_true')
     parser.add_argument('--verbose', '-v', action='store_true')
     parser.add_argument('--keep-going',
     parser.add_argument('--keep-going',