~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

Exclude more files from dumb-rsync upload

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        b = Branch('.', init=True)
69
69
 
70
70
        lf = LogCatcher()
71
 
        b.commit('empty commit')
 
71
        b.working_tree().commit('empty commit')
72
72
        show_log(b, lf, verbose=True, start_revision=1, end_revision=1)
73
73
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
74
74
                          start_revision=2, end_revision=1) 
87
87
        b = Branch.initialize('.')
88
88
 
89
89
        lf = LogCatcher()
90
 
        b.commit('empty commit')
 
90
        b.working_tree().commit('empty commit')
91
91
        show_log(b, lf, verbose=True, start_revision=1, end_revision=1)
92
92
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
93
93
                          start_revision=2, end_revision=1) 
112
112
        # no entries yet
113
113
        eq(lf.logs, [])
114
114
 
115
 
 
116
 
        b.commit('empty commit')
 
115
        b.working_tree().commit('empty commit')
117
116
        lf = LogCatcher()
118
117
        show_log(b, lf, verbose=True)
119
118
        eq(len(lf.logs), 1)
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.add('hello')
129
 
        b.commit('add one file')
 
127
        b.working_tree().commit('add one file')
130
128
 
131
129
        lf = StringIO()
132
130
        # log using regular thing
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)])
156
 
        b.commit(msg)
 
154
        self.log("original commit message: %r", msg)
 
155
        b.working_tree().commit(msg)
157
156
        lf = LogCatcher()
158
157
        show_log(b, lf, verbose=True)
159
158
        committed_msg = lf.logs[0].rev.message
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)