~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-13 06:08:53 UTC
  • mfrom: (4737.1.1 merge-2.0-into-devel)
  • Revision ID: pqm@pqm.ubuntu.com-20091013060853-erk2aaj80fnkrv25
(andrew) Merge lp:bzr/2.0 into lp:bzr, including fixes for #322807,
        #389413, #402623 and documentation improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 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
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
# TODO: Some kind of command-line display of revision properties:
20
18
# perhaps show them in log -v and allow them as options to the commit command.
21
19
 
22
20
 
23
21
from bzrlib.lazy_import import lazy_import
24
22
lazy_import(globals(), """
 
23
from bzrlib import deprecated_graph
25
24
from bzrlib import bugtracker
26
25
""")
27
26
from bzrlib import (
29
28
    symbol_versioning,
30
29
    )
31
30
from bzrlib.osutils import contains_whitespace
 
31
from bzrlib.progress import DummyProgress
32
32
 
33
33
NULL_REVISION="null:"
34
34
CURRENT_REVISION="current:"
54
54
 
55
55
    def __init__(self, revision_id, properties=None, **args):
56
56
        self.revision_id = revision_id
57
 
        if properties is None:
58
 
            self.properties = {}
59
 
        else:
60
 
            self.properties = properties
61
 
            self._check_properties()
 
57
        self.properties = properties or {}
 
58
        self._check_properties()
62
59
        self.committer = None
63
60
        self.parent_ids = []
64
61
        self.parent_sha1s = []
122
119
        else:
123
120
            return ''
124
121
 
 
122
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((1, 13, 0)))
 
123
    def get_apparent_author(self):
 
124
        """Return the apparent author of this revision.
 
125
 
 
126
        This method is deprecated in favour of get_apparent_authors.
 
127
 
 
128
        If the revision properties contain any author names,
 
129
        return the first. Otherwise return the committer name.
 
130
        """
 
131
        authors = self.get_apparent_authors()
 
132
        if authors:
 
133
            return authors[0]
 
134
        else:
 
135
            return None
 
136
 
125
137
    def get_apparent_authors(self):
126
138
        """Return the apparent authors of this revision.
127
139