aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/hg.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-29 15:56:10 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-29 15:56:10 -0400
commitdcfe9d5e292fa4a405fafb4bdd6d9e2070f30fa9 (patch)
treef9e9c8d2ba5190d1a71046cdb5fb3abdc0fcf74f /libbe/hg.py
parent4e8882e74aad64859a16f17fa6bef8c04b33913d (diff)
parent22a38de80ee11ada710bc6766798ca608f938307 (diff)
downloadbugseverywhere-dcfe9d5e292fa4a405fafb4bdd6d9e2070f30fa9.tar.gz
Merged interactive email interface
Diffstat (limited to 'libbe/hg.py')
-rw-r--r--libbe/hg.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/libbe/hg.py b/libbe/hg.py
index a20eeb5..31df1d0 100644
--- a/libbe/hg.py
+++ b/libbe/hg.py
@@ -80,14 +80,17 @@ class Hg(RCS):
strings = ["nothing changed"]
if self._u_any_in_string(strings, output) == True:
raise rcs.EmptyCommit()
- status,output,error = self._u_invoke_client('identify')
- revision = None
- revline = re.compile("(.*) tip")
- match = revline.search(output)
- assert match != None, output+error
- assert len(match.groups()) == 1
- revision = match.groups()[0]
- return revision
+ return self._rcs_revision_id(-1)
+ def _rcs_revision_id(self, index, style="id"):
+ args = ["identify", "--rev", str(int(index)), "--%s" % style]
+ kwargs = {"expect": (0,255)}
+ status,output,error = self._u_invoke_client(*args, **kwargs)
+ if status == 0:
+ id = output.strip()
+ if id == '000000000000':
+ return None # before initial commit.
+ return id
+ return None
rcs.make_rcs_testcase_subclasses(Hg, sys.modules[__name__])