~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-21 15:19:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5995.
  • Revision ID: v.ladeuil+lp@free.fr-20110621151918-qsr5g8sr66asb58a
Do not generate path conflicts if a corresponding content conflict exists

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    bencode,
33
33
    bzrdir,
34
34
    commit,
 
35
    conflicts,
35
36
    delta,
36
37
    errors,
37
38
    inventory,
3156
3157
 
3157
3158
def cook_conflicts(raw_conflicts, tt):
3158
3159
    """Generate a list of cooked conflicts, sorted by file path"""
3159
 
    from bzrlib.conflicts import Conflict
3160
3160
    conflict_iter = iter_cook_conflicts(raw_conflicts, tt)
3161
 
    return sorted(conflict_iter, key=Conflict.sort_key)
 
3161
    return sorted(conflict_iter, key=conflicts.Conflict.sort_key)
3162
3162
 
3163
3163
 
3164
3164
def iter_cook_conflicts(raw_conflicts, tt):
3165
 
    from bzrlib.conflicts import Conflict
3166
3165
    fp = FinalPaths(tt)
3167
3166
    for conflict in raw_conflicts:
3168
3167
        c_type = conflict[0]
3170
3169
        modified_path = fp.get_path(conflict[2])
3171
3170
        modified_id = tt.final_file_id(conflict[2])
3172
3171
        if len(conflict) == 3:
3173
 
            yield Conflict.factory(c_type, action=action, path=modified_path,
3174
 
                                     file_id=modified_id)
 
3172
            yield conflicts.Conflict.factory(
 
3173
                c_type, action=action, path=modified_path, file_id=modified_id)
3175
3174
 
3176
3175
        else:
3177
3176
            conflicting_path = fp.get_path(conflict[3])
3178
3177
            conflicting_id = tt.final_file_id(conflict[3])
3179
 
            yield Conflict.factory(c_type, action=action, path=modified_path,
3180
 
                                   file_id=modified_id,
3181
 
                                   conflict_path=conflicting_path,
3182
 
                                   conflict_file_id=conflicting_id)
 
3178
            yield conflicts.Conflict.factory(
 
3179
                c_type, action=action, path=modified_path,
 
3180
                file_id=modified_id,
 
3181
                conflict_path=conflicting_path,
 
3182
                conflict_file_id=conflicting_id)
3183
3183
 
3184
3184
 
3185
3185
class _FileMover(object):