aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/git.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-23 14:19:15 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-23 14:19:15 -0400
commit45cc50d7ce0b5c32a2936d6eb87a3002670924bc (patch)
tree3d7d34e3a6eb19a76aab4b649a2b72f8cef98cb9 /libbe/git.py
parent988b86a70cfc493f51b71e3e0b7effa439719a13 (diff)
downloadbugseverywhere-45cc50d7ce0b5c32a2936d6eb87a3002670924bc.tar.gz
Added .revision_id() to all the VCSs.
This makes it easier to compare recent revisions without a human around to give you revision numbers.
Diffstat (limited to 'libbe/git.py')
-rw-r--r--libbe/git.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/libbe/git.py b/libbe/git.py
index 2f9ffa9..2b45679 100644
--- a/libbe/git.py
+++ b/libbe/git.py
@@ -111,7 +111,18 @@ class Git(RCS):
assert match != None, output+error
assert len(match.groups()) == 3
revision = match.groups()[1]
- return revision
+ full_revision = self._rcs_revision_id(-1)
+ assert full_revision.startswith(revision), \
+ "Mismatched revisions:\n%s\n%s" % (revision, full_revision)
+ return full_revision
+ def _rcs_revision_id(self, index):
+ args = ["rev-list", "--first-parent", "--reverse", "HEAD"]
+ status,output,error = self._u_invoke_client(*args)
+ commits = output.splitlines()
+ try:
+ return commits[index]
+ except IndexError:
+ return None
rcs.make_rcs_testcase_subclasses(Git, sys.modules[__name__])