~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-07-04 12:26:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050704122602-69901910521e62c3
- check command checks that all inventory-ids are the same as in the revision.

Show diffs side-by-side

added added

removed removed

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