~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Aaron Bentley
  • Date: 2006-08-16 16:33:11 UTC
  • mfrom: (1931 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1934.
  • Revision ID: abentley@panoramicfeedback.com-20060816163311-1a877a09c0501851
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
                    'Consider using bzrlib.ignores.add_unique_user_ignores'
61
61
                    ' or bzrlib.ignores.add_runtime_ignores')
62
62
 
63
 
 
64
 
@deprecated_function(zero_seven)
65
 
def get_bzr_revision():
66
 
    """If bzr is run from a branch, return (revno,revid) or None."""
67
 
    import bzrlib.errors
68
 
    from bzrlib.branch import Branch
69
 
    
70
 
    try:
71
 
        branch = Branch.open(os.path.dirname(__path__[0]))
72
 
        rh = branch.revision_history()
73
 
        if rh:
74
 
            return len(rh), rh[-1]
75
 
        else:
76
 
            return None
77
 
    except bzrlib.errors.BzrError:
78
 
        return None
79
 
    
80
63
def test_suite():
81
64
    import tests
82
65
    return tests.test_suite()