~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/version.py

  • Committer: Martin Pool
  • Date: 2007-04-04 01:22:11 UTC
  • mfrom: (2393.1.1 bzr.docs)
  • mto: This revision was merged to the branch mainline in revision 2397.
  • Revision ID: mbp@sourcefrog.net-20070404012211-sq269me6bai9m6xk
merge trunk and doc fix from elliot

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