/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-05-31 03:02:45 UTC
  • Revision ID: mbp@sourcefrog.net-20050531030244-d9bbefb14ee48d88
- new bzrlib.get_bzr_revision() tells about the history of 
  bzr itself
- also display revision-id in --version output

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
__copyright__ = "Copyright 2005 Canonical Development Ltd."
48
48
__author__ = "Martin Pool <mbp@canonical.com>"
49
49
__version__ = '0.0.5pre'
 
50
 
 
51
 
 
52
def get_bzr_revision():
 
53
    """If bzr is run from a branch, return (revno,revid) or None"""
 
54
    from errors import BzrError
 
55
    try:
 
56
        branch = Branch(__path__[0])
 
57
        rh = branch.revision_history()
 
58
        if rh:
 
59
            return len(rh), rh[-1]
 
60
        else:
 
61
            return None
 
62
    except BzrError:
 
63
        return None
 
64