Merge lp:~lifeless/bzr/test-log into lp:~bzr/bzr/trunk-old

Proposed by Robert Collins
Status: Merged
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/test-log
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 20 lines
To merge this branch: bzr merge lp:~lifeless/bzr/test-log
Reviewer Review Type Date Requested Status
Ian Clatworthy Needs Fixing
Review via email: mp+10137@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

This test *seems* to be comparing how nonascii chars are output in log,
but its actually testing what commit does when storing them; 2a stores
them literally.

I wasn't sure what to do here - either to say that log should escape
(expensive), or that commit should still be escaping (will annoy
Jelmer :P). So I've made it a knownfailure on 2a.

-Rob

--

Revision history for this message
Robert Collins (lifeless) wrote :

ping

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

> I wasn't sure what to do here - either to say that log should escape
> (expensive), or that commit should still be escaping (will annoy
> Jelmer :P). So I've made it a knownfailure on 2a.

Commit is now doing the right thing (at last) so it will annoy more than just Jelmer if you change it. :-) It's up to the LogFormatter to decide how to escape text to be displayed and LogCatcher() simply catches the raw revision data. I therefore suspect that this test is no longer applicable, well certainly not within test_log.py.

If you want to keep it around and make it conditional, this line of code (from fastimport) might help ...

_serializer_handles_escaping = hasattr(serializer.Serializer, 'squashes_xml_invalid_characters')

Ian C.

Revision history for this message
Robert Collins (lifeless) wrote :

I'm fine with the change I made in it, if you are ;)

-Rob

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

> I'm fine with the change I made in it, if you are ;)

Well, it's not a known failure. In 2a, it would be a known failure if the 2 values did *not* match.

review: Needs Fixing
Revision history for this message
Robert Collins (lifeless) wrote :

Done and on the way via PQM.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/test_log.py'
2--- bzrlib/tests/test_log.py 2009-08-17 23:15:55 +0000
3+++ bzrlib/tests/test_log.py 2009-08-19 02:36:21 +0000
4@@ -142,11 +142,11 @@
5 lf = LogCatcher()
6 log.show_log(wt.branch, lf, verbose=True)
7 committed_msg = lf.revisions[0].rev.message
8- if msg == committed_msg:
9- raise tests.KnownFailure(
10- "Commit message was preserved, but it wasn't expected to be.")
11- self.assertNotEqual(msg, committed_msg)
12- self.assertTrue(len(committed_msg) > len(msg))
13+ if wt.branch.repository._serializer.squashes_xml_invalid_characters:
14+ self.assertNotEqual(msg, committed_msg)
15+ self.assertTrue(len(committed_msg) > len(msg))
16+ else:
17+ self.assertEqual(msg, committed_msg)
18
19 def test_commit_message_without_control_chars(self):
20 wt = self.make_branch_and_tree('.')