~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Robert Collins
  • Date: 2008-09-23 02:16:55 UTC
  • mfrom: (3723 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3725.
  • Revision ID: robertc@robertcollins.net-20080923021655-w6fiwcz42r9ju9xs
Adjust for trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1525
1525
    def __iter__(self):
1526
1526
        return iter(self.all_file_ids())
1527
1527
 
1528
 
    def paths2ids(self, specific_files, trees=None, require_versioned=False):
1529
 
        """See Tree.paths2ids"""
1530
 
        to_find = set(specific_files)
1531
 
        result = set()
1532
 
        for (file_id, paths, changed, versioned, parent, name, kind,
1533
 
             executable) in self._transform.iter_changes():
1534
 
            if paths[1] in to_find:
1535
 
                result.add(file_id)
1536
 
                to_find.remove(paths[1])
1537
 
        result.update(self._transform._tree.paths2ids(to_find,
1538
 
                      trees=[], require_versioned=require_versioned))
1539
 
        return result
 
1528
    def has_id(self, file_id):
 
1529
        if file_id in self._transform._r_new_id:
 
1530
            return True
 
1531
        elif file_id in self._transform._removed_id:
 
1532
            return False
 
1533
        else:
 
1534
            return self._transform._tree.has_id(file_id)
1540
1535
 
1541
1536
    def _path2trans_id(self, path):
1542
1537
        segments = splitpath(path)
1567
1562
        children.update(self._by_parent.get(trans_id, []))
1568
1563
        return children
1569
1564
 
 
1565
    def iter_children(self, file_id):
 
1566
        trans_id = self._transform.trans_id_file_id(file_id)
 
1567
        for child_trans_id in self._all_children(trans_id):
 
1568
            yield self._transform.final_file_id(child_trans_id)
 
1569
 
 
1570
    def extras(self):
 
1571
        possible_extras = set(self._transform.trans_id_tree_path(p) for p
 
1572
                              in self._transform._tree.extras())
 
1573
        possible_extras.update(self._transform._new_contents)
 
1574
        possible_extras.update(self._transform._removed_id)
 
1575
        for trans_id in possible_extras:
 
1576
            if self._transform.final_file_id(trans_id) is None:
 
1577
                yield self._final_paths._determine_path(trans_id)
 
1578
 
1570
1579
    def _make_inv_entries(self, ordered_entries, specific_file_ids):
1571
1580
        for trans_id, parent_file_id in ordered_entries:
1572
1581
            file_id = self._transform.final_file_id(trans_id)