~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-14 16:16:53 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1919.
  • Revision ID: john@arbash-meinel.com-20060814161653-54cdcdadcd4e9003
Remove bogus entry from BRANCH.TODO

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
    
63
80
def test_suite():
64
81
    import tests
65
82
    return tests.test_suite()