/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/push.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) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 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
17
17
"""UI helper for the push command."""
18
18
 
19
19
from bzrlib import (
 
20
    builtins,
 
21
    branch,
20
22
    bzrdir,
21
23
    errors,
22
24
    revision as _mod_revision,
108
110
                    "\nYou may supply --create-prefix to create all"
109
111
                    " leading parent directories."
110
112
                    % location)
111
 
            # This shouldn't occur (because create_prefix is true, so
112
 
            # create_clone_on_transport should be catching NoSuchFile and
113
 
            # creating the missing directories) but if it does the original
114
 
            # NoSuchFile error will be more informative than an
115
 
            # UnboundLocalError for br_to.
116
 
            raise
117
113
        except errors.TooManyRedirections:
118
114
            raise errors.BzrCommandError("Too many redirections trying "
119
115
                                         "to make %s." % location)
141
137
            raise errors.BzrCommandError('These branches have diverged.'
142
138
                                    '  See "bzr help diverged-branches"'
143
139
                                    ' for more information.')
144
 
        except errors.NoRoundtrippingSupport, e:
145
 
            raise errors.BzrCommandError("It is not possible to losslessly "
146
 
                "push to %s. You may want to use dpush instead." % 
147
 
                    e.target_branch.mapping.vcs.abbreviation)
148
140
        except errors.NoRepositoryPresent:
149
141
            # we have a bzrdir but no branch or repository
150
142
            # XXX: Figure out what to do other than complain.