~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-06-22 06:37:43 UTC
  • Revision ID: mbp@sourcefrog.net-20050622063743-e395f04c4db8977f
- move old blackbox code from testbzr into bzrlib.selftest.blackbox

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bzr library"""
18
18
 
 
19
from inventory import Inventory, InventoryEntry
 
20
from branch import Branch, ScratchBranch, find_branch
 
21
from osutils import format_date
 
22
from tree import Tree
 
23
from diff import compare_trees
 
24
from trace import mutter, warning, open_tracefile
 
25
from log import show_log
 
26
from plugin import load_plugins
 
27
import add
 
28
 
19
29
BZRDIR = ".bzr"
20
30
 
21
31
DEFAULT_IGNORE = ['.bzr.log',
33
43
IGNORE_FILENAME = ".bzrignore"
34
44
 
35
45
import locale
36
 
user_encoding = locale.getpreferredencoding() or 'ascii'
 
46
user_encoding = locale.getpreferredencoding()
37
47
del locale
38
48
 
39
49
__copyright__ = "Copyright 2005 Canonical Development Ltd."
40
50
__author__ = "Martin Pool <mbp@canonical.com>"
41
 
__version__ = '0.1pre'
 
51
__version__ = '0.0.5'
42
52
 
43
53
 
44
54
def get_bzr_revision():
45
55
    """If bzr is run from a branch, return (revno,revid) or None"""
46
 
    import bzrlib.errors
47
 
    from bzrlib.branch import Branch
48
 
    
 
56
    from errors import BzrError
49
57
    try:
50
58
        branch = Branch(__path__[0])
51
59
        rh = branch.revision_history()
53
61
            return len(rh), rh[-1]
54
62
        else:
55
63
            return None
56
 
    except bzrlib.errors.BzrError:
 
64
    except BzrError:
57
65
        return None
58
66
    
59
 
def test_suite():
60
 
    import selftest
61
 
    return selftest.test_suite()