~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset.py

  • Committer: Robert Collins
  • Date: 2005-09-29 02:01:49 UTC
  • Revision ID: robertc@robertcollins.net-20050929020149-1ff16722c6a01b2c
reenable remotebranch tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import stat
20
20
from bzrlib.trace import mutter
21
21
from bzrlib.osutils import rename
22
 
import bzrlib
23
22
 
24
23
# XXX: mbp: I'm not totally convinced that we should handle conflicts
25
24
# as part of changeset application, rather than only in the merge
358
357
        else:
359
358
            assert(status == 1)
360
359
            def get_lines(filename):
361
 
                my_file = file(filename, "rb")
 
360
                my_file = file(base, "rb")
362
361
                lines = my_file.readlines()
363
362
                my_file.close()
364
 
                return lines
365
363
            base_lines = get_lines(base)
366
364
            other_lines = get_lines(other)
367
365
            conflict_handler.merge_conflict(new_file, filename, base_lines, 
864
862
            continue
865
863
        new_path = os.path.join(dir, new_tree_path)
866
864
        old_path = changed_inventory.get(entry.id)
867
 
        if bzrlib.osutils.lexists(new_path):
 
865
        if os.path.exists(new_path):
868
866
            if conflict_handler.target_exists(entry, new_path, old_path) == \
869
867
                "skip":
870
868
                continue
1385
1383
 
1386
1384
        if cs_entry is None:
1387
1385
            return None
 
1386
        if id in self.tree_a and id in self.tree_b:
 
1387
            a_sha1 = self.tree_a.get_file_sha1(id)
 
1388
            b_sha1 = self.tree_b.get_file_sha1(id)
 
1389
            if None not in (a_sha1, b_sha1) and a_sha1 == b_sha1:
 
1390
                return cs_entry
1388
1391
 
1389
1392
        full_path_a = self.tree_a.readonly_path(id)
1390
1393
        full_path_b = self.tree_b.readonly_path(id)
1391
1394
        stat_a = self.lstat(full_path_a)
1392
1395
        stat_b = self.lstat(full_path_b)
1393
 
 
 
1396
        
1394
1397
        cs_entry.metadata_change = self.make_mode_change(stat_a, stat_b)
1395
 
 
1396
 
        if id in self.tree_a and id in self.tree_b:
1397
 
            a_sha1 = self.tree_a.get_file_sha1(id)
1398
 
            b_sha1 = self.tree_b.get_file_sha1(id)
1399
 
            if None not in (a_sha1, b_sha1) and a_sha1 == b_sha1:
1400
 
                return cs_entry
1401
 
 
1402
1398
        cs_entry.contents_change = self.make_contents_change(full_path_a,
1403
1399
                                                             stat_a, 
1404
1400
                                                             full_path_b,