~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 01:56:02 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-20050825015601-b4ac37f043068e82
break smart_add into smart_add and smart_add_branch which will accept a branch parameter

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
 
19
23
BZRDIR = ".bzr"
20
24
 
21
25
DEFAULT_IGNORE = ['.bzr.log',
38
42
 
39
43
__copyright__ = "Copyright 2005 Canonical Development Ltd."
40
44
__author__ = "Martin Pool <mbp@canonical.com>"
41
 
__version__ = '0.1pre'
 
45
__version__ = '0.0.7pre'
42
46
 
43
47
 
44
48
def get_bzr_revision():
45
49
    """If bzr is run from a branch, return (revno,revid) or None"""
46
 
    import bzrlib.errors
47
 
    from bzrlib.branch import Branch
48
 
    
49
50
    try:
50
 
        branch = Branch.open(__path__[0])
 
51
        branch = Branch(__path__[0])
51
52
        rh = branch.revision_history()
52
53
        if rh:
53
54
            return len(rh), rh[-1]
54
55
        else:
55
56
            return None
56
 
    except bzrlib.errors.BzrError:
 
57
    except BzrError:
57
58
        return None
58
59
    
59
60
def test_suite():