~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Jelmer Vernooij
  • Date: 2009-04-06 21:01:10 UTC
  • mto: This revision was merged to the branch mainline in revision 4282.
  • Revision ID: jelmer@samba.org-20090406210110-3f2ektdpbhrpl9bf
Cope with revision.committer being None.

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
59
60
        self.parent_ids = []
60
61
        self.parent_sha1s = []
61
62
        """Not used anymore - legacy from for 4."""
122
123
        If the revision properties contain any author names,
123
124
        return the first. Otherwise return the committer name.
124
125
        """
125
 
        return self.get_apparent_authors()[0]
 
126
        authors = self.get_apparent_authors()
 
127
        if authors:
 
128
            return authors[0]
 
129
        else:
 
130
            return None
126
131
 
127
132
    def get_apparent_authors(self):
128
133
        """Return the apparent authors of this revision.
134
139
        """
135
140
        authors = self.properties.get('authors', None)
136
141
        if authors is None:
137
 
            author = self.properties.get('author', None)
 
142
            author = self.properties.get('author', self.committer)
138
143
            if author is None:
139
 
                return [self.committer]
 
144
                return []
140
145
            return [author]
141
146
        else:
142
147
            return authors.split("\n")