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

Unified Diff: mojo/tools/mopy/version.py

Issue 707893005: Add mojo/tools/mopy with paths and version utilities (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
Index: mojo/tools/mopy/version.py
diff --git a/mojo/tools/mopy/version.py b/mojo/tools/mopy/version.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f8e1329fe73c14b6e2036b4308fa53287d0ab91
--- /dev/null
+++ b/mojo/tools/mopy/version.py
@@ -0,0 +1,14 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import subprocess
+
+import mopy.paths
+
+class Version(object):
+ """Computes the version (git committish) of the mojo repo"""
+
+ def __init__(self):
+ self.version = subprocess.check_output(["git", "rev-parse", "HEAD"],
+ cwd=mopy.paths.Paths().src_root).strip()

Powered by Google App Engine
This is Rietveld 408576698