~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: 2010-07-16 20:52:54 UTC
  • mfrom: (5193.5.9 cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100716205254-j0m65wckb90rj54w
(vila) Cleanup some bogus rest constructs in the doc. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 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
32
31
 
33
32
NULL_REVISION="null:"
34
33
CURRENT_REVISION="current:"
54
53
 
55
54
    def __init__(self, revision_id, properties=None, **args):
56
55
        self.revision_id = revision_id
57
 
        self.properties = properties or {}
58
 
        self._check_properties()
 
56
        if properties is None:
 
57
            self.properties = {}
 
58
        else:
 
59
            self.properties = properties
 
60
            self._check_properties()
59
61
        self.committer = None
60
62
        self.parent_ids = []
61
63
        self.parent_sha1s = []
88
90
                raise ValueError("invalid property name %r" % name)
89
91
            if not isinstance(value, basestring):
90
92
                raise ValueError("invalid property value %r for %r" %
91
 
                                 (name, value))
 
93
                                 (value, name))
92
94
 
93
95
    def get_history(self, repository):
94
96
        """Return the canonical line-of-history for this revision.
119
121
        else:
120
122
            return ''
121
123
 
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
 
 
137
124
    def get_apparent_authors(self):
138
125
        """Return the apparent authors of this revision.
139
126