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

Unified Diff: gclient_scm.py

Issue 362008: gclient: Make revinfo work on git. (Closed)
Patch Set: Created 11 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
« gclient.py ('K') | « gclient.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 8cba5409573899b343ca099da468bb9db5798285..b9625f91b90cd23398c7d82d54bcf8c2d1c3f440 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -78,7 +78,7 @@ class SCMWrapper(object):
if file_list is None:
file_list = []
- commands = ['cleanup', 'export', 'update', 'revert',
+ commands = ['cleanup', 'export', 'update', 'revert', 'revinfo',
'status', 'diff', 'pack', 'runhooks']
if not command in commands:
@@ -167,6 +167,10 @@ class GitWrapper(SCMWrapper):
self._RunGit(['reset', '--hard', merge_base], redirect_stdout=False)
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
+ def revinfo(self, options, args, file_list):
+ """Display revision"""
+ return self._RunGit(['rev-parse', 'HEAD'])
+
def runhooks(self, options, args, file_list):
self.status(options, args, file_list)
@@ -395,6 +399,10 @@ class SVNWrapper(SCMWrapper):
# exception.
logging.error('Failed to update:\n%s' % str(e))
+ def revinfo(self, options, args, file_list):
+ """Display revision"""
+ return CaptureSVNHeadRevision(self.url)
+
def runhooks(self, options, args, file_list):
self.status(options, args, file_list)
« gclient.py ('K') | « gclient.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698