~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/version.py

  • Committer: Martin Pool
  • Date: 2007-04-01 06:19:16 UTC
  • mfrom: (2323.5.20 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: mbp@sourcefrog.net-20070401061916-plpgsxdf8g7gll9o
Merge 0.15 final release back to trunk, including: recommend upgrades of old workingtrees, handle multiple http redirections, some dirstate fixes, 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
import sys
21
21
 
22
22
import bzrlib
23
 
from bzrlib import config, errors, osutils
 
23
from bzrlib import (
 
24
    bzrdir,
 
25
    config,
 
26
    errors,
 
27
    osutils,
 
28
    )
24
29
from bzrlib.branch import Branch
25
30
 
26
31
 
61
66
    If bzr is not being run from its working tree, returns None.
62
67
    """
63
68
    try:
64
 
        from bzrlib.workingtree import WorkingTree
65
 
        return WorkingTree.open_containing(__file__)[0]
 
69
        control = bzrdir.BzrDir.open_containing(__file__)[0]
 
70
        return control.open_workingtree(recommend_upgrade=False)
66
71
    except (errors.NotBranchError, errors.UnknownFormatError,
67
72
            errors.NoWorkingTree):
68
73
        return None