/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_reconfigure.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    def prepare_lightweight_checkout_to_branch(self):
82
82
        branch = self.make_branch('branch')
83
83
        checkout = branch.create_checkout('checkout', lightweight=True)
84
 
        checkout.commit('first commit', rev_id='rev1')
 
84
        checkout.commit('first commit', rev_id=b'rev1')
85
85
        reconfiguration = reconfigure.Reconfigure.to_branch(checkout.controldir)
86
86
        return reconfiguration, checkout
87
87
 
229
229
    def make_unsynced_checkout(self):
230
230
        parent = self.make_branch('parent')
231
231
        checkout = parent.create_checkout('checkout')
232
 
        checkout.commit('test', rev_id='new-commit', local=True)
 
232
        checkout.commit('test', rev_id=b'new-commit', local=True)
233
233
        reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout(
234
234
            checkout.controldir)
235
235
        return checkout, parent, reconfiguration
252
252
    def prepare_branch_to_lightweight_checkout(self):
253
253
        parent = self.make_branch('parent')
254
254
        child = parent.controldir.sprout('child').open_workingtree()
255
 
        child.commit('test', rev_id='new-commit')
 
255
        child.commit('test', rev_id=b'new-commit')
256
256
        parent.pull(child.branch)
257
257
        child.controldir.destroy_workingtree()
258
258
        reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout(
329
329
    def test_standalone_to_use_shared(self):
330
330
        self.build_tree(['root/'])
331
331
        tree = self.make_branch_and_tree('root/tree')
332
 
        tree.commit('Hello', rev_id='hello-id')
 
332
        tree.commit('Hello', rev_id=b'hello-id')
333
333
        repo = self.make_repository('root', shared=True)
334
334
        reconfiguration = reconfigure.Reconfigure.to_use_shared(tree.controldir)
335
335
        reconfiguration.apply()
339
339
 
340
340
    def add_dead_head(self, tree):
341
341
        revno, revision_id = tree.branch.last_revision_info()
342
 
        tree.commit('Dead head', rev_id='dead-head-id')
 
342
        tree.commit('Dead head', rev_id=b'dead-head-id')
343
343
        tree.branch.set_last_revision_info(revno, revision_id)
344
344
        tree.set_last_revision(revision_id)
345
345
 
347
347
        self.build_tree(['root/'])
348
348
        tree = self.make_branch_and_tree('root/tree')
349
349
        self.add_dead_head(tree)
350
 
        tree.commit('Hello', rev_id='hello-id')
 
350
        tree.commit('Hello', rev_id=b'hello-id')
351
351
        repo = self.make_repository('root', shared=True)
352
352
        reconfiguration = reconfigure.Reconfigure.to_use_shared(tree.controldir)
353
353
        reconfiguration.apply()
369
369
 
370
370
    def test_use_shared_to_standalone(self):
371
371
        tree = self.make_repository_tree()
372
 
        tree.commit('Hello', rev_id='hello-id')
 
372
        tree.commit('Hello', rev_id=b'hello-id')
373
373
        reconfigure.Reconfigure.to_standalone(tree.controldir).apply()
374
374
        tree = workingtree.WorkingTree.open('root/tree')
375
375
        repo = tree.branch.repository
380
380
    def test_use_shared_to_standalone_preserves_dead_heads(self):
381
381
        tree = self.make_repository_tree()
382
382
        self.add_dead_head(tree)
383
 
        tree.commit('Hello', rev_id='hello-id')
 
383
        tree.commit('Hello', rev_id=b'hello-id')
384
384
        reconfigure.Reconfigure.to_standalone(tree.controldir).apply()
385
385
        tree = workingtree.WorkingTree.open('root/tree')
386
386
        repo = tree.branch.repository