~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/conflicts.py

  • Committer: Patch Queue Manager
  • Date: 2011-10-06 10:15:06 UTC
  • mfrom: (6195.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20111006101506-mychax14dy7yjee2
(vila) Tag bzr-2.5b2 missed during freeze (Vincent Ladeuil)

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
35
36
""")
36
37
from bzrlib import (
37
38
    commands,
120
121
    def run(self, file_list=None, all=False, action=None, directory=None):
121
122
        if all:
122
123
            if file_list:
123
 
                raise errors.BzrCommandError("If --all is specified,"
124
 
                                             " no FILE may be provided")
 
124
                raise errors.BzrCommandError(gettext("If --all is specified,"
 
125
                                             " no FILE may be provided"))
125
126
            if directory is None:
126
127
                directory = u'.'
127
128
            tree = workingtree.WorkingTree.open_containing(directory)[0]
145
146
            if file_list is None:
146
147
                un_resolved, resolved = tree.auto_resolve()
147
148
                if len(un_resolved) > 0:
148
 
                    trace.note('%d conflict(s) auto-resolved.', len(resolved))
149
 
                    trace.note('Remaining conflicts:')
 
149
                    trace.note(ngettext('%d conflict auto-resolved.',
 
150
                        '%d conflicts auto-resolved.', len(resolved)),
 
151
                        len(resolved))
 
152
                    trace.note(gettext('Remaining conflicts:'))
150
153
                    for conflict in un_resolved:
151
154
                        trace.note(unicode(conflict))
152
155
                    return 1
153
156
                else:
154
 
                    trace.note('All conflicts resolved.')
 
157
                    trace.note(gettext('All conflicts resolved.'))
155
158
                    return 0
156
159
            else:
157
160
                # FIXME: This can never occur but the block above needs some
160
163
                pass
161
164
        else:
162
165
            before, after = resolve(tree, file_list, action=action)
163
 
            trace.note('%d conflict(s) resolved, %d remaining'
164
 
                       % (before - after, after))
 
166
            trace.note(ngettext('{0} conflict resolved, {1} remaining',
 
167
                                '{0} conflicts resolved, {1} remaining',
 
168
                                before-after).format(before - after, after))
165
169
 
166
170
 
167
171
def resolve(tree, paths=None, ignore_misses=False, recursive=False,