~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/util/configobj/configobj.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-11 21:41:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3543.
  • Revision ID: john@arbash-meinel.com-20080711214124-qi09irlj7pd5cuzg
Shortcut the case when one revision is in the ancestry of the other.

At the cost of a heads() check, when one parent supersedes, we don't have to extract
the text for the other. Changes merge time from 3m37s => 3m21s. Using a
CachingParentsProvider would drop the time down to 3m11s.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import os, re
27
27
compiler = None
28
 
# Bzr modification: Disabled import of 'compiler' module
29
 
# bzr doesn't use the 'unrepr' feature of configobj, so importing compiler just
30
 
# wastes several milliseconds on every single bzr invocation.
31
 
#   -- Andrew Bennetts, 2008-10-14
32
 
#try:
33
 
#    import compiler
34
 
#except ImportError:
35
 
#    # for IronPython
36
 
#    pass
 
28
try:
 
29
    import compiler
 
30
except ImportError:
 
31
    # for IronPython
 
32
    pass
37
33
from types import StringTypes
38
34
from warnings import warn
39
35
try:
254
250
    This is the base class for all errors that ConfigObj raises.
255
251
    It is a subclass of SyntaxError.
256
252
    """
257
 
    def __init__(self, msg='', line_number=None, line=''):
 
253
    def __init__(self, message='', line_number=None, line=''):
258
254
        self.line = line
259
255
        self.line_number = line_number
260
 
        self.msg = msg
261
 
        SyntaxError.__init__(self, msg)
 
256
        self.message = message
 
257
        SyntaxError.__init__(self, message)
262
258
 
263
259
 
264
260
class NestingError(ConfigObjError):