/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/version.py

  • Committer: Lawrence Mitchell
  • Date: 2011-11-08 10:54:09 UTC
  • mto: This revision was merged to the branch mainline in revision 6245.
  • Revision ID: wence@gmx.li-20111108105409-cgdqeek7vl7e8nbb
Only set check_clean if {clean} is asked for in template
      
The {clean} flag in templates requires an lstat of every file in the
repository.  If the filesystem is slow this can take a noticeable
amount of time.  So only switch check_clean to True if the template
actually asks for it, to avoid penalising those who don't want to
know.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import bzrlib
23
23
from bzrlib import (
24
 
    bzrdir,
25
24
    config,
 
25
    controldir,
26
26
    errors,
27
27
    osutils,
28
28
    trace,
73
73
    else:
74
74
        to_file.write(bzrlib.__path__[0] + '\n')
75
75
    if show_config:
76
 
        config_dir = os.path.normpath(config.config_dir())  # use native slashes
 
76
        config_dir = osutils.normpath(config.config_dir())  # use native slashes
77
77
        if not isinstance(config_dir, unicode):
78
78
            config_dir = config_dir.decode(osutils.get_user_encoding())
79
79
        to_file.write("  Bazaar configuration: %s\n" % (config_dir,))
98
98
    If bzr is not being run from its working tree, returns None.
99
99
    """
100
100
    try:
101
 
        control = bzrdir.BzrDir.open_containing(__file__)[0]
 
101
        control = controldir.ControlDir.open_containing(__file__)[0]
102
102
        return control.open_workingtree(recommend_upgrade=False)
103
103
    except (errors.NotBranchError, errors.UnknownFormatError,
104
104
            errors.NoWorkingTree):