~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_merge_core.py

  • Committer: Martin Pool
  • Date: 2006-01-30 06:23:50 UTC
  • mfrom: (1534.1.17 integration)
  • Revision ID: mbp@sourcefrog.net-20060130062350-d6f25277ddcdfd79
[merge] robert's integration of much recent work

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import os.path
3
3
from tempfile import mkstemp
4
4
 
5
 
import changeset
6
 
from changeset import Inventory, apply_changeset, invert_dict
 
5
from bzrlib import _changeset
 
6
from bzrlib._changeset import Inventory, apply_changeset, invert_dict
7
7
from bzrlib.osutils import backup_file, rename, pathjoin
8
8
from bzrlib.merge3 import Merge3
9
9
import bzrlib
10
10
from bzrlib.atomicfile import AtomicFile
11
 
from changeset import get_contents
 
11
from bzrlib._changeset import get_contents
12
12
 
13
13
 
14
14
class ApplyMerge3:
171
171
 
172
172
def make_merge_changeset(cset, this, base, other, 
173
173
                         conflict_handler, merge_factory):
174
 
    new_cset = changeset.Changeset()
 
174
    new_cset = _changeset.Changeset()
175
175
 
176
176
    for entry in cset.entries.itervalues():
177
177
        if entry.is_boring():
255
255
 
256
256
    old_path = get_path(old_name, old_parent)
257
257
        
258
 
    new_entry = changeset.ChangesetEntry(entry.id, old_parent, old_path)
 
258
    new_entry = _changeset.ChangesetEntry(entry.id, old_parent, old_path)
259
259
    new_entry.new_path = get_path(new_name, new_parent)
260
260
    new_entry.new_parent = new_parent
261
261
    mutter(repr(new_entry))
277
277
                                                      other.id2path(entry.id))
278
278
        return merge_factory(entry.id, base, other)
279
279
 
280
 
    if isinstance(contents, changeset.ReplaceContents):
 
280
    if isinstance(contents, _changeset.ReplaceContents):
281
281
        base_contents = contents.old_contents
282
282
        other_contents = contents.new_contents
283
283
        if base_contents is None and other_contents is None:
301
301
                else:
302
302
                    conflict_handler.new_contents_conflict(this_path, 
303
303
                        other_contents)
304
 
        elif isinstance(base_contents, changeset.TreeFileCreate) and \
305
 
            isinstance(other_contents, changeset.TreeFileCreate):
 
304
        elif isinstance(base_contents, _changeset.TreeFileCreate) and \
 
305
            isinstance(other_contents, _changeset.TreeFileCreate):
306
306
            return make_merge()
307
307
        else:
308
308
            this_contents = get_contents(this, entry.id)
323
323
    metadata = entry.metadata_change
324
324
    if metadata is None:
325
325
        return None
326
 
    assert isinstance(metadata, changeset.ChangeExecFlag)
 
326
    assert isinstance(metadata, _changeset.ChangeExecFlag)
327
327
    if metadata.new_exec_flag is None:
328
328
        return None
329
329
    elif metadata.old_exec_flag is None: