/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/changeset.py

  • Committer: Martin Pool
  • Date: 2005-08-05 21:06:19 UTC
  • Revision ID: mbp@sourcefrog.net-20050805210619-87c2a27cdb61fef2
- merge aaron's merge improvements up to 
  aaron.bentley@utoronto.ca-20050805025423-c0434f52aa596d3e

Show diffs side-by-side

added added

removed removed

Lines of Context:
1395
1395
        parent = inventory[dirname]
1396
1396
        return parent.id
1397
1397
 
1398
 
    def get_paths(self, entry, tree):
 
1398
    def get_path(self, entry, tree):
1399
1399
        if entry is None:
1400
1400
            return (None, None)
1401
 
        full_path = tree.readonly_path(entry.id)
1402
1401
        if entry.path == ".":
1403
 
            return ("", full_path)
1404
 
        return (entry.path, full_path)
 
1402
            return ""
 
1403
        return entry.path
1405
1404
 
1406
1405
    def make_basic_entry(self, id, only_interesting):
1407
1406
        entry_a = self.r_inventory_a.get(id)
1408
1407
        entry_b = self.r_inventory_b.get(id)
1409
1408
        if only_interesting and not self.is_interesting(entry_a, entry_b):
1410
 
            return (None, None, None)
 
1409
            return None
1411
1410
        parent = self.get_entry_parent(entry_a, self.inventory_a)
1412
 
        (path, full_path_a) = self.get_paths(entry_a, self.tree_a)
 
1411
        path = self.get_path(entry_a, self.tree_a)
1413
1412
        cs_entry = ChangesetEntry(id, parent, path)
1414
1413
        new_parent = self.get_entry_parent(entry_b, self.inventory_b)
1415
1414
 
1416
1415
 
1417
 
        (new_path, full_path_b) = self.get_paths(entry_b, self.tree_b)
 
1416
        new_path = self.get_path(entry_b, self.tree_b)
1418
1417
 
1419
1418
        cs_entry.new_path = new_path
1420
1419
        cs_entry.new_parent = new_parent
1421
 
        return (cs_entry, full_path_a, full_path_b)
 
1420
        return cs_entry
1422
1421
 
1423
1422
    def is_interesting(self, entry_a, entry_b):
1424
1423
        if entry_a is not None:
1430
1429
        return False
1431
1430
 
1432
1431
    def make_boring_entry(self, id):
1433
 
        (cs_entry, full_path_a, full_path_b) = \
1434
 
            self.make_basic_entry(id, only_interesting=False)
 
1432
        cs_entry = self.make_basic_entry(id, only_interesting=False)
1435
1433
        if cs_entry.is_creation_or_deletion():
1436
1434
            return self.make_entry(id, only_interesting=False)
1437
1435
        else:
1439
1437
        
1440
1438
 
1441
1439
    def make_entry(self, id, only_interesting=True):
1442
 
        (cs_entry, full_path_a, full_path_b) = \
1443
 
            self.make_basic_entry(id, only_interesting)
 
1440
        cs_entry = self.make_basic_entry(id, only_interesting)
1444
1441
 
1445
1442
        if cs_entry is None:
1446
1443
            return None
1447
 
       
 
1444
        if id in self.tree_a and id in self.tree_b:
 
1445
            a_sha1 = self.tree_a.get_file_sha1(id)
 
1446
            b_sha1 = self.tree_b.get_file_sha1(id)
 
1447
            if None not in (a_sha1, b_sha1) and a_sha1 == b_sha1:
 
1448
                return cs_entry
 
1449
 
 
1450
        full_path_a = self.tree_a.readonly_path(id)
 
1451
        full_path_b = self.tree_b.readonly_path(id)
1448
1452
        stat_a = self.lstat(full_path_a)
1449
1453
        stat_b = self.lstat(full_path_b)
1450
1454
        if stat_b is None: