/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 bzrlib/tsort.py

  • Committer: Robert Collins
  • Date: 2009-08-26 01:18:13 UTC
  • mto: This revision was merged to the branch mainline in revision 4656.
  • Revision ID: robertc@robertcollins.net-20090826011813-46x8kcuzwz97opoi
Deserialise IncompatibleRepositories errors in the client, generating
nicer feedback when the smart server encounters such a situation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
459
459
            left_subtree_pushed_stack_append(False)
460
460
            pending_parents_stack_append(list(parents))
461
461
            # as we push it, check if it is the first child
462
 
            parent_info = None
463
462
            if parents:
464
463
                # node has parents, assign from the left most parent.
465
 
                try:
466
 
                    parent_info = revnos[parents[0]]
467
 
                except KeyError:
468
 
                    # Left-hand parent is a ghost, consider it not to exist
469
 
                    pass
470
 
            if parent_info is not None:
 
464
                parent_info = revnos[parents[0]]
471
465
                first_child = parent_info[1]
472
466
                parent_info[1] = False
473
467
            else:
501
495
            pending_parents_stack_pop()
502
496
 
503
497
            parents = original_graph[node_name]
504
 
            parent_revno = None
505
498
            if parents:
506
499
                # node has parents, assign from the left most parent.
507
 
                try:
508
 
                    parent_revno = revnos[parents[0]][0]
509
 
                except KeyError:
510
 
                    # left-hand parent is a ghost, treat it as not existing
511
 
                    pass
512
 
            if parent_revno is not None:
 
500
                parent_revno = revnos[parents[0]][0]
513
501
                if not first_child:
514
502
                    # not the first child, make a new branch
515
503
                    base_revno = parent_revno[0]
640
628
        self._left_subtree_pushed_stack.append(False)
641
629
        self._pending_parents_stack.append(list(parents))
642
630
        # as we push it, figure out if this is the first child
643
 
        parent_info = None
 
631
        parents = self._original_graph[node_name]
644
632
        if parents:
645
633
            # node has parents, assign from the left most parent.
646
 
            try:
647
 
                parent_info = self._revnos[parents[0]]
648
 
            except KeyError:
649
 
                # Left-hand parent is a ghost, consider it not to exist
650
 
                pass
651
 
        if parent_info is not None:
 
634
            parent_info = self._revnos[parents[0]]
652
635
            first_child = parent_info[1]
653
636
            parent_info[1] = False
654
637
        else:
672
655
        self._pending_parents_stack.pop()
673
656
 
674
657
        parents = self._original_graph[node_name]
675
 
        parent_revno = None
676
658
        if parents:
677
659
            # node has parents, assign from the left most parent.
678
 
            try:
679
 
                parent_revno = self._revnos[parents[0]][0]
680
 
            except KeyError:
681
 
                # left-hand parent is a ghost, treat it as not existing
682
 
                pass
683
 
        if parent_revno is not None:
 
660
            parent_revno = self._revnos[parents[0]][0]
684
661
            if not first_child:
685
662
                # not the first child, make a new branch
686
663
                base_revno = parent_revno[0]