aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbe/command/show.py3
-rw-r--r--libbe/version.py15
2 files changed, 13 insertions, 5 deletions
diff --git a/libbe/command/show.py b/libbe/command/show.py
index c6ad37d..27be07c 100644
--- a/libbe/command/show.py
+++ b/libbe/command/show.py
@@ -26,7 +26,6 @@ import libbe.command
import libbe.command.util
import libbe.util.id
import libbe.version
-import libbe._version
class Show (libbe.command.Command):
@@ -158,7 +157,7 @@ def _xml_header(encoding):
' <version>',
' <tag>%s</tag>' % libbe.version.version()]
for tag in ['branch-nick', 'revno', 'revision-id']:
- value = libbe._version.version_info[tag.replace('-', '_')]
+ value = libbe.version.version_info[tag.replace('-', '_')]
lines.append(' <%s>%s</%s>' % (tag, value, tag))
lines.append(' </version>')
return lines
diff --git a/libbe/version.py b/libbe/version.py
index 2df0185..3246c97 100644
--- a/libbe/version.py
+++ b/libbe/version.py
@@ -27,8 +27,17 @@ over the version strings" workflows.
import copy
-import libbe._version as _version
import libbe.storage
+try:
+ from ._version import version_info
+except ImportError, e:
+ import logging
+ logging.warn('unable to import libbe._version: %s' % e)
+ version_info = {
+ 'revision': 'unknown',
+ 'date': 'unknown',
+ 'committer': 'unknown',
+ }
# Manually set a version string (optional, defaults to bzr revision id)
#_VERSION = "1.2.3"
@@ -42,9 +51,9 @@ def version(verbose=False):
if "_VERSION" in globals():
string = _VERSION
else:
- string = _version.version_info['revision']
+ string = version_info['revision']
if verbose == True:
- info = copy.copy(_version.version_info)
+ info = copy.copy(version_info)
info['storage'] = libbe.storage.STORAGE_VERSION
string += ("\n"
"revision: %(revision)s\n"