~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-08-23 00:40:27 UTC
  • Revision ID: mbp@sourcefrog.net-20050823004027-e6e45a392f540bb4
todo

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bzr library"""
18
18
 
 
19
# TODO: Do less imports here
 
20
from branch import Branch, ScratchBranch, find_branch
 
21
from errors import BzrError
 
22
 
19
23
BZRDIR = ".bzr"
20
24
 
21
25
DEFAULT_IGNORE = ['.bzr.log',
38
42
 
39
43
__copyright__ = "Copyright 2005 Canonical Development Ltd."
40
44
__author__ = "Martin Pool <mbp@canonical.com>"
41
 
__version__ = '0.1pre'
 
45
__version__ = '0.0.7pre'
42
46
 
43
47
 
44
48
def get_bzr_revision():
45
49
    """If bzr is run from a branch, return (revno,revid) or None"""
46
 
    import bzrlib.errors
47
 
    from bzrlib.branch import Branch
48
 
    
49
50
    try:
50
51
        branch = Branch(__path__[0])
51
52
        rh = branch.revision_history()
53
54
            return len(rh), rh[-1]
54
55
        else:
55
56
            return None
56
 
    except bzrlib.errors.BzrError:
 
57
    except BzrError:
57
58
        return None
58
59
    
59
 
def test_suite():
60
 
    import selftest
61
 
    return selftest.test_suite()