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

Side by Side Diff: scripts/slave/recipe_modules/commit_position/api.py

Issue 1151423002: Move recipe engine to third_party/recipe_engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Moved field_composer_test with its buddies Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 from slave import recipe_api 7 from recipe_engine import recipe_api
8 8
9 9
10 class CommitPositionApi(recipe_api.RecipeApi): 10 class CommitPositionApi(recipe_api.RecipeApi):
11 """Recipe module providing commit position parsing and manipulation.""" 11 """Recipe module providing commit position parsing and manipulation."""
12 RE_COMMIT_POSITION = re.compile('(?P<branch>.+)@{#(?P<revision>\d+)}') 12 RE_COMMIT_POSITION = re.compile('(?P<branch>.+)@{#(?P<revision>\d+)}')
13 COMMIT_POS_STR = 'Cr-Commit-Position: refs/heads/master@{#%d}' 13 COMMIT_POS_STR = 'Cr-Commit-Position: refs/heads/master@{#%d}'
14 14
15 @classmethod 15 @classmethod
16 def parse(cls, value): 16 def parse(cls, value):
17 match = cls.RE_COMMIT_POSITION.match(value) 17 match = cls.RE_COMMIT_POSITION.match(value)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 stdout=self.m.raw_io.output(), 70 stdout=self.m.raw_io.output(),
71 name='resolving hash ' + sha) 71 name='resolving hash ' + sha)
72 try: 72 try:
73 result = int(self.parse_revision(str(step_result.stdout))) 73 result = int(self.parse_revision(str(step_result.stdout)))
74 except ValueError: 74 except ValueError:
75 raise self.m.step.StepFailure( 75 raise self.m.step.StepFailure(
76 'Could not parse commit position from git output: ' + 76 'Could not parse commit position from git output: ' +
77 (step_result.stdout or '')) 77 (step_result.stdout or ''))
78 return result 78 return result
79 79
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/chromium_tests/test_api.py ('k') | scripts/slave/recipe_modules/commit_position/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698