/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

Removed _merge, renamed MergeConflictHandler to _MergeConflictHandler

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# (C) 2005 Canonical Development Ltd
 
2
 
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
 
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
 
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
 
17
"""bzr library"""
 
18
 
 
19
BZRDIR = ".bzr"
 
20
 
 
21
# please keep these sorted (in C locale order) to aid merging
 
22
DEFAULT_IGNORE = [
 
23
                  '#*#',
 
24
                  '*$',
 
25
                  '*,v',
 
26
                  '*.BAK',
 
27
                  '*.a',
 
28
                  '*.bak',
 
29
                  '*.elc',
 
30
                  '*.exe',
 
31
                  '*.la',
 
32
                  '*.lo',
 
33
                  '*.o',
 
34
                  '*.o',
 
35
                  '*.obj',
 
36
                  '*.orig',
 
37
                  '*.py[oc]',
 
38
                  '*.so',
 
39
                  '*.tmp',
 
40
                  '.*.tmp',
 
41
                  '*~',
 
42
                  '.#*',
 
43
                  '.*.sw[nop]',
 
44
                  '.sw[nop]',    # vim editing nameless file
 
45
                  '.DS_Store',
 
46
                  '.arch-ids',
 
47
                  '.arch-inventory',
 
48
                  '.bzr.log',
 
49
                  '.del-*',
 
50
                  '.git',
 
51
                  '.jamdeps'
 
52
                  '.libs',
 
53
                  '.make.state',
 
54
                  '.sconsign*',
 
55
                  '.svn',
 
56
                  '.tmp*',
 
57
                  'BitKeeper',
 
58
                  'CVS',
 
59
                  'CVS.adm',
 
60
                  'RCS',
 
61
                  'SCCS',
 
62
                  'TAGS',
 
63
                  '_darcs',
 
64
                  'aclocal.m4',
 
65
                  'autom4te*',
 
66
                  'config.h',
 
67
                  'config.h.in',
 
68
                  'config.log',
 
69
                  'config.status',
 
70
                  'config.sub',
 
71
                  'stamp-h',
 
72
                  'stamp-h.in',
 
73
                  'stamp-h1',
 
74
                  '{arch}',
 
75
                  ]
 
76
 
 
77
IGNORE_FILENAME = ".bzrignore"
 
78
 
 
79
import os
 
80
import sys
 
81
if sys.platform == 'darwin':
 
82
    # work around egregious python 2.4 bug
 
83
    sys.platform = 'posix'
 
84
    import locale
 
85
    sys.platform = 'darwin'
 
86
else:
 
87
    import locale
 
88
user_encoding = locale.getpreferredencoding() or 'ascii'
 
89
del locale
 
90
 
 
91
__copyright__ = "Copyright 2005,06 Canonical Development Ltd."
 
92
__version__ = version_string = '0.8pre'
 
93
# same format as sys.version_info
 
94
version_info = (0, 8, 0, 'pre', 0)
 
95
 
 
96
 
 
97
from bzrlib.symbol_versioning import deprecated_function, zero_seven
 
98
 
 
99
@deprecated_function(zero_seven)
 
100
def get_bzr_revision():
 
101
    """If bzr is run from a branch, return (revno,revid) or None."""
 
102
    import bzrlib.errors
 
103
    from bzrlib.branch import Branch
 
104
    
 
105
    try:
 
106
        branch = Branch.open(os.path.dirname(__path__[0]))
 
107
        rh = branch.revision_history()
 
108
        if rh:
 
109
            return len(rh), rh[-1]
 
110
        else:
 
111
            return None
 
112
    except bzrlib.errors.BzrError:
 
113
        return None
 
114
    
 
115
def test_suite():
 
116
    import tests
 
117
    return tests.test_suite()