aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
Diffstat (limited to 'libbe')
-rw-r--r--libbe/storage/vcs/base.py1
-rw-r--r--libbe/storage/vcs/hg.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index 7d17b56..fffabf8 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -36,6 +36,7 @@ import tempfile
import libbe
import libbe.storage.base
import libbe.util.encoding
+from libbe.storage.base import EmptyCommit, InvalidRevision
from libbe.util.utility import Dir, search_parent_directories
from libbe.util.subproc import CommandError, invoke
from libbe.util.plugin import import_by_name
diff --git a/libbe/storage/vcs/hg.py b/libbe/storage/vcs/hg.py
index f1a7eef..260f0c4 100644
--- a/libbe/storage/vcs/hg.py
+++ b/libbe/storage/vcs/hg.py
@@ -100,6 +100,10 @@ class Hg(base.VCS):
return self._vcs_revision_id(-1)
def _vcs_revision_id(self, index, style='id'):
+ try:
+ index = str(int(index))
+ except ValueError:
+ return None
args = ['identify', '--rev', str(int(index)), '--%s' % style]
kwargs = {'expect': (0,255)}
status,output,error = self._u_invoke_client(*args, **kwargs)