/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to processors/generic_processor.py

  • Committer: Brian de Alwis
  • Date: 2009-01-15 05:58:25 UTC
  • mto: (0.64.109 fastimport_trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: bsd@manumitting.com-20090115055825-dnw5da8auf9kr80f
Add support for multiple branches by supporting the 'reset' command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
331
331
        # Update the branches
332
332
        self.note("Updating branch information ...")
333
333
        updater = GenericBranchUpdater(self.repo, self.branch, self.cache_mgr,
334
 
            helpers.invert_dict(self.cache_mgr.heads),
 
334
            helpers.invert_dictset(self.cache_mgr.heads),
335
335
            self.cache_mgr.last_ref, self.tags)
336
336
        branches_updated, branches_lost = updater.update()
337
337
        self._branch_count = len(branches_updated)
544
544
        """Process a ResetCommand."""
545
545
        if cmd.ref.startswith('refs/tags/'):
546
546
            self._set_tag(cmd.ref[len('refs/tags/'):], cmd.from_)
547
 
        else:
548
 
            self.warning("resets are not supported yet"
549
 
                " - ignoring reset of '%s'", cmd.ref)
 
547
            return
 
548
 
 
549
 
 
550
        if cmd.from_ is not None:
 
551
            self.cache_mgr.last_ref = cmd.ref
 
552
            self.cache_mgr.heads.setdefault(cmd.from_, set()).add(cmd.ref)
 
553
            self.cache_mgr.last_ids[cmd.ref] = cmd.from_
 
554
 
 
555
            updater = GenericBranchUpdater(self.repo, self.branch, self.cache_mgr,
 
556
                helpers.invert_dictset(self.cache_mgr.heads),
 
557
                self.cache_mgr.last_ref, self.tags)
 
558
            updater.update()
550
559
 
551
560
    def tag_handler(self, cmd):
552
561
        """Process a TagCommand."""
587
596
        # path -> file-ids - as generated
588
597
        self.file_ids = {}
589
598
 
590
 
        # Head tracking: last ref, last id per ref & map of commit ids to ref
 
599
        # Head tracking: last ref, last id per ref & map of commit ids to ref*s*
591
600
        self.last_ref = None
592
601
        self.last_ids = {}
593
602
        self.heads = {}
648
657
    # Track the heads
649
658
    for parent in parents:
650
659
        try:
651
 
            del cache_mgr.heads[parent]
 
660
            del cache_mgr.heads[parent] # FIXME?
652
661
        except KeyError:
653
662
            # it's ok if the parent isn't there - another
654
663
            # commit may have already removed it
655
664
            pass
656
 
    cache_mgr.heads[cmd.id] = cmd.ref
 
665
    cache_mgr.heads.setdefault(cmd.id, set()).add(cmd.ref)
657
666
    cache_mgr.last_ids[cmd.ref] = cmd.id
658
667
    cache_mgr.last_ref = cmd.ref
659
668
    return parents