summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-07-30 12:29:59 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-07-30 12:29:59 -0400
commitcc1b371f56877acdccb6deaa7841489f4cc8a397 (patch)
treea13a506770dd1f1623d2a2ddab74e6390cab823a
parentb8e9197d4a394b510a483efab7337811ce18b847 (diff)
info: When run on a file now includes an indication of whether the content is present locally.
-rw-r--r--CHANGELOG2
-rw-r--r--Command/Info.hs5
-rw-r--r--doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn2
3 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bccf70fa1..8ee86b2dd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,8 @@ git-annex (6.20160726) UNRELEASED; urgency=medium
* When built with uuid-1.3.12, generate more random UUIDs than before.
(However, this did not impact git-annex much, so a hard depedency has
not been added on uuid-1.3.12.)
+ * info: When run on a file now includes an indication of whether
+ the content is present locally.
-- Joey Hess <id@joeyh.name> Wed, 20 Jul 2016 12:03:15 -0400
diff --git a/Command/Info.hs b/Command/Info.hs
index bdc8afc34..39511e6d4 100644
--- a/Command/Info.hs
+++ b/Command/Info.hs
@@ -30,6 +30,7 @@ import Logs.Location
import Annex.NumCopies
import Remote
import Config
+import Git.Config (boolConfig)
import Utility.Percentage
import Logs.Transfer
import Types.TrustLevel
@@ -220,6 +221,7 @@ file_stats f k =
[ file_name f
, key_size k
, key_name k
+ , content_present k
]
remote_fast_stats :: Remote -> [Stat]
@@ -354,6 +356,9 @@ key_size k = simpleStat "size" $ showSizeKeys $ foldKeys [k]
key_name :: Key -> Stat
key_name k = simpleStat "key" $ pure $ key2file k
+content_present :: Key -> Stat
+content_present k = stat "present" $ json boolConfig $ lift $ inAnnex k
+
bloom_info :: Stat
bloom_info = simpleStat "bloom filter size" $ do
localkeys <- countKeys <$> cachedPresentData
diff --git a/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
index 590595b0f..5e0598816 100644
--- a/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
+++ b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
@@ -2,3 +2,5 @@ ATM in DataLad we rely on 'git annex find' to determine either files have conten
[[!meta author=yoh]]
+
+> sure, [[done]] --[[Joey]]