[merge] 1ms resolution for commit timestamps
John Arbash Meinel
john at arbash-meinel.com
Wed Jul 19 15:56:01 BST 2006
-----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?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEvkgBJdeBCYSNAAMRAlxJAKCJq9Tz7J1C/Mj/rIjifa/8Rsa3wQCeKBfd
zUfDekw1iOaT4BtgqDLyls4=
=Deac
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list