~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/read_changeset.py

  • Committer: Aaron Bentley
  • Date: 2006-05-19 16:21:20 UTC
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: abentley@panoramicfeedback.com-20060519162120-7ed2a30c88ea2c83
Regularized extra_info a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
549
549
            cset_tree.note_last_changed(file_id, changed_revision_id)
550
550
            return changed_revision_id
551
551
 
552
 
        def extra_info(info, file_id):
 
552
        def extra_info(info, file_id, new_path):
553
553
            last_changed = None
554
554
            for info_item in info:
555
 
                if info_item.startswith('last-changed:'):
 
555
                name, value = info_item.split(':', 1)
 
556
                if name == 'last-changed':
556
557
                    last_changed = info_item
557
 
                if info_item.startswith('executable:'):
558
 
                    val = info_item[len('executable:'):] == 'yes'
 
558
                elif name == 'executable':
 
559
                    assert value in ('yes', 'no'), value
 
560
                    val = (value == 'yes')
559
561
                    cset_tree.note_executable(file_id, val)
 
562
                elif name == 'target':
 
563
                    cset_tree.note_target(new_path, value)
560
564
            return last_changed
561
565
 
562
566
        def renamed(kind, extra, lines):
604
608
            file_id = info[1][8:]
605
609
 
606
610
            cset_tree.note_id(file_id, path, kind)
607
 
            last_changed = extra_info(info[2:], file_id)
 
611
            last_changed = extra_info(info[2:], file_id, path)
608
612
            revision = get_rev_id(last_changed, file_id, kind)
609
613
            if kind == 'directory':
610
614
                return
618
622
            path = info[0]
619
623
 
620
624
            file_id = cset_tree.path2id(path)
621
 
            last_modified = extra_info(info[1:], file_id)
 
625
            last_modified = extra_info(info[1:], file_id, path)
622
626
            revision = get_rev_id(last_modified, file_id, kind)
623
627
            if lines:
624
628
                cset_tree.note_patch(path, ''.join(lines))