~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

[merge] robertc's integration, updated tests to check for retcode=3

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
        branch = Branch.initialize('.')
192
192
        self.assertEqual('.bzr', branch._rel_controlfilename(''))
193
193
 
 
194
    def test_nicks(self):
 
195
        """Branch nicknames"""
 
196
        os.mkdir('bzr.dev')
 
197
        branch = Branch.initialize('bzr.dev')
 
198
        self.assertEqual(branch.nick, 'bzr.dev')
 
199
        os.rename('bzr.dev', 'bzr.ab')
 
200
        branch = Branch.open('bzr.ab')
 
201
        self.assertEqual(branch.nick, 'bzr.ab')
 
202
        branch.nick = "Aaron's branch"
 
203
        branch.nick = "Aaron's branch"
 
204
        self.failUnless(os.path.exists(branch.controlfilename("branch.conf")))
 
205
        self.assertEqual(branch.nick, "Aaron's branch")
 
206
        os.rename('bzr.ab', 'integration')
 
207
        branch = Branch.open('integration')
 
208
        self.assertEqual(branch.nick, "Aaron's branch")
 
209
        branch.nick = u"\u1234"
 
210
        self.assertEqual(branch.nick, u"\u1234")
 
211
 
 
212
    def test_commit_nicks(self):
 
213
        """Nicknames are committed to the revision"""
 
214
        os.mkdir('bzr.dev')
 
215
        branch = Branch.initialize('bzr.dev')
 
216
        branch.nick = "My happy branch"
 
217
        branch.working_tree().commit('My commit respect da nick.')
 
218
        committed = branch.get_revision(branch.last_revision())
 
219
        self.assertEqual(committed.properties["branch-nick"], 
 
220
                         "My happy branch")
 
221
 
194
222
 
195
223
class TestRemote(TestCaseWithWebserver):
196
224