~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-28 10:06:39 UTC
  • mfrom: (6437.40.2 rmbranch-colo)
  • mto: This revision was merged to the branch mainline in revision 6482.
  • Revision ID: jelmer@samba.org-20120228100639-p5gndu91wuqwugti
Merge rmbranch-colo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
419
419
        backing = self.get_transport()
420
420
        request = self._request_class(backing)
421
421
        result = self._make_repository_and_result(
422
 
            format='dirstate-with-subtree')
 
422
            format='development-subtree')
423
423
        # check the test will be valid
424
424
        self.assertEqual('yes', result.args[2])
425
425
        self.assertEqual('yes', result.args[3])
430
430
        backing = self.get_transport()
431
431
        request = self._request_class(backing)
432
432
        result = self._make_repository_and_result(
433
 
            format='dirstate-with-subtree')
 
433
            format='development-subtree')
434
434
        # check the test will be valid
435
 
        self.assertEqual('no', result.args[4])
 
435
        self.assertEqual('yes', result.args[4])
436
436
        self.assertEqual(result, request.execute(''))
437
437
 
438
438
 
1323
1323
        finally:
1324
1324
            branch.unlock()
1325
1325
        self.assertEqual(smart_req.SuccessfulSmartServerResponse(()), response)
 
1326
        # Refresh branch as SetParentLocation modified it
 
1327
        branch = branch.bzrdir.open_branch()
1326
1328
        self.assertEqual(None, branch.get_parent())
1327
1329
 
1328
1330
    def test_set_parent_something(self):
1332
1334
        branch_token, repo_token = self.get_lock_tokens(branch)
1333
1335
        try:
1334
1336
            response = request.execute('base', branch_token, repo_token,
1335
 
            'http://bar/')
 
1337
                                       'http://bar/')
1336
1338
        finally:
1337
1339
            branch.unlock()
1338
1340
        self.assertEqual(smart_req.SuccessfulSmartServerResponse(()), response)
1339
 
        self.assertEqual('http://bar/', branch.get_parent())
 
1341
        refreshed = _mod_branch.Branch.open(branch.base)
 
1342
        self.assertEqual('http://bar/', refreshed.get_parent())
1340
1343
 
1341
1344
 
1342
1345
class TestSmartServerBranchRequestGetTagsBytes(
2666
2669
class TestSmartServerRepositoryGetInventories(tests.TestCaseWithTransport):
2667
2670
 
2668
2671
    def _get_serialized_inventory_delta(self, repository, base_revid, revid):
2669
 
        base_inv = repository.revision_tree(base_revid).inventory
2670
 
        inv = repository.revision_tree(revid).inventory
 
2672
        base_inv = repository.revision_tree(base_revid).root_inventory
 
2673
        inv = repository.revision_tree(revid).root_inventory
2671
2674
        inv_delta = inv._make_delta(base_inv)
2672
2675
        serializer = inventory_delta.InventoryDeltaSerializer(True, False)
2673
2676
        return "".join(serializer.delta_to_lines(base_revid, revid, inv_delta))