소스 검색

fail if fetch command is called in Cog

Bug: 345486495
Change-Id: I858a4041b54049cc52cf1a15f0aed461f3ddf985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5606279
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Yiwei Zhang 1 년 전
부모
커밋
aa89e07e15
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      fetch.py

+ 7 - 0
fetch.py

@@ -24,6 +24,7 @@ import shlex
 import subprocess
 import sys
 
+import gclient_utils
 import git_common
 
 from distutils import spawn
@@ -270,6 +271,12 @@ def run(options, spec, root):
             method (checkout type, repository url, etc.).
         root: The directory into which the repo expects to be checkout out.
     """
+    if gclient_utils.IsEnvCog():
+        print(
+            'Your current directory appears to be in a Cog workspace.'
+            '"fetch" command is not supported in this environment.',
+            file=sys.stderr)
+        return 1
     assert 'type' in spec
     checkout_type = spec['type']
     checkout_spec = spec['%s_spec' % checkout_type]