~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

  • Committer: Aaron Bentley
  • Date: 2006-08-16 16:33:11 UTC
  • mfrom: (1931 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1934.
  • Revision ID: abentley@panoramicfeedback.com-20060816163311-1a877a09c0501851
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import os
19
19
import warnings
20
20
 
 
21
from bzrlib import (
 
22
    revision,
 
23
    )
21
24
from bzrlib.branch import Branch
22
25
from bzrlib.errors import NoSuchRevision
23
26
from bzrlib.graph import Graph
25
28
                             common_ancestor,
26
29
                             is_ancestor, MultipleRevisionSources,
27
30
                             NULL_REVISION)
28
 
from bzrlib.tests import TestCaseWithTransport
 
31
from bzrlib.tests import TestCase, TestCaseWithTransport
29
32
from bzrlib.trace import mutter
30
33
from bzrlib.workingtree import WorkingTree
31
34
 
297
300
        self.assertEqual({'B':['A'],
298
301
                          'A':[]},
299
302
                         source.get_revision_graph('B'))
300
 
 
301
 
class TestRevisionAttributes(TestCaseWithTransport):
302
 
    """Test that revision attributes are correct."""
303
 
 
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.
306
 
        """
307
 
        tree1 = self.make_branch_and_tree("br1")
308
 
 
309
 
        # create a revision
310
 
        tree1.commit(message="quux", allow_pointless=True, committer="jaq",
311
 
                     revprops={'empty':'',
312
 
                               'value':'one',
313
 
                               'unicode':'\xb5',
314
 
                               'multiline':'foo\nbar\n\n'
315
 
                              })
316
 
        assert len(tree1.branch.revision_history()) > 0
317
 
        rev_a = tree1.branch.repository.get_revision(tree1.branch.last_revision())
318
 
 
319
 
        tree2 = self.make_branch_and_tree("br2")
320
 
        tree2.commit(message=rev_a.message,
321
 
                     timestamp=rev_a.timestamp,
322
 
                     timezone=rev_a.timezone,
323
 
                     committer=rev_a.committer,
324
 
                     rev_id=rev_a.revision_id,
325
 
                     revprops=rev_a.properties,
326
 
                     allow_pointless=True, # there's nothing in this commit
327
 
                     strict=True,
328
 
                     verbose=True)
329
 
        rev_b = tree2.branch.repository.get_revision(tree2.branch.last_revision())
330
 
        
331
 
        self.assertEqual(rev_a.message, rev_b.message)
332
 
        self.assertEqual(rev_a.timestamp, rev_b.timestamp)
333
 
        self.assertEqual(rev_a.timezone, rev_b.timezone)
334
 
        self.assertEqual(rev_a.committer, rev_b.committer)
335
 
        self.assertEqual(rev_a.revision_id, rev_b.revision_id)
336
 
        self.assertEqual(rev_a.properties, rev_b.properties)