/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

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

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 = []
68
70
    def __eq__(self, other):
69
71
        if not isinstance(other, Revision):
70
72
            return False
71
 
        # FIXME: rbc 20050930 parent_ids are not being compared
72
73
        return (
73
74
                self.inventory_sha1 == other.inventory_sha1
74
75
                and self.revision_id == other.revision_id
76
77
                and self.message == other.message
77
78
                and self.timezone == other.timezone
78
79
                and self.committer == other.committer
79
 
                and self.properties == other.properties)
 
80
                and self.properties == other.properties
 
81
                and self.parent_ids == other.parent_ids)
80
82
 
81
83
    def __ne__(self, other):
82
84
        return not self.__eq__(other)
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.
111
113
 
112
114
    def get_summary(self):
113
115
        """Get the first line of the log message for this revision.
 
116
 
 
117
        Return an empty string if message is None.
114
118
        """
115
 
        return self.message.lstrip().split('\n', 1)[0]
 
119
        if self.message:
 
120
            return self.message.lstrip().split('\n', 1)[0]
 
121
        else:
 
122
            return ''
116
123
 
117
124
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((1, 13, 0)))
118
125
    def get_apparent_author(self):