Rev 4697: There is no good reason for not writing a test. in file:///home/vila/src/bzr/bugs/430868-sig-domain/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Sep 18 18:19:15 BST 2009


At file:///home/vila/src/bzr/bugs/430868-sig-domain/

------------------------------------------------------------
revno: 4697
revision-id: v.ladeuil+lp at free.fr-20090918171915-dyoa2kzxm4wzq530
parent: v.ladeuil+lp at free.fr-20090916171907-i5pd2mrwgg1dzmtr
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 430868-sig-domain
timestamp: Fri 2009-09-18 19:19:15 +0200
message:
  There is no good reason for not writing a test.
  
  * bzrlib/tests/per_bzrdir/test_bzrdir.py:
  (TestBzrDir.test_clone_bzrdir_branch_and_repo_fixed_user_id): A
  simple test to reproduce the bug.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_bzrdir/test_bzrdir.py'
--- a/bzrlib/tests/per_bzrdir/test_bzrdir.py	2009-08-20 04:09:58 +0000
+++ b/bzrlib/tests/per_bzrdir/test_bzrdir.py	2009-09-18 17:19:15 +0000
@@ -28,6 +28,7 @@
     bzrdir,
     check,
     errors,
+    gpg,
     lockdir,
     osutils,
     repository,
@@ -432,6 +433,27 @@
         target = dir.clone(self.get_url('target'), revision_id='2')
         raise TestSkipped('revision limiting not strict yet')
 
+    def test_clone_bzrdir_branch_and_repo_fixed_user_id(self):
+        # Bug #430868 is about an email containing '.sig'
+        os.environ['BZR_EMAIL'] = 'murphy at host.sighup.org'
+        tree = self.make_branch_and_tree('commit_tree')
+        self.build_tree(['commit_tree/foo'])
+        tree.add('foo')
+        rev1 = tree.commit('revision 1')
+        tree_repo = tree.branch.repository
+        tree_repo.lock_write()
+        tree_repo.start_write_group()
+        tree_repo.sign_revision(rev1, gpg.LoopbackGPGStrategy(None))
+        tree_repo.commit_write_group()
+        tree_repo.unlock()
+        target = self.make_branch('target')
+        tree.branch.repository.copy_content_into(target.repository)
+        tree.branch.copy_content_into(target)
+        self.assertTrue(target.repository.has_revision(rev1))
+        self.assertEqual(
+            tree_repo.get_signature_text(rev1),
+            target.repository.get_signature_text(rev1))
+
     def test_clone_bzrdir_branch_and_repo(self):
         tree = self.make_branch_and_tree('commit_tree')
         self.build_tree(['commit_tree/foo'])



More information about the bazaar-commits mailing list