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

Replace --interactive by --action.

* bzrlib/tests/test_conflicts.py:
Switch from --interactive to --action.

* bzrlib/tests/blackbox/test_conflicts.py:
(TestResolve): Delete the --interactive tests.

* bzrlib/conflicts.py:
(cmd_resolve.run): Add an 'action' parameter. Refactor to clarify
what action is executed when. Get rid of the --interactive attempt.
(resolve): Add an 'action' parameter. Refactor to make the
conflict deletion depends on the resolution success.
(_resolve_interactive): Deleted.
(ConflictList.remove_files): Use conflict.cleanup()
(Conflict._do): Helper to execute an arbitratry resolution action.
(Conflict.cleanup, Conflict.done, Conflict.keep_mine,
Conflict.take_their): Declare the abstract methods.
(PathConflict.cleanup, PathConflict.done): Do-nothing
implementations.
(ContentsConflict.cleanup): Specific cleanup (strange).
(TextConflict.cleanup): Specific cleanup.
(HandledConflict.done, HandledConflict.cleanup): Do nothing
implementations.
(UnversionedParent.keep_mine, UnversionedParent.take_their): Hmm,
forced do-nothing implementations, something weird is going on
here.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2009 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
82
82
            self.repository = None
83
83
            self.local_repository = None
84
84
        else:
85
 
            if (self.repository.user_url == self.bzrdir.user_url):
 
85
            if (self.repository.bzrdir.root_transport.base ==
 
86
                self.bzrdir.root_transport.base):
86
87
                self.local_repository = self.repository
87
88
            else:
88
89
                self.local_repository = None
89
90
        try:
90
91
            branch = self.bzrdir.open_branch()
91
 
            if branch.user_url == bzrdir.user_url:
 
92
            if branch.bzrdir.root_transport.base == bzrdir.root_transport.base:
92
93
                self.local_branch = branch
93
94
                self.referenced_branch = None
94
95
            else:
216
217
            if not want_reference:
217
218
                self._create_repository = True
218
219
        else:
219
 
            if want_reference and (
220
 
                self.repository.user_url == self.bzrdir.user_url):
 
220
            if want_reference and (self.repository.bzrdir.root_transport.base
 
221
                                   == self.bzrdir.root_transport.base):
221
222
                if not self.repository.is_shared():
222
223
                    self._destroy_repository = True
223
224
        if self.referenced_branch is None:
343
344
            if self._create_reference:
344
345
                reference_branch.repository.fetch(self.repository)
345
346
            elif self.local_branch is not None and not self._destroy_branch:
346
 
                up = self.local_branch.user_transport.clone('..')
 
347
                up = self.local_branch.bzrdir.root_transport.clone('..')
347
348
                up_bzrdir = bzrdir.BzrDir.open_containing_from_transport(up)[0]
348
349
                new_repo = up_bzrdir.find_repository()
349
350
                new_repo.fetch(self.repository)
367
368
            local_branch = self.local_branch
368
369
        if self._create_reference:
369
370
            format = branch.BranchReferenceFormat().initialize(self.bzrdir,
370
 
                target_branch=reference_branch)
 
371
                reference_branch)
371
372
        if self._destroy_tree:
372
373
            self.bzrdir.destroy_workingtree()
373
374
        if self._create_tree: