15
16
# You should have received a copy of the GNU General Public License
16
17
# along with this program; if not, write to the Free Software
17
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
"""Bazaar-NG -- a free distributed version-control tool"""
21
print "bzr does not support python -OO."
24
version_info = sys.version_info
25
except AttributeError:
26
version_info = 1, 5 # 1.5 or older
28
REINVOKE = "__BZR_REINVOKE"
30
KNOWN_PYTHONS = ('python2.4',)
32
if version_info < NEED_VERS:
33
if not os.environ.has_key(REINVOKE):
34
# mutating os.environ doesn't work in old Pythons
35
os.putenv(REINVOKE, "1")
36
for python in KNOWN_PYTHONS:
38
os.execvp(python, [python] + sys.argv)
41
print >>sys.stderr, "bzr: error: cannot find a suitable python interpreter"
42
print >>sys.stderr, " (need %d.%d or later)" % NEED_VERS
44
if hasattr(os, "unsetenv"):
49
import bzrlib.commands
51
except ImportError, e:
52
sys.stderr.write("bzr: ERROR: "
53
"Couldn't import bzrlib and dependencies.\n"
54
"Please check bzrlib is on your PYTHONPATH.\n"
58
if bzrlib.version_info[:3] != (0, 7, 0):
59
sys.stderr.write("bzr: WARNING: bzrlib version doesn't match the bzr program.\n"
60
"This may indicate an installation problem.\n"
61
"bzrlib from %s is version %r\n"
62
% (bzrlib.__path__, bzrlib.version_info))
20
import sys, bzrlib, bzrlib.commands
64
23
if __name__ == '__main__':
65
bzrlib.trace.enable_default_logging()
66
24
sys.exit(bzrlib.commands.main(sys.argv))
68
pass # should this give an error? - it can't be used as a lib