def revision_id(self, index=None):
if index == None:
return None
+ try:
+ if int(index) != index:
+ raise InvalidRevision(index)
+ except ValueError:
+ raise InvalidRevision(index)
revid = self._vcs_revision_id(index)
if revid == None:
raise libbe.storage.base.InvalidRevision(index)
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)