~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-27 22:29:55 UTC
  • mto: (3735.39.2 clean)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090327222955-utifmfm888zerixt
Implement apply_delta_to_source which doesn't have to malloc another string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        self.revision_id = revision_id
57
57
        self.properties = properties or {}
58
58
        self._check_properties()
59
 
        self.committer = None
60
59
        self.parent_ids = []
61
60
        self.parent_sha1s = []
62
61
        """Not used anymore - legacy from for 4."""
123
122
        If the revision properties contain any author names,
124
123
        return the first. Otherwise return the committer name.
125
124
        """
126
 
        authors = self.get_apparent_authors()
127
 
        if authors:
128
 
            return authors[0]
129
 
        else:
130
 
            return None
 
125
        return self.get_apparent_authors()[0]
131
126
 
132
127
    def get_apparent_authors(self):
133
128
        """Return the apparent authors of this revision.
139
134
        """
140
135
        authors = self.properties.get('authors', None)
141
136
        if authors is None:
142
 
            author = self.properties.get('author', self.committer)
 
137
            author = self.properties.get('author', None)
143
138
            if author is None:
144
 
                return []
 
139
                return [self.committer]
145
140
            return [author]
146
141
        else:
147
142
            return authors.split("\n")
211
206
def is_reserved_id(revision_id):
212
207
    """Determine whether a revision id is reserved
213
208
 
214
 
    :return: True if the revision is reserved, False otherwise
 
209
    :return: True if the revision is is reserved, False otherwise
215
210
    """
216
211
    return isinstance(revision_id, basestring) and revision_id.endswith(':')
217
212