~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/version.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-01 06:48:38 UTC
  • mfrom: (2389.1.1 0.15-to-trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20070401064838-34903c7b0d0c8007
merge 0.15 back to dev

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