Add --transitive flag.
When specifying a revision (with -r) propagates the date of the revision to its children.
Review URL: http://codereview.chromium.org/6873110
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@83313 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_utils.py b/gclient_utils.py
index 9953223..81a1f66 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -112,6 +112,17 @@
return tuple(components)
+def IsDateRevision(revision):
+ """Returns true if the given revision is of the form "{ ... }"."""
+ return bool(revision and re.match(r'^\{.+\}$', str(revision)))
+
+
+def MakeDateRevision(date):
+ """Returns a revision representing the latest revision before the given
+ date."""
+ return "{" + date + "}"
+
+
def SyntaxErrorToError(filename, e):
"""Raises a gclient_utils.Error exception with the human readable message"""
try: