~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

- merge improved merge base selection from aaron
aaron.bentley@utoronto.ca-20050912025534-43d7275dd948e4ad

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.7pre'
 
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
    
60
59
def test_suite():