[merge] 1ms resolution for commit timestamps

Robert Collins robertc at robertcollins.net
Thu Jul 20 01:45:28 BST 2006


On Wed, 2006-07-19 at 09:56 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jamie Wilkinson wrote:
> > This one time, at band camp, John Arbash Meinel wrote:
> 
> ...
> 
> > +1, referring back to a thread many months ago asking for a test that
> > revision data is stored idempotently.
> > 
> > http://repo.spacepants.org/bzr/bzr.jaq , revno 1600
> > 
> > 
> > === modified file 'bzrlib/tests/test_revision.py'
> > --- bzrlib/tests/test_revision.py       2006-07-18 23:40:45 +0000
> > +++ bzrlib/tests/test_revision.py       2006-07-18 23:54:06 +0000
> > @@ -297,3 +297,33 @@
> >          self.assertEqual({'B':['A'],
> >                            'A':[]},
> >                           source.get_revision_graph('B'))
> > +
> > +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?

Yup,
Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060720/a6c0b18d/attachment.pgp 


More information about the bazaar mailing list