~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

Merge from mpool.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        # no entries yet
113
113
        eq(lf.logs, [])
114
114
 
115
 
 
116
115
        b.working_tree().commit('empty commit')
117
116
        lf = LogCatcher()
118
117
        show_log(b, lf, verbose=True)
123
122
        self.log('log delta: %r' % d)
124
123
        self.checkDelta(d)
125
124
 
126
 
 
127
125
        self.build_tree(['hello'])
128
126
        b.working_tree().add('hello')
129
127
        b.working_tree().commit('add one file')
153
151
        
154
152
        # commit a log message with control characters
155
153
        msg = "All 8-bit chars: " +  ''.join([unichr(x) for x in range(256)])
 
154
        self.log("original commit message: %r", msg)
156
155
        b.working_tree().commit(msg)
157
156
        lf = LogCatcher()
158
157
        show_log(b, lf, verbose=True)
160
159
        self.log("escaped commit message: %r", committed_msg)
161
160
        self.assert_(msg != committed_msg)
162
161
        self.assert_(len(committed_msg) > len(msg))
 
162
 
 
163
        # Check that log message with only XML-valid characters isn't
 
164
        # escaped.  As ElementTree apparently does some kind of
 
165
        # newline conversion, neither LF (\x0A) nor CR (\x0D) are
 
166
        # included in the test commit message, even though they are
 
167
        # valid XML 1.0 characters.
 
168
        msg = "\x09" + ''.join([unichr(x) for x in range(0x20, 256)])
 
169
        self.log("original commit message: %r", msg)
 
170
        b.working_tree().commit(msg)
 
171
        lf = LogCatcher()
 
172
        show_log(b, lf, verbose=True)
 
173
        committed_msg = lf.logs[0].rev.message
 
174
        self.log("escaped commit message: %r", committed_msg)
 
175
        self.assert_(msg == committed_msg)