~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-23 20:20:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4522.
  • Revision ID: john@arbash-meinel.com-20090623202039-kr6mxu576z5vc4y5
Initial implementation of a Pyrex annotator.

Drops the time down to 8.6s down from 9.7s.
This implementation is basically just a copy of the python one, so I'm
a bit surprised to see that much of a win already.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
    symbol_versioning,
29
29
    )
30
30
from bzrlib.osutils import contains_whitespace
 
31
from bzrlib.progress import DummyProgress
31
32
 
32
33
NULL_REVISION="null:"
33
34
CURRENT_REVISION="current:"
53
54
 
54
55
    def __init__(self, revision_id, properties=None, **args):
55
56
        self.revision_id = revision_id
56
 
        if properties is None:
57
 
            self.properties = {}
58
 
        else:
59
 
            self.properties = properties
60
 
            self._check_properties()
 
57
        self.properties = properties or {}
 
58
        self._check_properties()
61
59
        self.committer = None
62
60
        self.parent_ids = []
63
61
        self.parent_sha1s = []
90
88
                raise ValueError("invalid property name %r" % name)
91
89
            if not isinstance(value, basestring):
92
90
                raise ValueError("invalid property value %r for %r" %
93
 
                                 (value, name))
 
91
                                 (name, value))
94
92
 
95
93
    def get_history(self, repository):
96
94
        """Return the canonical line-of-history for this revision.
113
111
 
114
112
    def get_summary(self):
115
113
        """Get the first line of the log message for this revision.
116
 
 
117
 
        Return an empty string if message is None.
118
114
        """
119
 
        if self.message:
120
 
            return self.message.lstrip().split('\n', 1)[0]
121
 
        else:
122
 
            return ''
 
115
        return self.message.lstrip().split('\n', 1)[0]
123
116
 
124
117
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((1, 13, 0)))
125
118
    def get_apparent_author(self):