~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-16 04:31:16 UTC
  • mfrom: (1819.1.9 bzr.mbp.perf-history)
  • Revision ID: pqm@pqm.ubuntu.com-20060816043116-0e82b6cea99bffd4
(mbp) performance-history tracking

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