~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

Simplify the update_minimal api a little bit, and document the parameters.
Switch from kind => minikind, since we frequently already have that anyway,
and update_minimal is a thin wrapper on changing the dirblocks in memory, not
converting from an Inventory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
524
524
                # remove the old row
525
525
                from_key = old_block[old_entry_index][0]
526
526
                to_key = ((to_block[0],) + from_key[1:3])
 
527
                # We must grab old_entry_details here, because _make_absent
 
528
                # will mark this record as absent and destroy any info we used
 
529
                # to have
527
530
                minikind = old_entry_details[0][0]
528
 
                kind = dirstate.DirState._minikind_to_kind[minikind]
529
531
                state._make_absent(old_block[old_entry_index])
530
532
                rollbacks.append(
531
533
                    lambda:state.update_minimal(from_key,
532
 
                        kind,
533
 
                        num_present_parents=len(old_entry_details) - 1,
 
534
                        minikind,
534
535
                        executable=old_entry_details[0][3],
535
536
                        fingerprint=old_entry_details[0][1],
536
537
                        packed_stat=old_entry_details[0][4],
539
540
                        path_utf8=from_rel.encode('utf8')))
540
541
                # create new row in current block
541
542
                state.update_minimal(to_key,
542
 
                        kind,
543
 
                        num_present_parents=len(old_entry_details) - 1,
 
543
                        minikind,
544
544
                        executable=old_entry_details[0][3],
545
545
                        fingerprint=old_entry_details[0][1],
546
546
                        packed_stat=old_entry_details[0][4],