Chromium Code Reviews| Index: gclient_utils.py |
| =================================================================== |
| --- gclient_utils.py (revision 82287) |
| +++ gclient_utils.py (working copy) |
| @@ -112,6 +112,14 @@ |
| return tuple(components) |
| +def IsDateRevision(revision): |
| + """Returns true if the given revision is of the form "{ ... }".""" |
| + if revision is None: return False |
|
M-A Ruel
2011/04/20 15:43:28
keep on two lines by style guide.
Florian Loitsch
2011/04/20 18:32:01
Done.
|
| + str_revision = str(revision) |
| + if len(str_revision) < 2: return False |
| + return str_revision[0] == '{' and str_revision[-1] == '}' |
|
M-A Ruel
2011/04/20 15:43:28
return bool(re.match(r'^\{.+\}$', str(revision)))
Florian Loitsch
2011/04/20 18:32:01
Done.
|
| + |
| + |
| def SyntaxErrorToError(filename, e): |
| """Raises a gclient_utils.Error exception with the human readable message""" |
| try: |