Code review comment for lp:~javier.collado/utah/bug1152216

Revision history for this message
Max Brustkern (nuclearbob) wrote :

If I export the utah directory outside of a branch and try to import anything from the utah module, bzr revno fails, giving something like:
>>> import utah
bzr: ERROR: Not a branch: "/home/max/bzr/merges/utah/".
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "utah/__init__.py", line 22, in <module>
    __revno__ = check_output(['bzr', 'revno'], cwd=dirname(__file__)).rstrip()
  File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['bzr', 'revno']' returned non-zero exit status 3

Maybe a try that catches CalledProcessError and sets __revno__ to None or 'unknown' in case of an exception would be good.

review: Needs Fixing

« Back to merge proposal