1
1
# (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
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
11
# GNU General Public License for more details.
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
297
297
self.assertEqual({'B':['A'],
299
299
source.get_revision_graph('B'))
301
class TestRevisionAttributes(TestCaseWithTransport):
302
"""Test that revision attributes are correct."""
304
def test_revision_accessors(self):
305
"""Make sure the values that come out of a revision are the same as the ones that go in.
307
tree1 = self.make_branch_and_tree("br1")
310
tree1.commit(message="quux", allow_pointless=True, committer="jaq")
311
assert len(tree1.branch.revision_history()) > 0
312
rev_a = tree1.branch.repository.get_revision(tree1.branch.last_revision())
314
tree2 = self.make_branch_and_tree("br2")
315
tree2.commit(message=rev_a.message,
316
timestamp=rev_a.timestamp,
317
timezone=rev_a.timezone,
318
committer=rev_a.committer,
319
rev_id=rev_a.revision_id,
320
allow_pointless=True, # there's nothing in this commit
323
rev_b = tree2.branch.repository.get_revision(tree2.branch.last_revision())
325
self.assertEqual(rev_a.message, rev_b.message)
326
self.assertEqual(rev_a.timestamp, rev_b.timestamp)
327
self.assertEqual(rev_a.timezone, rev_b.timezone)
328
self.assertEqual(rev_a.committer, rev_b.committer)
329
self.assertEqual(rev_a.revision_id, rev_b.revision_id)