~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: 2010-11-11 08:45:19 UTC
  • mfrom: (4597.9.22 reports-conflict-resolved)
  • Revision ID: pqm@pqm.ubuntu.com-20101111084519-bmk1zmblp7kex41a
(vila) More feedback about the conflicts just resolved and the remaining
 ones. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
                # conflict.auto(tree) --vila 091242
160
160
                pass
161
161
        else:
162
 
            resolve(tree, file_list, action=action)
 
162
            before, after = resolve(tree, file_list, action=action)
 
163
            trace.note('%d conflict(s) resolved, %d remaining'
 
164
                       % (before - after, after))
163
165
 
164
166
 
165
167
def resolve(tree, paths=None, ignore_misses=False, recursive=False,
178
180
    :param action: How the conflict should be resolved,
179
181
    """
180
182
    tree.lock_tree_write()
 
183
    nb_conflicts_after = None
181
184
    try:
182
185
        tree_conflicts = tree.conflicts()
 
186
        nb_conflicts_before = len(tree_conflicts)
183
187
        if paths is None:
184
188
            new_conflicts = ConflictList()
185
189
            to_process = tree_conflicts
193
197
            except NotImplementedError:
194
198
                new_conflicts.append(conflict)
195
199
        try:
 
200
            nb_conflicts_after = len(new_conflicts)
196
201
            tree.set_conflicts(new_conflicts)
197
202
        except errors.UnsupportedOperation:
198
203
            pass
199
204
    finally:
200
205
        tree.unlock()
 
206
    if nb_conflicts_after is None:
 
207
        nb_conflicts_after = nb_conflicts_before
 
208
    return nb_conflicts_before, nb_conflicts_after
201
209
 
202
210
 
203
211
def restore(filename):