From fa85abfd7c4ab88d05eb0f9099e4704297d34a8c Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 13 May 2024 18:45:22 +0000 Subject: [PATCH] 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 Auto-Submit: Yiwei Zhang Commit-Queue: Josip Sokcevic --- gclient.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gclient.py b/gclient.py index fa85aca88..3f7ef8727 100755 --- a/gclient.py +++ b/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',