コード例 #1
0
ファイル: remotefilelog.py プロジェクト: pombredanne/hg
 def emitrevisions(self,
                   nodes,
                   nodesorder=None,
                   revisiondata=False,
                   assumehaveparentrevisions=False,
                   deltaprevious=False,
                   deltamode=None):
     # we don't use any of these parameters here
     del nodesorder, revisiondata, assumehaveparentrevisions, deltaprevious
     del deltamode
     prevnode = None
     for node in nodes:
         p1, p2 = self.parents(node)
         if prevnode is None:
             basenode = prevnode = p1
         if basenode == node:
             basenode = nullid
         if basenode != nullid:
             revision = None
             delta = self.revdiff(basenode, node)
         else:
             revision = self.revision(node, raw=True)
             delta = None
         yield revlog.revlogrevisiondelta(
             node=node,
             p1node=p1,
             p2node=p2,
             linknode=self.linknode(node),
             basenode=basenode,
             flags=self.flags(node),
             baserevisionsize=None,
             revision=revision,
             delta=delta,
         )
コード例 #2
0
 def emitrevisions(
     self,
     nodes,
     nodesorder=None,
     revisiondata=False,
     assumehaveparentrevisions=False,
     deltaprevious=False,
     deltamode=None,
     sidedata_helpers=None,
 ):
     # we don't use any of these parameters here
     del nodesorder, revisiondata, assumehaveparentrevisions, deltaprevious
     del deltamode
     prevnode = None
     for node in nodes:
         p1, p2 = self.parents(node)
         if prevnode is None:
             basenode = prevnode = p1
         if basenode == node:
             basenode = self.repo.nullid
         if basenode != self.repo.nullid:
             revision = None
             delta = self.revdiff(basenode, node)
         else:
             revision = self.rawdata(node)
             delta = None
         yield revlog.revlogrevisiondelta(
             node=node,
             p1node=p1,
             p2node=p2,
             linknode=self.linknode(node),
             basenode=basenode,
             flags=self.flags(node),
             baserevisionsize=None,
             revision=revision,
             delta=delta,
             # Sidedata is not supported yet
             sidedata=None,
             # Protocol flags are not used yet
             protocol_flags=0,
         )
コード例 #3
0
def main():
    ui = uimod.ui()
    # Needed so we can open a local repo with obsstore without a warning.
    ui.setconfig(b'experimental', b'evolution.createmarkers', True)

    checkzobject(badpeer())

    ziverify.verifyClass(repository.ipeerbase, httppeer.httppeer)
    checkzobject(httppeer.httppeer(None, None, None, dummyopener(), None,
                                   None))

    ziverify.verifyClass(repository.ipeerv2, httppeer.httpv2peer)
    checkzobject(httppeer.httpv2peer(None, b'', b'', None, None, None))

    ziverify.verifyClass(repository.ipeerbase, localrepo.localpeer)
    checkzobject(localrepo.localpeer(dummyrepo()))

    ziverify.verifyClass(repository.ipeercommandexecutor,
                         localrepo.localcommandexecutor)
    checkzobject(localrepo.localcommandexecutor(None))

    ziverify.verifyClass(repository.ipeercommandexecutor,
                         wireprotov1peer.peerexecutor)
    checkzobject(wireprotov1peer.peerexecutor(None))

    ziverify.verifyClass(repository.ipeerbase, sshpeer.sshv1peer)
    checkzobject(
        sshpeer.sshv1peer(ui, b'ssh://localhost/foo', b'', dummypipe(),
                          dummypipe(), None, None))

    ziverify.verifyClass(repository.ipeerbase, sshpeer.sshv2peer)
    checkzobject(
        sshpeer.sshv2peer(ui, b'ssh://localhost/foo', b'', dummypipe(),
                          dummypipe(), None, None))

    ziverify.verifyClass(repository.ipeerbase, bundlerepo.bundlepeer)
    checkzobject(bundlerepo.bundlepeer(dummyrepo()))

    ziverify.verifyClass(repository.ipeerbase, statichttprepo.statichttppeer)
    checkzobject(statichttprepo.statichttppeer(dummyrepo()))

    ziverify.verifyClass(repository.ipeerbase, unionrepo.unionpeer)
    checkzobject(unionrepo.unionpeer(dummyrepo()))

    ziverify.verifyClass(repository.ilocalrepositorymain,
                         localrepo.localrepository)
    ziverify.verifyClass(repository.ilocalrepositoryfilestorage,
                         localrepo.revlogfilestorage)
    repo = localrepo.makelocalrepository(ui, rootdir)
    checkzobject(repo)

    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
                         wireprotoserver.sshv1protocolhandler)
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
                         wireprotoserver.sshv2protocolhandler)
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
                         wireprotoserver.httpv1protocolhandler)
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
                         wireprotov2server.httpv2protocolhandler)

    sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None)
    checkzobject(sshv1)
    sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None)
    checkzobject(sshv2)

    httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None)
    checkzobject(httpv1)
    httpv2 = wireprotov2server.httpv2protocolhandler(None, None)
    checkzobject(httpv2)

    ziverify.verifyClass(repository.ifilestorage, filelog.filelog)
    ziverify.verifyClass(repository.imanifestdict, manifest.manifestdict)
    ziverify.verifyClass(repository.imanifestrevisionstored,
                         manifest.manifestctx)
    ziverify.verifyClass(repository.imanifestrevisionwritable,
                         manifest.memmanifestctx)
    ziverify.verifyClass(repository.imanifestrevisionstored,
                         manifest.treemanifestctx)
    ziverify.verifyClass(repository.imanifestrevisionwritable,
                         manifest.memtreemanifestctx)
    ziverify.verifyClass(repository.imanifestlog, manifest.manifestlog)
    ziverify.verifyClass(repository.imanifeststorage, manifest.manifestrevlog)

    vfs = vfsmod.vfs(b'.')
    fl = filelog.filelog(vfs, b'dummy.i')
    checkzobject(fl, allowextra=True)

    # Conforms to imanifestlog.
    ml = manifest.manifestlog(vfs, repo, manifest.manifestrevlog(repo.svfs))
    checkzobject(ml)
    checkzobject(repo.manifestlog)

    # Conforms to imanifestrevision.
    mctx = ml[repo[0].manifestnode()]
    checkzobject(mctx)

    # Conforms to imanifestrevisionwritable.
    checkzobject(mctx.new())
    checkzobject(mctx.copy())

    # Conforms to imanifestdict.
    checkzobject(mctx.read())

    mrl = manifest.manifestrevlog(vfs)
    checkzobject(mrl)

    ziverify.verifyClass(repository.irevisiondelta, revlog.revlogrevisiondelta)

    rd = revlog.revlogrevisiondelta(node=b'',
                                    p1node=b'',
                                    p2node=b'',
                                    basenode=b'',
                                    linknode=b'',
                                    flags=b'',
                                    baserevisionsize=None,
                                    revision=b'',
                                    delta=None)
    checkzobject(rd)

    ziverify.verifyClass(repository.iverifyproblem, revlog.revlogproblem)
    checkzobject(revlog.revlogproblem())