~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-09-09 09:44:03 UTC
  • Revision ID: mbp@sourcefrog.net-20050909094403-ddad5896b0b12c68
- weave commit records per-file ancestors

 - commits of merges are currently forbidden

 - files that existed in the previous revision are recorded with that 
   parent

 'weave annotate' on woven files now gives the correct result!

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
 
 
28
19
BZRDIR = ".bzr"
29
20
 
30
21
DEFAULT_IGNORE = ['.bzr.log',
42
33
IGNORE_FILENAME = ".bzrignore"
43
34
 
44
35
import locale
45
 
user_encoding = locale.getpreferredencoding()
 
36
user_encoding = locale.getpreferredencoding() or 'ascii'
46
37
del locale
47
38
 
48
39
__copyright__ = "Copyright 2005 Canonical Development Ltd."
49
40
__author__ = "Martin Pool <mbp@canonical.com>"
50
 
__version__ = '0.0.5'
 
41
__version__ = '0.1pre'
51
42
 
52
43
 
53
44
def get_bzr_revision():
54
45
    """If bzr is run from a branch, return (revno,revid) or None"""
55
 
    from errors import BzrError
 
46
    import bzrlib.errors
 
47
    from bzrlib.branch import Branch
 
48
    
56
49
    try:
57
50
        branch = Branch(__path__[0])
58
51
        rh = branch.revision_history()
60
53
            return len(rh), rh[-1]
61
54
        else:
62
55
            return None
63
 
    except BzrError:
 
56
    except bzrlib.errors.BzrError:
64
57
        return None
65
58
    
 
59
def test_suite():
 
60
    import selftest
 
61
    return selftest.test_suite()