From b1dbc1c487f4dfbaf3335ee47175160a6041cbc5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 30 Jan 2018 14:16:14 -0800 Subject: [PATCH 1/3] fix hidden merge conflicts Oh for a CI that runs on merge... License: MIT Signed-off-by: Steven Allen --- core/coreapi/object.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 772f90bf2..e57478349 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -18,8 +18,8 @@ import ( "encoding/xml" "errors" "fmt" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const inputLimit = 2 << 20 @@ -53,7 +53,7 @@ func (api *ObjectAPI) New(ctx context.Context, opts ...caopts.ObjectNewOption) ( n = ft.EmptyDirNode() } - _, err = api.node.DAG.Add(n) + err = api.node.DAG.Add(ctx, n) if err != nil { return nil, err } @@ -120,7 +120,7 @@ func (api *ObjectAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Obj return nil, err } - _, err = api.node.DAG.Add(dagnode) + err = api.node.DAG.Add(ctx, dagnode) if err != nil { return nil, err } @@ -217,7 +217,7 @@ func (api *ObjectAPI) AddLink(ctx context.Context, base coreiface.Path, name str return nil, err } - nnode, err := e.Finalize(api.node.DAG) + nnode, err := e.Finalize(ctx, api.node.DAG) if err != nil { return nil, err } @@ -243,7 +243,7 @@ func (api *ObjectAPI) RmLink(ctx context.Context, base coreiface.Path, link stri return nil, err } - nnode, err := e.Finalize(api.node.DAG) + nnode, err := e.Finalize(ctx, api.node.DAG) if err != nil { return nil, err } @@ -280,7 +280,7 @@ func (api *ObjectAPI) patchData(ctx context.Context, path coreiface.Path, r io.R } pbnd.SetData(data) - _, err = api.node.DAG.Add(pbnd) + err = api.node.DAG.Add(ctx, pbnd) if err != nil { return nil, err } From fbf8f5ddbdadca7c094af0d15e4e90b5c5431d25 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 30 Jan 2018 14:21:24 -0800 Subject: [PATCH 2/3] rename go-ipld-format package name from node to ipld ...to match the recent mass rename in #4610. License: MIT Signed-off-by: Steven Allen --- core/coreapi/object.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/coreapi/object.go b/core/coreapi/object.go index e57478349..6d8356cd2 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -19,7 +19,7 @@ import ( "errors" "fmt" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const inputLimit = 2 << 20 @@ -45,7 +45,7 @@ func (api *ObjectAPI) New(ctx context.Context, opts ...caopts.ObjectNewOption) ( return nil, err } - var n node.Node + var n ipld.Node switch options.Type { case "empty": n = new(dag.ProtoNode) @@ -304,13 +304,13 @@ func deserializeNode(nd *Node, dataFieldEncoding string) (*dag.ProtoNode, error) return nil, fmt.Errorf("Unkown data field encoding") } - dagnode.SetLinks(make([]*node.Link, len(nd.Links))) + dagnode.SetLinks(make([]*ipld.Link, len(nd.Links))) for i, link := range nd.Links { c, err := cid.Decode(link.Hash) if err != nil { return nil, err } - dagnode.Links()[i] = &node.Link{ + dagnode.Links()[i] = &ipld.Link{ Name: link.Name, Size: link.Size, Cid: c, From 9c67eb4cf08e3e98e16c08a31f8d8f3908fff10d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 30 Jan 2018 14:22:39 -0800 Subject: [PATCH 3/3] fix the coreapi/object import grouping (while we're at it) License: MIT Signed-off-by: Steven Allen --- core/coreapi/object.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 6d8356cd2..0a6391168 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -3,21 +3,20 @@ package coreapi import ( "bytes" "context" - "io" - "io/ioutil" - - caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - dagutils "github.com/ipfs/go-ipfs/merkledag/utils" - - coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - dag "github.com/ipfs/go-ipfs/merkledag" - ft "github.com/ipfs/go-ipfs/unixfs" - "encoding/base64" "encoding/json" "encoding/xml" "errors" "fmt" + "io" + "io/ioutil" + + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + dag "github.com/ipfs/go-ipfs/merkledag" + dagutils "github.com/ipfs/go-ipfs/merkledag/utils" + ft "github.com/ipfs/go-ipfs/unixfs" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" )