/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/revision.py

Merge disable-medusa-for-python-2.6 into pyftpdlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.lazy_import import lazy_import
22
22
lazy_import(globals(), """
23
23
from bzrlib import deprecated_graph
 
24
from bzrlib import bugtracker
24
25
""")
25
26
from bzrlib import (
26
27
    errors,
112
113
        """
113
114
        return self.message.lstrip().split('\n', 1)[0]
114
115
 
 
116
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((1, 13, 0)))
115
117
    def get_apparent_author(self):
116
118
        """Return the apparent author of this revision.
117
119
 
118
 
        If the revision properties contain the author name,
119
 
        return it. Otherwise return the committer name.
120
 
        """
121
 
        return self.properties.get('author', self.committer)
 
120
        This method is deprecated in favour of get_apparent_authors.
 
121
 
 
122
        If the revision properties contain any author names,
 
123
        return the first. Otherwise return the committer name.
 
124
        """
 
125
        return self.get_apparent_authors()[0]
 
126
 
 
127
    def get_apparent_authors(self):
 
128
        """Return the apparent authors of this revision.
 
129
 
 
130
        If the revision properties contain the names of the authors,
 
131
        return them. Otherwise return the committer name.
 
132
 
 
133
        The return value will be a list containing at least one element.
 
134
        """
 
135
        authors = self.properties.get('authors', None)
 
136
        if authors is None:
 
137
            author = self.properties.get('author', None)
 
138
            if author is None:
 
139
                return [self.committer]
 
140
            return [author]
 
141
        else:
 
142
            return authors.split("\n")
 
143
 
 
144
    def iter_bugs(self):
 
145
        """Iterate over the bugs associated with this revision."""
 
146
        bug_property = self.properties.get('bugs', None)
 
147
        if bug_property is None:
 
148
            return
 
149
        for line in bug_property.splitlines():
 
150
            try:
 
151
                url, status = line.split(None, 2)
 
152
            except ValueError:
 
153
                raise errors.InvalidLineInBugsProperty(line)
 
154
            if status not in bugtracker.ALLOWED_BUG_STATUSES:
 
155
                raise errors.InvalidBugStatus(status)
 
156
            yield url, status
122
157
 
123
158
 
124
159
def iter_ancestors(revision_id, revision_source, only_present=False):