~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_core.py

  • Committer: Aaron Bentley
  • Date: 2005-10-13 21:10:11 UTC
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1460.
  • Revision ID: abentley@panoramicfeedback.com-20051013211011-7aeccd5c452e31ee
Replaced FileCreate with TreeFileCreate, fixed revert with empty parents

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
        self.file_id = file_id
14
14
        self.base = base
15
15
        self.other = other
16
 
 
 
16
 
 
17
    def is_creation(self):
 
18
        return False
 
19
 
 
20
    def is_deletion(self):
 
21
        return False
 
22
 
17
23
    def __eq__(self, other):
18
24
        if not isinstance(other, ApplyMerge3):
19
25
            return False
65
71
    """Contents-change wrapper to back up file first"""
66
72
    def __init__(self, contents_change):
67
73
        self.contents_change = contents_change
68
 
 
 
74
 
 
75
    def is_creation(self):
 
76
        return self.contents_change.is_creation()
 
77
 
 
78
    def is_deletion(self):
 
79
        return self.contents_change.is_deletion()
 
80
 
69
81
    def __eq__(self, other):
70
82
        if not isinstance(other, BackupBeforeChange):
71
83
            return False
229
241
                    other_path = other.readonly_path(entry.id)    
230
242
                    conflict_handler.new_contents_conflict(this_path, 
231
243
                                                           other_path)
232
 
        elif isinstance(contents.old_contents, changeset.FileCreate) and \
233
 
            isinstance(contents.new_contents, changeset.FileCreate):
 
244
        elif isinstance(contents.old_contents, changeset.TreeFileCreate) and \
 
245
            isinstance(contents.new_contents, changeset.TreeFileCreate):
234
246
            return make_merge()
235
247
        else:
236
 
            raise Exception("Unhandled merge scenario")
 
248
            raise Exception("Unhandled merge scenario %r" % contents)
237
249
 
238
250
def make_merged_metadata(entry, base, other):
239
251
    metadata = entry.metadata_change