/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_switch.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        to_branch = branch.Branch.open('branch-2')
124
124
        # Check fails without --force
125
125
        err = self.assertRaises(
126
 
            (errors.BzrCommandError, errors.NotBranchError),
 
126
            (errors.CommandError, errors.NotBranchError),
127
127
            switch.switch, checkout.controldir, to_branch)
128
 
        if isinstance(err, errors.BzrCommandError):
 
128
        if isinstance(err, errors.CommandError):
129
129
            self.assertContainsRe(str(err),
130
130
                                  'Unable to connect to current master branch .*'
131
131
                                  'To switch anyway, use --force.')
147
147
        tree2.commit('rev2')
148
148
        checkout.merge_from_branch(tree2.branch)
149
149
        # Check the error reporting is as expected
150
 
        err = self.assertRaises(errors.BzrCommandError,
 
150
        err = self.assertRaises(errors.CommandError,
151
151
                                switch.switch, checkout.controldir, tree2.branch)
152
152
        self.assertContainsRe(str(err),
153
153
                              "Pending merges must be committed or reverted before using switch")
179
179
        checkout = tree.branch.create_checkout('checkout',
180
180
                                               lightweight=self.lightweight)
181
181
        switch.switch(checkout.controldir, tree2.branch)
182
 
        self.assertEqual(b'custom-root-id', tree2.get_root_id())
 
182
        self.assertEqual(b'custom-root-id', tree2.path2id(''))
183
183
 
184
184
    def test_switch_configurable_file_merger(self):
185
185
        class DummyMerger(_mod_merge.ConfigurableFileMerger):
220
220
        checkout.commit(message='local only commit', local=True)
221
221
        self.build_tree(['checkout/file-4'])
222
222
        # Check the error reporting is as expected
223
 
        err = self.assertRaises(errors.BzrCommandError,
 
223
        err = self.assertRaises(errors.CommandError,
224
224
                                switch.switch, checkout.controldir, to_branch)
225
225
        self.assertContainsRe(str(err),
226
226
                              'Cannot switch as local commits found in the checkout.')