Commit 2806acc5 authored by maruel@chromium.org's avatar maruel@chromium.org

Remove two seams options.gclient and options.scm_wrapper in gclient.

Review URL: http://codereview.chromium.org/115322

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16155 0039d316-1c4b-4281-b951-d872f2087c98
parent e08149a2
...@@ -970,7 +970,7 @@ class GClient(object): ...@@ -970,7 +970,7 @@ class GClient(object):
if not next[1]: if not next[1]:
return None return None
path = next[0] path = next[0]
client = options.gclient(path, options) client = GClient(path, options)
client._LoadConfig() client._LoadConfig()
return client return client
...@@ -1168,8 +1168,7 @@ class GClient(object): ...@@ -1168,8 +1168,7 @@ class GClient(object):
raise Error( raise Error(
"relative DEPS entry \"%s\" must begin with a slash" % d) "relative DEPS entry \"%s\" must begin with a slash" % d)
# Create a scm just to query the full url. # Create a scm just to query the full url.
scm = self._options.scm_wrapper(solution["url"], self._root_dir, scm = SCMWrapper(solution["url"], self._root_dir, None)
None)
url = scm.FullUrlForRelativeUrl(url) url = scm.FullUrlForRelativeUrl(url)
if d in deps and deps[d] != url: if d in deps and deps[d] != url:
raise Error( raise Error(
...@@ -1280,7 +1279,7 @@ class GClient(object): ...@@ -1280,7 +1279,7 @@ class GClient(object):
entries[name] = url entries[name] = url
if run_scm: if run_scm:
self._options.revision = revision_overrides.get(name) self._options.revision = revision_overrides.get(name)
scm = self._options.scm_wrapper(url, self._root_dir, name) scm = SCMWrapper(url, self._root_dir, name)
scm.RunCommand(command, self._options, args, file_list) scm.RunCommand(command, self._options, args, file_list)
self._options.revision = None self._options.revision = None
try: try:
...@@ -1305,7 +1304,7 @@ class GClient(object): ...@@ -1305,7 +1304,7 @@ class GClient(object):
entries[d] = url entries[d] = url
if run_scm: if run_scm:
self._options.revision = revision_overrides.get(d) self._options.revision = revision_overrides.get(d)
scm = self._options.scm_wrapper(url, self._root_dir, d) scm = SCMWrapper(url, self._root_dir, d)
scm.RunCommand(command, self._options, args, file_list) scm.RunCommand(command, self._options, args, file_list)
self._options.revision = None self._options.revision = None
...@@ -1322,7 +1321,7 @@ class GClient(object): ...@@ -1322,7 +1321,7 @@ class GClient(object):
entries[d] = url entries[d] = url
if run_scm: if run_scm:
self._options.revision = revision_overrides.get(d) self._options.revision = revision_overrides.get(d)
scm = self._options.scm_wrapper(url, self._root_dir, d) scm = SCMWrapper(url, self._root_dir, d)
scm.RunCommand(command, self._options, args, file_list) scm.RunCommand(command, self._options, args, file_list)
self._options.revision = None self._options.revision = None
...@@ -1464,7 +1463,7 @@ def DoCleanup(options, args): ...@@ -1464,7 +1463,7 @@ def DoCleanup(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
if options.verbose: if options.verbose:
...@@ -1491,7 +1490,7 @@ def DoConfig(options, args): ...@@ -1491,7 +1490,7 @@ def DoConfig(options, args):
if os.path.exists(options.config_filename): if os.path.exists(options.config_filename):
raise Error("%s file already exists in the current directory" % raise Error("%s file already exists in the current directory" %
options.config_filename) options.config_filename)
client = options.gclient('.', options) client = GClient('.', options)
if options.spec: if options.spec:
client.SetConfig(options.spec) client.SetConfig(options.spec)
else: else:
...@@ -1524,7 +1523,7 @@ def DoStatus(options, args): ...@@ -1524,7 +1523,7 @@ def DoStatus(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
if options.verbose: if options.verbose:
...@@ -1541,7 +1540,7 @@ def DoUpdate(options, args): ...@@ -1541,7 +1540,7 @@ def DoUpdate(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
...@@ -1579,7 +1578,7 @@ def DoDiff(options, args): ...@@ -1579,7 +1578,7 @@ def DoDiff(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
if options.verbose: if options.verbose:
...@@ -1596,7 +1595,7 @@ def DoRevert(options, args): ...@@ -1596,7 +1595,7 @@ def DoRevert(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
return client.RunOnDeps('revert', args) return client.RunOnDeps('revert', args)
...@@ -1608,7 +1607,7 @@ def DoRunHooks(options, args): ...@@ -1608,7 +1607,7 @@ def DoRunHooks(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
if options.verbose: if options.verbose:
...@@ -1624,7 +1623,7 @@ def DoRevInfo(options, args): ...@@ -1624,7 +1623,7 @@ def DoRevInfo(options, args):
Raises: Raises:
Error: if client isn't configured properly. Error: if client isn't configured properly.
""" """
client = options.gclient.LoadCurrentConfig(options) client = GClient.LoadCurrentConfig(options)
if not client: if not client:
raise Error("client not configured; see 'gclient config'") raise Error("client not configured; see 'gclient config'")
client.PrintRevInfo() client.PrintRevInfo()
...@@ -1713,8 +1712,6 @@ def Main(argv): ...@@ -1713,8 +1712,6 @@ def Main(argv):
options.entries_filename = ".gclient_entries" options.entries_filename = ".gclient_entries"
options.deps_file = "DEPS" options.deps_file = "DEPS"
options.gclient = GClient
options.scm_wrapper = SCMWrapper
options.platform = sys.platform options.platform = sys.platform
return DispatchCommand(command, options, args) return DispatchCommand(command, options, args)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment