~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

  • Committer: Martin Pool
  • Date: 2005-09-16 03:32:44 UTC
  • mfrom: (1185.1.23)
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050916033244-18c4f4bcba663e42
- merge in many integration fixes from Robert

  * xml escaping of unprintable characters

  * 'make clean'

  * new, more consistent Branch constructors 

  * RemoteBranch tests against local farmework

  * scott's non-verbose commit fix 

This seems to break this usage though 

  bzr diff -r 1207..1208 ../bzr.robertc-integration

robertc@robertcollins.net-20050915175953-a16fdc627ce7c541

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
84
84
                          start_revision=1, end_revision=-1) 
85
85
 
 
86
    def test_cur_revno(self):
 
87
        b = Branch.initialize('.')
 
88
 
 
89
        lf = LogCatcher()
 
90
        b.commit('empty commit')
 
91
        show_log(b, lf, verbose=True, start_revision=1, end_revision=1)
 
92
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
93
                          start_revision=2, end_revision=1) 
 
94
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
95
                          start_revision=1, end_revision=2) 
 
96
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
97
                          start_revision=0, end_revision=2) 
 
98
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
99
                          start_revision=1, end_revision=0) 
 
100
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
101
                          start_revision=-1, end_revision=1) 
 
102
        self.assertRaises(InvalidRevisionNumber, show_log, b, lf,
 
103
                          start_revision=1, end_revision=-1) 
 
104
 
86
105
    def test_simple_log(self):
87
106
        eq = self.assertEquals
88
107
        
89
 
        b = Branch('.', init=True)
 
108
        b = Branch.initialize('.')
90
109
 
91
110
        lf = LogCatcher()
92
111
        show_log(b, lf)
132
151
        self.log('log 2 delta: %r' % d)
133
152
        # self.checkDelta(d, added=['hello'])
134
153
        
 
154
        # commit a log message with control characters
 
155
        msg = "All 8-bit chars: " +  ''.join([unichr(x) for x in range(256)])
 
156
        b.commit(msg)
 
157
        lf = LogCatcher()
 
158
        show_log(b, lf, verbose=True)
 
159
        committed_msg = lf.logs[0].rev.message
 
160
        self.log("escaped commit message: %r", committed_msg)
 
161
        self.assert_(msg != committed_msg)
 
162
        self.assert_(len(committed_msg) > len(msg))