def _iter_parent_btt(self, branch=None, turn=None, tick=None, *, stoptime=None):
        """Private use. Iterate over (branch, turn, tick), where the branch is
        a descendant of the previous (starting with whatever branch is
        presently active and ending at 'trunk'), and the turn is the
        latest revision in the branch that matters.

        :arg stoptime: This may be a branch, in which case iteration will stop
        instead of proceeding into that branch's parent; or it may be a triple,
        ``(branch, turn, tick)``, in which case iteration will stop instead of
        yielding any time before that. The tick may be ``None``, in which case
        iteration will stop instead of yielding the turn.

        """
        branch = branch or self.branch
        trn = self.turn if turn is None else turn
        tck = self.tick if tick is None else tick
        yield branch, trn, tck
        stopbranches = set()
        if stoptime:
            if type(stoptime) is tuple:
                stopbranch = stoptime[0]
                stopbranches.add(stopbranch)
                stopbranches.update(self._branch_parents[stopbranch])
            else:
                stopbranch = stoptime
                stopbranches = self._branch_parents[stopbranch]
        _branches = self._branches
        while branch in _branches:
            # ``par`` is the parent branch;
            # ``(trn, tck)`` is when ``branch`` forked off from ``par``
            (branch, trn, tck, _, _) = _branches[branch]
            if branch in stopbranches and (
                trn < stoptime[1] or (
                    trn == stoptime[1] and (
                        stoptime[2] is None or tck <= stoptime[2]
                    )
                )
            ):
                return
            yield branch, trn, tck
def _iter_parent_btt ( self , branch = None , turn = None , tick = None , * , stoptime = None ) : branch = branch or self . branch trn = self . turn if turn is None else turn tck = self . tick if tick is None else tick yield branch , trn , tck stopbranches = set ( ) if stoptime : if type ( stoptime ) is tuple : stopbranch = stoptime [ 0 ] stopbranches . add ( stopbranch ) stopbranches . update ( self . _branch_parents [ stopbranch ] ) else : stopbranch = stoptime stopbranches = self . _branch_parents [ stopbranch ] _branches = self . _branches while branch in _branches : ( branch , trn , tck , _ , _ ) = _branches [ branch ] if branch in stopbranches and ( trn < stoptime [ 1 ] or ( trn == stoptime [ 1 ] and ( stoptime [ 2 ] is None or tck <= stoptime [ 2 ] ) ) ) : return yield branch , trn , tck
Private use. Iterate over (branch, turn, tick), where the branch is
        a descendant of the previous (starting with whatever branch is
        presently active and ending at 'trunk'), and the turn is the
        latest revision in the branch that matters.

        :arg stoptime: This may be a branch, in which case iteration will stop
        instead of proceeding into that branch's parent; or it may be a triple,
        ``(branch, turn, tick)``, in which case iteration will stop instead of
        yielding any time before that. The tick may be ``None``, in which case
        iteration will stop instead of yielding the turn.