~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-09-04 03:32:17 UTC
  • mfrom: (974.1.52)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050904033217-821a797652305c14
Disabled urlgrabber

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