~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset.py

  • Committer: Aaron Bentley
  • Date: 2005-10-04 04:32:32 UTC
  • mfrom: (1185.12.6)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051004043231-40302a149769263b
merged my own changes

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