~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-10 23:39:45 UTC
  • mfrom: (3254.1.4 public-iter-changes)
  • Revision ID: pqm@pqm.ubuntu.com-20080310233945-ed3k1rc4g1p9qcpj
Make Tree.iter_changes a public method (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1002
1002
            to_executable = False
1003
1003
        return to_name, to_parent, to_kind, to_executable
1004
1004
 
1005
 
    def _iter_changes(self):
1006
 
        """Produce output in the same format as Tree._iter_changes.
 
1005
    def iter_changes(self):
 
1006
        """Produce output in the same format as Tree.iter_changes.
1007
1007
 
1008
1008
        Will produce nonsensical results if invoked while inventory/filesystem
1009
1009
        conflicts (as reported by TreeTransform.find_conflicts()) are present.
1372
1372
    def unlock(self):
1373
1373
        pass
1374
1374
 
1375
 
    def _iter_changes(self, from_tree, include_unchanged=False,
 
1375
    def iter_changes(self, from_tree, include_unchanged=False,
1376
1376
                      specific_files=None, pb=None, extra_trees=None,
1377
1377
                      require_versioned=True, want_unversioned=False):
1378
 
        """See InterTree._iter_changes.
 
1378
        """See InterTree.iter_changes.
1379
1379
 
1380
1380
        This implementation does not support include_unchanged, specific_files,
1381
1381
        or want_unversioned.  extra_trees, require_versioned, and pb are
1389
1389
            raise ValueError('specific_files is not supported')
1390
1390
        if want_unversioned:
1391
1391
            raise ValueError('want_unversioned is not supported')
1392
 
        return self._transform._iter_changes()
 
1392
        return self._transform.iter_changes()
1393
1393
 
1394
1394
    def kind(self, file_id):
1395
1395
        trans_id = self._transform.trans_id_file_id(file_id)
1608
1608
    if accelerator_tree is None:
1609
1609
        new_desired_files = desired_files
1610
1610
    else:
1611
 
        iter = accelerator_tree._iter_changes(tree, include_unchanged=True)
 
1611
        iter = accelerator_tree.iter_changes(tree, include_unchanged=True)
1612
1612
        unchanged = dict((f, p[1]) for (f, p, c, v, d, n, k, e)
1613
1613
                         in iter if not (c or e[0] != e[1]))
1614
1614
        new_desired_files = []
1856
1856
        if change_reporter:
1857
1857
            change_reporter = delta._ChangeReporter(
1858
1858
                unversioned_filter=working_tree.is_ignored)
1859
 
            delta.report_changes(tt._iter_changes(), change_reporter)
 
1859
            delta.report_changes(tt.iter_changes(), change_reporter)
1860
1860
        for conflict in conflicts:
1861
1861
            warning(conflict)
1862
1862
        pp.next_phase()
1872
1872
def _alter_files(working_tree, target_tree, tt, pb, specific_files,
1873
1873
                 backups):
1874
1874
    merge_modified = working_tree.merge_modified()
1875
 
    change_list = target_tree._iter_changes(working_tree,
 
1875
    change_list = target_tree.iter_changes(working_tree,
1876
1876
        specific_files=specific_files, pb=pb)
1877
1877
    if target_tree.inventory.root is None:
1878
1878
        skip_root = True