~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 04:42:41 UTC
  • mfrom: (1092.1.43)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050827044241-23d676133b9fc981
Merge of robertc@robertcollins.net-20050826013321-52eee1f1da679ee9

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.0.7pre'
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()