~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-06 02:20:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050406022039-dfbff590495c81193a32fd8b
- better output from test.sh- test.sh exercises cat command (currently broken)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""bzr library"""
18
18
 
19
19
from inventory import Inventory, InventoryEntry
20
 
from branch import Branch, ScratchBranch, find_branch
 
20
from branch import Branch, ScratchBranch
21
21
from osutils import format_date
22
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
 
from plugin import load_plugins
 
23
from diff import diff_trees
 
24
from trace import mutter, warning
27
25
import add
28
26
 
29
27
BZRDIR = ".bzr"
30
28
 
31
29
DEFAULT_IGNORE = ['.bzr.log',
32
30
                  '*~', '#*#', '*$', '.#*',
33
 
                  '.*.sw[nop]', '.*.tmp',
34
31
                  '*.tmp', '*.bak', '*.BAK', '*.orig',
35
32
                  '*.o', '*.obj', '*.a', '*.py[oc]', '*.so', '*.exe', '*.elc', 
36
 
                  '{arch}', 'CVS', 'CVS.adm', '.svn', '_darcs', 'SCCS', 'RCS',
37
 
                  '*,v',
38
 
                  'BitKeeper',
39
 
                  '.git',
40
 
                  'TAGS', '.make.state', '.sconsign', '.tmp*',
41
 
                  '.del-*']
 
33
                  '{arch}', 'CVS', '.svn', '_darcs', 'SCCS', 'RCS',
 
34
                  'TAGS', '.make.state', '.sconsign']
42
35
 
43
36
IGNORE_FILENAME = ".bzrignore"
44
37
 
45
 
import locale
46
 
user_encoding = locale.getpreferredencoding()
47
 
del locale
48
38
 
49
39
__copyright__ = "Copyright 2005 Canonical Development Ltd."
50
40
__author__ = "Martin Pool <mbp@canonical.com>"
51
 
__version__ = '0.0.5'
52
 
 
53
 
 
54
 
def get_bzr_revision():
55
 
    """If bzr is run from a branch, return (revno,revid) or None"""
56
 
    from errors import BzrError
57
 
    try:
58
 
        branch = Branch(__path__[0])
59
 
        rh = branch.revision_history()
60
 
        if rh:
61
 
            return len(rh), rh[-1]
62
 
        else:
63
 
            return None
64
 
    except BzrError:
65
 
        return None
66
 
    
 
41
__version__ = '0.0.3pre'
 
42