ソースを参照

gclient: error if revert command is called in cog env

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

+ 7 - 2
gclient.py

@@ -3923,8 +3923,13 @@ def CMDdiff(parser, args):
 def CMDrevert(parser, args):
     """Reverts all modifications in every dependencies.
 
-    That's the nuclear option to get back to a 'clean' state. It removes anything
-    that shows up in git status."""
+    That's the nuclear option to get back to a 'clean' state. It removes
+    anything that shows up in git status."""
+    if gclient_utils.IsEnvCog():
+        raise gclient_utils.Error(
+            'gclient revert command is not supported. Please navigate to '
+            'source control view in the activiy bar to discard changes '
+            'instead.')
     parser.add_option('--deps',
                       dest='deps_os',
                       metavar='OS_LIST',