mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Remove deadcode from depot_tools scripts
Removing some deadcode from depot_tools scripts. More follow-up CLs will be made after this to remove more dead code. R=sokcevic,gavinmak Change-Id: Iad20e9e1737e49c1370248d32c6317cf2be63de4 Bug: 1475776 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811216 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
committed by
LUCI CQ
parent
c1c1fb626b
commit
ed935cf29b
2
fetch.py
2
fetch.py
@@ -24,10 +24,8 @@ import json
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import pipes
|
import pipes
|
||||||
import re
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
|
||||||
|
|
||||||
import git_common
|
import git_common
|
||||||
|
|
||||||
|
|||||||
@@ -128,12 +128,8 @@ class GNException(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def ToGNString(value, allow_dicts = True):
|
def ToGNString(value):
|
||||||
"""Returns a stringified GN equivalent of the Python value.
|
"""Returns a stringified GN equivalent of the Python value."""
|
||||||
|
|
||||||
allow_dicts indicates if this function will allow converting dictionaries
|
|
||||||
to GN scopes. This is only possible at the top level, you can't nest a
|
|
||||||
GN scope in a list, so this should be set to False for recursive calls."""
|
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
if value.find('\n') >= 0:
|
if value.find('\n') >= 0:
|
||||||
raise GNException("Trying to print a string with a newline in it.")
|
raise GNException("Trying to print a string with a newline in it.")
|
||||||
|
|||||||
@@ -1359,7 +1359,7 @@ class GitWrapper(SCMWrapper):
|
|||||||
os.path.isdir(os.path.join(g, "rebase-merge")) or
|
os.path.isdir(os.path.join(g, "rebase-merge")) or
|
||||||
os.path.isdir(os.path.join(g, "rebase-apply")))
|
os.path.isdir(os.path.join(g, "rebase-apply")))
|
||||||
|
|
||||||
def _CheckClean(self, revision, fixup=False):
|
def _CheckClean(self, revision):
|
||||||
lockfile = os.path.join(self.checkout_path, ".git", "index.lock")
|
lockfile = os.path.join(self.checkout_path, ".git", "index.lock")
|
||||||
if os.path.exists(lockfile):
|
if os.path.exists(lockfile):
|
||||||
raise gclient_utils.Error(
|
raise gclient_utils.Error(
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ from __future__ import print_function
|
|||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
import metrics
|
import metrics
|
||||||
import os
|
|
||||||
import subprocess2
|
import subprocess2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import functools
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ class MetricsCollectorTest(unittest.TestCase):
|
|||||||
|
|
||||||
# Patch the methods used to get the system information, so we have a known
|
# Patch the methods used to get the system information, so we have a known
|
||||||
# environment.
|
# environment.
|
||||||
mock.patch('metrics.tempfile.mkstemp',
|
|
||||||
lambda: (None, '/tmp/metrics.json')).start()
|
|
||||||
mock.patch('metrics.time.time',
|
mock.patch('metrics.time.time',
|
||||||
TimeMock()).start()
|
TimeMock()).start()
|
||||||
mock.patch('metrics.metrics_utils.get_python_version',
|
mock.patch('metrics.metrics_utils.get_python_version',
|
||||||
|
|||||||
Reference in New Issue
Block a user