From 7327afddb87d8bd4ffbe6a8a11f8838b31e65a8f Mon Sep 17 00:00:00 2001 From: Michael Pfister Date: Wed, 20 Apr 2016 19:11:16 -0700 Subject: [PATCH] Adds repo version info to repo stat command addresses #2571 License: MIT Signed-off-by: Mike Pfister --- core/commands/repo.go | 2 ++ core/corerepo/stat.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/commands/repo.go b/core/commands/repo.go index ff4615ef7814..21d6c8e7f0a3 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -105,6 +105,7 @@ set of stored objects and print repo statistics. It outputs to stdout: NumObjects int Number of objects in the local repo. RepoPath string The path to the repo being currently used. RepoSize int Size in bytes that the repo is currently taking. +Version string The repo version `, }, Run: func(req cmds.Request, res cmds.Response) { @@ -147,6 +148,7 @@ RepoSize int Size in bytes that the repo is currently taking. fmt.Fprintf(buf, "RepoSize \t %d\n", stat.RepoSize) } fmt.Fprintf(buf, "RepoPath \t %s\n", stat.RepoPath) + fmt.Fprintf(buf, "Version \t %s\n", stat.Version) return buf, nil }, diff --git a/core/corerepo/stat.go b/core/corerepo/stat.go index 65abf2efd42f..77dcaf6862ee 100644 --- a/core/corerepo/stat.go +++ b/core/corerepo/stat.go @@ -10,6 +10,7 @@ type Stat struct { NumObjects uint64 RepoSize uint64 // size in bytes RepoPath string + Version string } func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) { @@ -39,5 +40,6 @@ func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) { NumObjects: count, RepoSize: usage, RepoPath: path, + Version: "fs-repo@" + fsrepo.RepoVersion, }, nil }