~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_core.py

  • Committer: Robert Collins
  • Date: 2005-10-03 01:15:02 UTC
  • mfrom: (1092.2.28)
  • Revision ID: robertc@robertcollins.net-20051003011502-f579a509a136b774
mergeĀ fromĀ baz2bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os.path
 
2
 
1
3
import changeset
2
4
from changeset import Inventory, apply_changeset, invert_dict
3
 
import os.path
4
 
from osutils import backup_file, rename
5
 
from merge3 import Merge3
 
5
from bzrlib.osutils import backup_file, rename
 
6
from bzrlib.merge3 import Merge3
 
7
import bzrlib
6
8
 
7
9
class ApplyMerge3:
8
10
    """Contents-change wrapper around merge3.Merge3"""
206
208
    tree_entry = tree.tree.inventory[file_id]
207
209
    if tree_entry.kind == "file":
208
210
        return changeset.FileCreate(tree.get_file(file_id).read())
 
211
    elif tree_entry.kind == "symlink":
 
212
        return changeset.SymlinkCreate(tree.get_symlink_target(file_id))
209
213
    else:
210
214
        assert tree_entry.kind in ("root_directory", "directory")
211
215
        return changeset.dir_create
228
232
            return None
229
233
        if contents.new_contents is None:
230
234
            this_contents = get_contents(entry, this)
231
 
            if this_path is not None and os.path.exists(this_path):
 
235
            if this_path is not None and bzrlib.osutils.lexists(this_path):
232
236
                if this_contents != contents.old_contents:
233
237
                    return conflict_handler.rem_contents_conflict(this_path, 
234
238
                        this_contents, contents.old_contents)
236
240
            else:
237
241
                return None
238
242
        elif contents.old_contents is None:
239
 
            if this_path is None or not os.path.exists(this_path):
 
243
            if this_path is None or not bzrlib.osutils.lexists(this_path):
240
244
                return contents
241
245
            else:
242
246
                this_contents = get_contents(entry, this)