From fe922da8ed7d5f20218f51cc2ff8066a1de65b2a Mon Sep 17 00:00:00 2001 From: Aaron Boodman Date: Sat, 8 Oct 2016 01:03:36 -0700 Subject: [PATCH] photo-index: tag commit with run date (#2687) Would be nice to also tag with pinned path, but that's more work --- samples/go/photo-index/main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/go/photo-index/main.go b/samples/go/photo-index/main.go index 4b975cc03d..2f3c6604fe 100644 --- a/samples/go/photo-index/main.go +++ b/samples/go/photo-index/main.go @@ -9,15 +9,16 @@ import ( "os" "path" "sync" + "time" + "github.com/attic-labs/noms/go/config" "github.com/attic-labs/noms/go/datas" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/go/util/exit" + "github.com/attic-labs/noms/go/util/verbose" "github.com/attic-labs/noms/go/walk" flag "github.com/juju/gnuflag" - "github.com/attic-labs/noms/go/config" - "github.com/attic-labs/noms/go/util/verbose" ) func main() { @@ -150,13 +151,17 @@ func index() (win bool) { }) } - outDS, err = db.CommitValue(outDS, types.NewStruct("", types.StructData{ + outDS, err = db.Commit(outDS, types.NewStruct("", types.StructData{ "byDate": byDate.Build(), "byTag": byTag.Build(), "byFace": byFace.Build(), "tagsByCount": stringsByCount(db, tagCounts), "facesByCount": stringsByCount(db, faceCounts), - })) + }), datas.CommitOptions{ + Meta: types.NewStruct("", types.StructData{ + "date": types.String(time.Now().Format(time.RFC3339)), + }), + }) if err != nil { fmt.Fprintf(os.Stderr, "Could not commit: %s\n", err) return