~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Martin Pool
  • Date: 2005-05-03 07:48:54 UTC
  • Revision ID: mbp@sourcefrog.net-20050503074854-adb6f9d6382e27a9
- sketchy experiments in bash and zsh completion

Show diffs side-by-side

added added

removed removed

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