~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/conflicts.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-03 04:57:59 UTC
  • mfrom: (6042.1.2 fix-log-2)
  • Revision ID: pqm@pqm.ubuntu.com-20110803045759-1lrr8eymve8ofldr
(mbp) Log levels are no longer reset to what the log formatter supports (bug
 747958) (Thomi Richards)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    transform,
33
33
    workingtree,
34
34
    )
35
 
from bzrlib.i18n import gettext, ngettext
36
35
""")
37
36
from bzrlib import (
38
37
    commands,
80
79
 
81
80
 
82
81
resolve_action_registry.register(
83
 
    'done', 'done', 'Marks the conflict as resolved.')
 
82
    'done', 'done', 'Marks the conflict as resolved' )
84
83
resolve_action_registry.register(
85
84
    'take-this', 'take_this',
86
 
    'Resolve the conflict preserving the version in the working tree.')
 
85
    'Resolve the conflict preserving the version in the working tree' )
87
86
resolve_action_registry.register(
88
87
    'take-other', 'take_other',
89
 
    'Resolve the conflict taking the merged version into account.')
 
88
    'Resolve the conflict taking the merged version into account' )
90
89
resolve_action_registry.default_key = 'done'
91
90
 
92
91
class ResolveActionOption(option.RegistryOption):
121
120
    def run(self, file_list=None, all=False, action=None, directory=None):
122
121
        if all:
123
122
            if file_list:
124
 
                raise errors.BzrCommandError(gettext("If --all is specified,"
125
 
                                             " no FILE may be provided"))
 
123
                raise errors.BzrCommandError("If --all is specified,"
 
124
                                             " no FILE may be provided")
126
125
            if directory is None:
127
126
                directory = u'.'
128
127
            tree = workingtree.WorkingTree.open_containing(directory)[0]
146
145
            if file_list is None:
147
146
                un_resolved, resolved = tree.auto_resolve()
148
147
                if len(un_resolved) > 0:
149
 
                    trace.note(ngettext('%d conflict auto-resolved.',
150
 
                        '%d conflicts auto-resolved.', len(resolved)),
151
 
                        len(resolved))
152
 
                    trace.note(gettext('Remaining conflicts:'))
 
148
                    trace.note('%d conflict(s) auto-resolved.', len(resolved))
 
149
                    trace.note('Remaining conflicts:')
153
150
                    for conflict in un_resolved:
154
151
                        trace.note(unicode(conflict))
155
152
                    return 1
156
153
                else:
157
 
                    trace.note(gettext('All conflicts resolved.'))
 
154
                    trace.note('All conflicts resolved.')
158
155
                    return 0
159
156
            else:
160
157
                # FIXME: This can never occur but the block above needs some
163
160
                pass
164
161
        else:
165
162
            before, after = resolve(tree, file_list, action=action)
166
 
            trace.note(ngettext('{0} conflict resolved, {1} remaining',
167
 
                                '{0} conflicts resolved, {1} remaining',
168
 
                                before-after).format(before - after, after))
 
163
            trace.note('%d conflict(s) resolved, %d remaining'
 
164
                       % (before - after, after))
169
165
 
170
166
 
171
167
def resolve(tree, paths=None, ignore_misses=False, recursive=False,