~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-09-01 12:34:34 UTC
  • Revision ID: mbp@sourcefrog.net-20050901123434-47f5353abbeae0d6
- typo fixes from kfish

- point the tutorial to the web site where it's now maintained

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
 
 
29
19
BZRDIR = ".bzr"
30
20
 
31
21
DEFAULT_IGNORE = ['.bzr.log',
43
33
IGNORE_FILENAME = ".bzrignore"
44
34
 
45
35
import locale
46
 
user_encoding = locale.getpreferredencoding()
 
36
user_encoding = locale.getpreferredencoding() or 'ascii'
47
37
del locale
48
38
 
49
39
__copyright__ = "Copyright 2005 Canonical Development Ltd."
50
40
__author__ = "Martin Pool <mbp@canonical.com>"
51
 
__version__ = '0.0.5'
 
41
__version__ = '0.0.7pre'
52
42
 
53
43
 
54
44
def get_bzr_revision():
55
45
    """If bzr is run from a branch, return (revno,revid) or None"""
56
 
    from errors import BzrError
 
46
    import bzrlib.errors
 
47
    from bzrlib.branch import Branch
 
48
    
57
49
    try:
58
50
        branch = Branch(__path__[0])
59
51
        rh = branch.revision_history()
61
53
            return len(rh), rh[-1]
62
54
        else:
63
55
            return None
64
 
    except BzrError:
 
56
    except bzrlib.errors.BzrError:
65
57
        return None
66
58
    
 
59
def test_suite():
 
60
    import selftest
 
61
    return selftest.test_suite()