1
# Copyright (C) 2005-2011 Canonical Ltd
1
# Copyright (C) 2005 Canonical Ltd
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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21
from bzrlib import (
26
from bzrlib.branch import Branch
24
27
from bzrlib.errors import (
26
29
InvalidLineInBugsProperty,
28
from bzrlib.revision import NULL_REVISION
32
from bzrlib.deprecated_graph import Graph
33
from bzrlib.revision import (find_present_ancestors,
29
35
from bzrlib.tests import TestCase, TestCaseWithTransport
30
36
from bzrlib.trace import mutter
37
from bzrlib.workingtree import WorkingTree
32
39
# We're allowed to test deprecated interfaces
33
40
warnings.filterwarnings('ignore',
201
208
self.assertEqual('a', r.get_summary())
202
209
r.message = '\na\nb'
203
210
self.assertEqual('a', r.get_summary())
205
self.assertEqual('', r.get_summary())
212
def test_get_apparent_author(self):
213
r = revision.Revision('1')
215
author = self.applyDeprecated(
216
symbol_versioning.deprecated_in((1, 13, 0)),
217
r.get_apparent_author)
218
self.assertEqual('A', author)
219
r.properties['author'] = 'B'
220
author = self.applyDeprecated(
221
symbol_versioning.deprecated_in((1, 13, 0)),
222
r.get_apparent_author)
223
self.assertEqual('B', author)
224
r.properties['authors'] = 'C\nD'
225
author = self.applyDeprecated(
226
symbol_versioning.deprecated_in((1, 13, 0)),
227
r.get_apparent_author)
228
self.assertEqual('C', author)
230
def test_get_apparent_author_none(self):
231
r = revision.Revision('1')
232
author = self.applyDeprecated(
233
symbol_versioning.deprecated_in((1, 13, 0)),
234
r.get_apparent_author)
235
self.assertEqual(None, author)
207
237
def test_get_apparent_authors(self):
208
238
r = revision.Revision('1')