19
# TODO: Do less imports here
20
from branch import Branch, ScratchBranch, find_branch
21
from errors import BzrError
25
DEFAULT_IGNORE = ['.bzr.log',
26
'*~', '#*#', '*$', '.#*',
27
'.*.sw[nop]', '.*.tmp',
28
'*.tmp', '*.bak', '*.BAK', '*.orig',
29
'*.o', '*.obj', '*.a', '*.py[oc]', '*.so', '*.exe', '*.elc',
30
'{arch}', 'CVS', 'CVS.adm', '.svn', '_darcs', 'SCCS', 'RCS',
34
'TAGS', '.make.state', '.sconsign', '.tmp*',
20
37
IGNORE_FILENAME = ".bzrignore"
24
if sys.platform == 'darwin':
25
# work around egregious python 2.4 bug
26
sys.platform = 'posix'
28
sys.platform = 'darwin'
31
# XXX: This probably belongs in osutils instead
32
40
user_encoding = locale.getpreferredencoding() or 'ascii'
35
__copyright__ = "Copyright 2005, 2006 Canonical Development Ltd."
36
__version__ = version_string = '0.9'
38
# same format as sys.version_info: "A tuple containing the five components of
39
# the version number: major, minor, micro, releaselevel, and serial. All
40
# values except releaselevel are integers; the release level is 'alpha',
41
# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
42
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
43
# releaselevel of 'dev' for unreleased under-development code.
45
version_info = (0, 9, 0, 'final', 0)
47
if version_info[3] == 'final':
48
version_string = '%d.%d.%d' % version_info[:3]
50
version_string = '%d.%d.%d%s%d' % version_info
51
__version__ = version_string
53
from bzrlib.symbol_versioning import (deprecated_function,
59
# Kept for compatibility with 0.8, it is considered deprecated to modify it
60
DEFAULT_IGNORE = deprecated_list(zero_nine, 'DEFAULT_IGNORE', [],
61
'Consider using bzrlib.ignores.add_unique_user_ignores'
62
' or bzrlib.ignores.add_runtime_ignores')
65
@deprecated_function(zero_seven)
43
__copyright__ = "Copyright 2005 Canonical Development Ltd."
44
__author__ = "Martin Pool <mbp@canonical.com>"
66
48
def get_bzr_revision():
67
"""If bzr is run from a branch, return (revno,revid) or None."""
69
from bzrlib.branch import Branch
49
"""If bzr is run from a branch, return (revno,revid) or None"""
72
branch = Branch.open(os.path.dirname(__path__[0]))
51
branch = Branch(__path__[0])
73
52
rh = branch.revision_history()
75
54
return len(rh), rh[-1]
78
except bzrlib.errors.BzrError:
83
return tests.test_suite()