~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Aaron Bentley
  • Date: 2005-09-12 13:48:32 UTC
  • mfrom: (1185.3.4)
  • mto: (1185.1.16)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: abentley@panoramicfeedback.com-20050912134832-c23db11dc63170b6
Merged from mpool

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