~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Robert Collins
  • Date: 2005-08-25 10:04:51 UTC
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050825100451-b01297285491ba46
make a default merge choose a sane base with branch.common_ancestor

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',
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()