Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: recipe_modules/gclient/test_api.py

Issue 2286793003: Remove all references to GIT_MODE from depot_tools (Closed)
Patch Set: Slightly cleaner Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_modules/gclient/example.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/gclient/test_api.py
diff --git a/recipe_modules/gclient/test_api.py b/recipe_modules/gclient/test_api.py
index 499651bbc6366740c528c4c6ec0e6634bb24a390..58d678419b4146e162433a74f3b8735b67011455 100644
--- a/recipe_modules/gclient/test_api.py
+++ b/recipe_modules/gclient/test_api.py
@@ -7,13 +7,12 @@ import hashlib
from recipe_engine import recipe_test_api
class GclientTestApi(recipe_test_api.RecipeTestApi):
- def output_json(self, projects, git_mode=False):
+ def output_json(self, projects):
"""Deterministically synthesize json.output test data for gclient's
--output-json option.
Args:
projects - a list of project paths (e.g. ['src', 'src/dependency'])
- git_mode - Return git hashes instead of svn revs.
"""
# TODO(iannucci): Account for parent_got_revision_mapping. Right now the
# synthesized json output from this method will always use
@@ -21,17 +20,13 @@ class GclientTestApi(recipe_test_api.RecipeTestApi):
# specified, we should use those values instead.
return self.m.json.output({
'solutions': dict(
- (p+'/', {'revision': self.gen_revision(p, git_mode)})
+ (p+'/', {'revision': self.gen_revision(p)})
for p in projects
)
})
@staticmethod
- def gen_revision(project, GIT_MODE):
+ def gen_revision(project):
"""Hash project to bogus deterministic revision values."""
h = hashlib.sha1(project)
- if GIT_MODE:
- return h.hexdigest()
- else: # pragma: no cover
- import struct
- return struct.unpack('!I', h.digest()[:4])[0] % 300000
+ return h.hexdigest()
« no previous file with comments | « recipe_modules/gclient/example.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698