Exemplo n.º 1
0
def genlazyancestors(revs, stoprev=0, inclusive=False):
    print("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" %
          (revs, stoprev, inclusive))
    return ancestor.lazyancestors(mockchangelog,
                                  revs,
                                  stoprev=stoprev,
                                  inclusive=inclusive)
Exemplo n.º 2
0
def genlazyancestors(revs, stoprev=0, inclusive=False):
    print("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" %
          (revs, stoprev, inclusive))
    return ancestor.lazyancestors(graph.get,
                                  revs,
                                  stoprev=stoprev,
                                  inclusive=inclusive)
    def streamer():
        """Request format:

        [<filerequest>,...]\0\0
        filerequest = <filename len: 2 byte><filename><count: 4 byte>
                      [<node: 20 byte>,...]

        Response format:
        [<fileresponse>,...]<10 null bytes>
        fileresponse = <filename len: 2 byte><filename><history><deltas>
        history = <count: 4 byte>[<history entry>,...]
        historyentry = <node: 20 byte><p1: 20 byte><p2: 20 byte>
                       <linknode: 20 byte><copyfrom len: 2 byte><copyfrom>
        deltas = <count: 4 byte>[<delta entry>,...]
        deltaentry = <node: 20 byte><deltabase: 20 byte>
                     <delta len: 8 byte><delta>
        """
        try:
            # hg 4.6 and later
            fin = proto._fin
        except AttributeError:
            # hg 4.5 and earlier
            fin = proto.fin
        files = _receivepackrequest(fin)

        # Sort the files by name, so we provide deterministic results
        for filename, nodes in sorted(files.iteritems()):
            fl = repo.file(filename)

            # Compute history
            history = []
            for rev in ancestor.lazyancestors(fl.parentrevs,
                                              [fl.rev(n) for n in nodes],
                                              inclusive=True):
                x, x, x, x, linkrev, p1, p2, node = fl.index[rev]
                copyfrom = ''
                p1node = fl.node(p1)
                p2node = fl.node(p2)
                linknode = repo.changelog.node(linkrev)
                if p1node == nullid:
                    copydata = fl.renamed(node)
                    if copydata:
                        copyfrom, copynode = copydata
                        p1node = copynode

                history.append((node, p1node, p2node, linknode, copyfrom))

            # Scan and send deltas
            chain = _getdeltachain(fl, nodes, -1)

            for chunk in wirepack.sendpackpart(filename, history, chain):
                yield chunk

        yield wirepack.closepart()
        try:
            # hg 4.6 and later
            proto._fout.flush()
        except AttributeError:
            # hg 4.5 and earlier
            proto.fout.flush()
Exemplo n.º 4
0
 def ancestors(self, revs, stoprev=0, inclusive=False):
     revs = list(revs)
     tip = self.rev(self.tip())
     for r in revs:
         if r > tip:
             raise IndexError(b'Invalid rev %r' % r)
     return ancestor.lazyancestors(
         self.parentrevs, revs, stoprev=stoprev, inclusive=inclusive
     )
Exemplo n.º 5
0
def genlazyancestors(revs, stoprev=0, inclusive=False):
    print ("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" % (revs, stoprev, inclusive))
    return ancestor.lazyancestors(mockchangelog, revs, stoprev=stoprev, inclusive=inclusive)
Exemplo n.º 6
0
def genlazyancestors(revs, stoprev=0, inclusive=False):
    print ("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" %
           (revs, stoprev, inclusive))
    return ancestor.lazyancestors(graph.get, revs, stoprev=stoprev,
                                  inclusive=inclusive)