1
# Copyright 2009-2010 Canonical Ltd. This software is licensed under the
1
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
4
# pylint: disable-msg=E0211,E0213
82
80
IRevision, readonly=True, title=_('The new revision of the diff.'))
85
class IStaticDiff(Interface):
86
"""A diff with a fixed value, i.e. between two revisions."""
88
from_revision_id = exported(TextLine(readonly=True))
90
to_revision_id = exported(TextLine(readonly=True))
93
Reference(IDiff, title=_('The Diff object.'), readonly=True))
96
"""Destroy this object."""
99
class IStaticDiffSource(Interface):
100
"""Component that can acquire StaticDiffs."""
102
def acquire(from_revision_id, to_revision_id, repository, filename=None):
103
"""Get or create a StaticDiff."""
105
def acquireFromText(from_revision_id, to_revision_id, text,
107
"""Get or create a StaticDiff from a string.
109
If a StaticDiff exists for this revision_id pair, the text is ignored.
111
:param from_revision_id: The id of the old revision.
112
:param to_revision_id: The id of the new revision.
113
:param text: The text of the diff, as bytes.
114
:param filename: The filename to store for the diff. Randomly
115
generated if not supplied.
119
83
class IPreviewDiff(IDiff):
120
84
"""A diff generated to show actual diff between two branches.