/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 bzrlib/tests/test_smart.py

merge trailing whitespace removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
            request.execute(''))
173
173
 
174
174
    def test_nonshared_repository(self):
175
 
        # nonshared repositorys only allow 'find' to return a handle when the 
176
 
        # path the repository is being searched on is the same as that that 
 
175
        # nonshared repositorys only allow 'find' to return a handle when the
 
176
        # path the repository is being searched on is the same as that that
177
177
        # the repository is at.
178
178
        backing = self.get_transport()
179
179
        request = self._request_class(backing)
250
250
        self.assertEqual(SmartServerResponse(('ok', )),
251
251
            request.execute(''))
252
252
        made_dir = bzrdir.BzrDir.open_from_transport(backing)
253
 
        # no branch, tree or repository is expected with the current 
 
253
        # no branch, tree or repository is expected with the current
254
254
        # default formart.
255
255
        self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)
256
256
        self.assertRaises(errors.NotBranchError, made_dir.open_branch)
388
388
    def test_with_content(self):
389
389
        # SmartServerBranchGetConfigFile should return the content from
390
390
        # branch.control_files.get('branch.conf') for now - in the future it may
391
 
        # perform more complex processing. 
 
391
        # perform more complex processing.
392
392
        backing = self.get_transport()
393
393
        request = smart.branch.SmartServerBranchGetConfigFile(backing)
394
394
        branch = self.make_branch('.')
415
415
 
416
416
    def unlock_branch(self):
417
417
        self.tree.branch.unlock()
418
 
        
 
418
 
419
419
    def set_last_revision(self, revision_id, revno):
420
420
        branch_token, repo_token = self.lock_branch()
421
421
        response = self._set_last_revision(
427
427
        response = self.set_last_revision(revision_id, revno)
428
428
        self.assertEqual(SuccessfulSmartServerResponse(('ok',)), response)
429
429
 
430
 
        
 
430
 
431
431
class TestSetLastRevisionVerbMixin(object):
432
432
    """Mixin test case for verbs that implement set_last_revision."""
433
433
 
538
538
        self.assertEqual(
539
539
            SuccessfulSmartServerResponse(('ok', revno, revision_id)),
540
540
            response)
541
 
        
 
541
 
542
542
    def test_branch_last_revision_info_rewind(self):
543
543
        """A branch's tip can be set to a revision that is an ancestor of the
544
544
        current tip, but only if allow_overwrite_descendant is passed.
587
587
        # child-1.
588
588
        new_r2 = self.tree.commit('2nd commit', rev_id='child-2')
589
589
        self.tree.unlock()
590
 
        
 
590
 
591
591
    def test_not_allow_diverged(self):
592
592
        """If allow_diverged is not passed, then setting a divergent history
593
593
        returns a Diverged error.
834
834
 
835
835
        self.assertEqual(SmartServerResponse(('ok', ), rev_id_utf8),
836
836
            request.execute('', rev_id_utf8))
837
 
    
 
837
 
838
838
    def test_no_such_revision(self):
839
839
        backing = self.get_transport()
840
840
        request = smart.repository.SmartServerRepositoryGetRevisionGraph(backing)
1060
1060
        self.assertEqual(SmartServerResponse(('ok',)), response)
1061
1061
        repo._pack_collection.reload_pack_names()
1062
1062
        self.assertEqual(1, len(repo._pack_collection.names()))
1063
 
    
 
1063
 
1064
1064
    def test_autopack_not_needed(self):
1065
1065
        tree = self.make_branch_and_tree('.', format='pack-0.92')
1066
1066
        repo = tree.branch.repository
1073
1073
        self.assertEqual(SmartServerResponse(('ok',)), response)
1074
1074
        repo._pack_collection.reload_pack_names()
1075
1075
        self.assertEqual(9, len(repo._pack_collection.names()))
1076
 
    
 
1076
 
1077
1077
    def test_autopack_on_nonpack_format(self):
1078
1078
        """A request to autopack a non-pack repo is a no-op."""
1079
1079
        repo = self.make_repository('.', format='knit')
1082
1082
            backing)
1083
1083
        response = request.execute('')
1084
1084
        self.assertEqual(SmartServerResponse(('ok',)), response)
1085
 
        
 
1085
 
1086
1086
 
1087
1087
class TestHandlers(tests.TestCase):
1088
1088
    """Tests for the request.request_handlers object."""