~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-06-06 12:33:11 UTC
  • Revision ID: mbp@sourcefrog.net-20050606123311-cdd099f5d3b50343
- add deferred patch for finding touching patches from a list

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bzr library"""
18
18
 
 
19
from inventory import Inventory, InventoryEntry
 
20
from branch import Branch, ScratchBranch, find_branch
 
21
from osutils import format_date
 
22
from tree import Tree
 
23
from diff import compare_trees
 
24
from trace import mutter, warning, open_tracefile
 
25
from log import show_log
 
26
import add
 
27
 
19
28
BZRDIR = ".bzr"
20
29
 
21
30
DEFAULT_IGNORE = ['.bzr.log',
33
42
IGNORE_FILENAME = ".bzrignore"
34
43
 
35
44
import locale
36
 
user_encoding = locale.getpreferredencoding() or 'ascii'
 
45
user_encoding = locale.getpreferredencoding()
37
46
del locale
38
47
 
39
48
__copyright__ = "Copyright 2005 Canonical Development Ltd."
40
49
__author__ = "Martin Pool <mbp@canonical.com>"
41
 
__version__ = '0.1pre'
 
50
__version__ = '0.0.5pre'
42
51
 
43
52
 
44
53
def get_bzr_revision():
45
54
    """If bzr is run from a branch, return (revno,revid) or None"""
46
 
    import bzrlib.errors
47
 
    from bzrlib.branch import Branch
48
 
    
 
55
    from errors import BzrError
49
56
    try:
50
57
        branch = Branch(__path__[0])
51
58
        rh = branch.revision_history()
53
60
            return len(rh), rh[-1]
54
61
        else:
55
62
            return None
56
 
    except bzrlib.errors.BzrError:
 
63
    except BzrError:
57
64
        return None
58
65
    
59
 
def test_suite():
60
 
    import selftest
61
 
    return selftest.test_suite()