/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/transform.py

  • Committer: Martin Pool
  • Date: 2011-06-28 17:25:26 UTC
  • mfrom: (5999 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110628172526-10cok2s17dvw7x62
merge news

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,
225
226
        This means that the old root trans-id becomes obsolete, so it is
226
227
        recommended only to invoke this after the root trans-id has become
227
228
        irrelevant.
 
229
 
228
230
        """
229
231
        new_roots = [k for k, v in self._new_parent.iteritems() if v is
230
232
                     ROOT_PARENT]
231
233
        if len(new_roots) < 1:
 
234
            if self.final_kind(self.root) is None:
 
235
                self.cancel_deletion(self.root)
 
236
            if self.final_file_id(self.root) is None:
 
237
                self.version_file(self.tree_file_id(self.root),
 
238
                                     self.root)
232
239
            return
233
240
        if len(new_roots) != 1:
234
241
            raise ValueError('A tree cannot have two roots!')
3156
3163
 
3157
3164
def cook_conflicts(raw_conflicts, tt):
3158
3165
    """Generate a list of cooked conflicts, sorted by file path"""
3159
 
    from bzrlib.conflicts import Conflict
3160
3166
    conflict_iter = iter_cook_conflicts(raw_conflicts, tt)
3161
 
    return sorted(conflict_iter, key=Conflict.sort_key)
 
3167
    return sorted(conflict_iter, key=conflicts.Conflict.sort_key)
3162
3168
 
3163
3169
 
3164
3170
def iter_cook_conflicts(raw_conflicts, tt):
3165
 
    from bzrlib.conflicts import Conflict
3166
3171
    fp = FinalPaths(tt)
3167
3172
    for conflict in raw_conflicts:
3168
3173
        c_type = conflict[0]
3170
3175
        modified_path = fp.get_path(conflict[2])
3171
3176
        modified_id = tt.final_file_id(conflict[2])
3172
3177
        if len(conflict) == 3:
3173
 
            yield Conflict.factory(c_type, action=action, path=modified_path,
3174
 
                                     file_id=modified_id)
 
3178
            yield conflicts.Conflict.factory(
 
3179
                c_type, action=action, path=modified_path, file_id=modified_id)
3175
3180
 
3176
3181
        else:
3177
3182
            conflicting_path = fp.get_path(conflict[3])
3178
3183
            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)
 
3184
            yield conflicts.Conflict.factory(
 
3185
                c_type, action=action, path=modified_path,
 
3186
                file_id=modified_id,
 
3187
                conflict_path=conflicting_path,
 
3188
                conflict_file_id=conflicting_id)
3183
3189
 
3184
3190
 
3185
3191
class _FileMover(object):