~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

Simplify slightly more.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1205
1205
            if hook_status != 'not_applicable':
1206
1206
                # Don't try any more hooks, this one applies.
1207
1207
                break
1208
 
        contents_conflict = False
 
1208
        result = "modified"
1209
1209
        if hook_status == 'not_applicable':
1210
1210
            # This is a contents conflict, because none of the available
1211
1211
            # functions could merge it.
1212
 
            contents_conflict = True
 
1212
            result = None
1213
1213
            name = self.tt.final_name(trans_id)
1214
1214
            parent_id = self.tt.final_parent(trans_id)
1215
1215
            if file_id in self.this_tree.inventory:
1230
1230
            file_group.append(trans_id)
1231
1231
        elif hook_status == 'delete':
1232
1232
            self.tt.unversion_file(trans_id)
1233
 
            if file_id in self.this_tree:
1234
 
                self.tt.delete_contents(trans_id)
1235
 
            return "deleted"
 
1233
            result = "deleted"
1236
1234
        elif hook_status == 'done':
1237
1235
            # The hook function did whatever it needs to do directly, no
1238
1236
            # further action needed here.
1239
1237
            pass
1240
1238
        else:
1241
 
            raise AssertionError(
1242
 
                'unknown hook_status: %r' % (hook_status,))
1243
 
        if file_id not in self.this_tree and not contents_conflict:
 
1239
            raise AssertionError('unknown hook_status: %r' % (hook_status,))
 
1240
        if file_id not in self.this_tree and result == "modified":
1244
1241
            self.tt.version_file(file_id, trans_id)
1245
1242
        try:
1246
1243
            self.tt.tree_kind(trans_id)
1247
1244
            self.tt.delete_contents(trans_id)
1248
1245
        except errors.NoSuchFile:
1249
1246
            pass
1250
 
        if not contents_conflict:
1251
 
            return "modified"
 
1247
        return result
1252
1248
 
1253
1249
    def _default_other_winner_merge(self, merge_hook_params):
1254
1250
        """Replace this contents with other."""