~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2007-02-08 22:42:45 UTC
  • mto: This revision was merged to the branch mainline in revision 2288.
  • Revision ID: abentley@panoramicfeedback.com-20070208224245-fyktmyk673mcl83t
Use tree transform to emit upcoming change list

Show diffs side-by-side

added added

removed removed

Lines of Context:
1309
1309
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
1310
1310
        try:
1311
1311
            _alter_files(working_tree, target_tree, tt, child_pb, 
1312
 
                         interesting_ids, backups, change_reporter)
 
1312
                         interesting_ids, backups )
1313
1313
        finally:
1314
1314
            child_pb.finished()
1315
1315
        pp.next_phase()
1322
1322
        for conflict in conflicts:
1323
1323
            warning(conflict)
1324
1324
        pp.next_phase()
 
1325
        from bzrlib import delta
 
1326
        change_reporter = delta.ChangeReporter(working_tree.inventory)
 
1327
        delta.report_changes(tt._iter_changes(), change_reporter)
1325
1328
        tt.apply()
1326
1329
        working_tree.set_merge_modified({})
1327
1330
    finally:
1330
1333
    return conflicts
1331
1334
 
1332
1335
 
1333
 
def _alter_files(working_tree, target_tree, tt, pb, interesting_ids, backups,
1334
 
                 report_changes):
 
1336
def _alter_files(working_tree, target_tree, tt, pb, interesting_ids,
 
1337
                 backups):
1335
1338
    from bzrlib import delta
1336
1339
    merge_modified = working_tree.merge_modified()
1337
 
    change_list = list(target_tree._iter_changes(working_tree,
1338
 
        specific_file_ids=interesting_ids, pb=pb))
 
1340
    change_list = target_tree._iter_changes(working_tree,
 
1341
        specific_file_ids=interesting_ids, pb=pb)
1339
1342
    if target_tree.inventory.root is None:
1340
1343
        skip_root = True
1341
1344
    else:
1342
1345
        skip_root = False
1343
1346
    basis_tree = None
1344
 
    if report_changes:
1345
 
        change_reporter = delta.ChangeReporter(working_tree.inventory)
1346
 
        delta.report_changes(change_list, change_reporter)
1347
 
    for id_num, (file_id, path, changed_content, versioned, parent, name, kind,
1348
 
                 executable) in enumerate(change_list):
 
1347
    for id_num, (file_id, path, changed_content, versioned, parent, name,
 
1348
        kind, executable) in enumerate(change_list):
1349
1349
        if skip_root and file_id[0] is not None and parent[0] is None:
1350
1350
            continue
1351
1351
        trans_id = tt.trans_id_file_id(file_id)