/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/transport/fakevfat.py

  • Committer: Vincent Ladeuil
  • Date: 2009-10-06 14:40:37 UTC
  • mto: (4728.1.2 integration)
  • mto: This revision was merged to the branch mainline in revision 4731.
  • Revision ID: v.ladeuil+lp@free.fr-20091006144037-o76rgosv9hj3td0y
Simplify mutable_tree.has_changes() and update call sites.

* bzrlib/workingtree.py:
(WorkingTree.merge_from_branch): Add a force parameter. Replace
the check_basis() call by the corresponding code, taken the new
'force' parameter into account.

* bzrlib/tests/test_status.py:
(TestStatus.make_multiple_pending_tree): Add force=True on
supplementary merges.

* bzrlib/tests/test_reconfigure.py:
(TestReconfigure): Add a test for pending merges.

* bzrlib/tests/test_msgeditor.py:
(MsgEditorTest.make_multiple_pending_tree): Add force=True on
supplementary merges.

* bzrlib/tests/blackbox/test_uncommit.py:
(TestUncommit.test_uncommit_octopus_merge): Add force=True on
supplementary merges.

* bzrlib/send.py:
(send): Use the simplified has_changes(). Fix typo in comment too.

* bzrlib/reconfigure.py:
(Reconfigure._check): Use the simplified has_changes().

* bzrlib/mutabletree.py:
(MutableTree.has_changes): Make the tree parameter optional but
retain it for tests. Add a pending merges check.

* bzrlib/merge.py:
(Merger.ensure_revision_trees, Merger.file_revisions,
Merger.check_basis, Merger.compare_basis): Deprecate.

* bzrlib/bundle/apply_bundle.py:
(merge_bundle): Replace the check_basis() call by the
corresponding code.

* bzrlib/builtins.py:
(cmd_remove_tree.run, cmd_push.run, cmd_merge.run): Use the
simplified has_changes().
(cmd_merge.run): Replace the check_basis call() by the corresponding
code (minus the alredy done has_changes() check).

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
import re
42
42
 
43
43
from bzrlib.errors import TransportNotPossible
44
 
from bzrlib.transport import decorator
 
44
from bzrlib.transport.decorator import TransportDecorator, DecoratorServer
45
45
 
46
46
 
47
47
# TODO: It might be nice if these hooks were available in a more general way
52
52
# which are not implemented here fail by default?
53
53
 
54
54
 
55
 
class FakeVFATTransportDecorator(decorator.TransportDecorator):
 
55
class FakeVFATTransportDecorator(TransportDecorator):
56
56
    """A decorator that can convert any transport to be readonly.
57
57
 
58
58
    This is requested via the 'vfat+' prefix to get_transport().
99
99
        return self._decorated.put_file(self._squash_name(relpath), f, mode)
100
100
 
101
101
 
 
102
class FakeVFATServer(DecoratorServer):
 
103
    """A server that suggests connections through FakeVFATTransportDecorator
 
104
 
 
105
    For use in testing.
 
106
    """
 
107
 
 
108
    def get_decorator_class(self):
 
109
        return FakeVFATTransportDecorator
 
110
 
 
111
 
102
112
def get_test_permutations():
103
113
    """Return the permutations to be used in testing."""
104
 
    from bzrlib.tests import test_server
105
 
    return [(FakeVFATTransportDecorator, test_server.FakeVFATServer),]
 
114
    return [(FakeVFATTransportDecorator, FakeVFATServer),
 
115
            ]