[merge] 1ms resolution for commit timestamps

Martin Pool mbp at canonical.com
Thu Jul 20 02:07:31 BST 2006


On 19 Jul 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> > +
> > +class TestRevisionAttributes(TestCaseWithTransport):
> > +    """Test that revision attributes are correct."""
> > +
> > +    def test_revision_accessors(self):
> > +        """Make sure the values that come out of a revision are the same as the ones that go in.
> > +        """
> > +        tree1 = self.make_branch_and_tree("br1")
> > +
> > +        # create a revision
> > +        tree1.commit(message="quux", allow_pointless=True, committer="jaq")
> > +        assert len(tree1.branch.revision_history()) > 0
> > +        rev_a = tree1.branch.repository.get_revision(tree1.branch.last_revision())
> > +
> > +        tree2 = self.make_branch_and_tree("br2")
> > +        tree2.commit(message=rev_a.message,
> > +                     timestamp=rev_a.timestamp,
> > +                     timezone=rev_a.timezone,
> > +                     committer=rev_a.committer,
> > +                     rev_id=rev_a.revision_id,
> > +                     allow_pointless=True, # there's nothing in this commit
> > +                     strict=True,
> > +                     verbose=True)
> > +        rev_b = tree2.branch.repository.get_revision(tree2.branch.last_revision())
> > +
> > +        self.assertEqual(rev_a.message, rev_b.message)
> > +        self.assertEqual(rev_a.timestamp, rev_b.timestamp)
> > +        self.assertEqual(rev_a.timezone, rev_b.timezone)
> > +        self.assertEqual(rev_a.committer, rev_b.committer)
> > +        self.assertEqual(rev_a.revision_id, rev_b.revision_id)
> > 
> 
> I already merged my 1ms changes. But I think this is a good test to also
> add. I'm +1 on adding this test, what do other people think?

+1 from me too, and retrospective thanks for the 1ms-resolution fix.

-- 
Martin




More information about the bazaar mailing list