From a86cd4bc8215f01ffe2ba06c63be56656d8ae7cf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Oct 2013 14:08:38 -0400 Subject: The "git annex content" command is renamed to "git annex wanted". --- Command/Content.hs | 48 ---------------------- Command/Wanted.hs | 48 ++++++++++++++++++++++ GitAnnex.hs | 4 +- debian/changelog | 1 + doc/git-annex.mdwn | 6 +-- doc/preferred_content.mdwn | 2 +- doc/tips/flickrannex.mdwn | 4 +- doc/tips/imapannex.mdwn | 2 +- doc/tips/offline_archive_drives.mdwn | 2 +- ...ent_3_7be2ccaf70c9ecfc9a34384e0e31f490._comment | 2 +- 10 files changed, 60 insertions(+), 59 deletions(-) delete mode 100644 Command/Content.hs create mode 100644 Command/Wanted.hs diff --git a/Command/Content.hs b/Command/Content.hs deleted file mode 100644 index d10bdde3c..000000000 --- a/Command/Content.hs +++ /dev/null @@ -1,48 +0,0 @@ -{- git-annex command - - - - Copyright 2013 Joey Hess - - - - Licensed under the GNU GPL version 3 or higher. - -} - -module Command.Content where - -import Common.Annex -import Command -import qualified Remote -import Logs.PreferredContent - -import qualified Data.Map as M - -def :: [Command] -def = [command "content" (paramPair paramRemote (paramOptional paramExpression)) seek - SectionSetup "get or set preferred content expression"] - -seek :: [CommandSeek] -seek = [withWords start] - -start :: [String] -> CommandStart -start = parse - where - parse (name:[]) = go name performGet - parse (name:expr:[]) = go name $ \uuid -> do - showStart "content" name - performSet expr uuid - parse _ = error "Specify a repository." - - go name a = do - u <- Remote.nameToUUID name - next $ a u - -performGet :: UUID -> CommandPerform -performGet uuid = do - m <- preferredContentMapRaw - liftIO $ putStrLn $ fromMaybe "" $ M.lookup uuid m - next $ return True - -performSet :: String -> UUID -> CommandPerform -performSet expr uuid = case checkPreferredContentExpression expr of - Just e -> error $ "Parse error: " ++ e - Nothing -> do - preferredContentSet uuid expr - next $ return True diff --git a/Command/Wanted.hs b/Command/Wanted.hs new file mode 100644 index 000000000..a7b4a3d9e --- /dev/null +++ b/Command/Wanted.hs @@ -0,0 +1,48 @@ +{- git-annex command + - + - Copyright 2013 Joey Hess + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Wanted where + +import Common.Annex +import Command +import qualified Remote +import Logs.PreferredContent + +import qualified Data.Map as M + +def :: [Command] +def = [command "wanted" (paramPair paramRemote (paramOptional paramExpression)) seek + SectionSetup "get or set preferred content expression"] + +seek :: [CommandSeek] +seek = [withWords start] + +start :: [String] -> CommandStart +start = parse + where + parse (name:[]) = go name performGet + parse (name:expr:[]) = go name $ \uuid -> do + showStart "wanted" name + performSet expr uuid + parse _ = error "Specify a repository." + + go name a = do + u <- Remote.nameToUUID name + next $ a u + +performGet :: UUID -> CommandPerform +performGet uuid = do + m <- preferredContentMapRaw + liftIO $ putStrLn $ fromMaybe "" $ M.lookup uuid m + next $ return True + +performSet :: String -> UUID -> CommandPerform +performSet expr uuid = case checkPreferredContentExpression expr of + Just e -> error $ "Parse error: " ++ e + Nothing -> do + preferredContentSet uuid expr + next $ return True diff --git a/GitAnnex.hs b/GitAnnex.hs index 1001d7b5a..b73cd9416 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -54,7 +54,7 @@ import qualified Command.Untrust import qualified Command.Semitrust import qualified Command.Dead import qualified Command.Group -import qualified Command.Content +import qualified Command.Wanted import qualified Command.Schedule import qualified Command.Ungroup import qualified Command.Vicfg @@ -118,7 +118,7 @@ cmds = concat , Command.Semitrust.def , Command.Dead.def , Command.Group.def - , Command.Content.def + , Command.Wanted.def , Command.Schedule.def , Command.Ungroup.def , Command.Vicfg.def diff --git a/debian/changelog b/debian/changelog index bcf55d585..3c7435c9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ git-annex (4.20131025) UNRELEASED; urgency=low + * The "git annex content" command is renamed to "git annex wanted". * assistant: When autostarted, wait 5 seconds before running the startup scan, to avoid contending with the user's desktop login process. * webapp: When setting up a bare shared repository, enable non-fast-forward diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 506c7bb63..693ce57ee 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -398,14 +398,14 @@ subdirectories). Removes a repository from a group. -* `content repository [expression]` +* `wanted repository [expression]` When run with an expression, configures the content that is preferred to be held in the archive. See PREFERRED CONTENT below. For example: - git annex content . "include=*.mp3 or include=*.ogg" + git annex wanted . "include=*.mp3 or include=*.ogg" Without an expression, displays the current preferred content setting of the repository. @@ -973,7 +973,7 @@ file contents are present at either of two repositories. Each repository has a preferred content setting, which specifies content that the repository wants to have present. These settings can be configured -using `git annex vicfg` or `git annex content`. +using `git annex vicfg` or `git annex wanted`. They are used by the `--auto` option, and by the git-annex assistant. The preferred content settings are similar, but not identical to diff --git a/doc/preferred_content.mdwn b/doc/preferred_content.mdwn index 6e71a5276..0f284c4c1 100644 --- a/doc/preferred_content.mdwn +++ b/doc/preferred_content.mdwn @@ -7,7 +7,7 @@ this allows `git annex get --auto`, `git annex drop --auto`, etc to do smarter things. Preferred content settings can be edited using `git -annex vicfg`, or viewed and set at the command line with `git annex content`. +annex vicfg`, or viewed and set at the command line with `git annex wanted`. Each repository can have its own settings, and other repositories may also try to honor those settings. So there's no local `.git/config` setting it. diff --git a/doc/tips/flickrannex.mdwn b/doc/tips/flickrannex.mdwn index 202d5ee53..d8e54b4c3 100644 --- a/doc/tips/flickrannex.mdwn +++ b/doc/tips/flickrannex.mdwn @@ -39,7 +39,7 @@ After the setup has finished, it will print the git-annex configure lines. The photo name on flickr is currently the GPGHMACSHA1 version. Run the following command in your annex directory - git annex content flickr uuid include=*.jpg or include=*.jpeg or include=*.gif or include=*.png + git annex wanted flickr uuid include=*.jpg or include=*.jpeg or include=*.gif or include=*.png ## Encrypted mode The current version base64 encodes all the data, which results in ~35% larger filesize. @@ -47,7 +47,7 @@ The current version base64 encodes all the data, which results in ~35% larger fi I might look into yyenc instead. I'm not sure if it will work in the tEXt field. Run the following command in your annex directory - git annex content flickr exclude=largerthan=30mb + git annex wanted flickr exclude=largerthan=30mb ## Including directories as tags Get get each of the directories below the top level git directory added as tags to uploads: diff --git a/doc/tips/imapannex.mdwn b/doc/tips/imapannex.mdwn index 594687db4..e9963df34 100644 --- a/doc/tips/imapannex.mdwn +++ b/doc/tips/imapannex.mdwn @@ -24,4 +24,4 @@ Run the program once to set it up. git config annex.imap-hook '/usr/bin/python2 ~/imapannex/imapannex.py' git annex initremote imap type=hook hooktype=imap encryption=shared git annex describe imap "the imap library" - git annex content imap exclude=largerthan=30mb + git annex wanted imap exclude=largerthan=30mb diff --git a/doc/tips/offline_archive_drives.mdwn b/doc/tips/offline_archive_drives.mdwn index 606b723b3..eff123e8b 100644 --- a/doc/tips/offline_archive_drives.mdwn +++ b/doc/tips/offline_archive_drives.mdwn @@ -24,7 +24,7 @@ drive). Also, give the drive a description that matches something you write on its label, so you can find it later: git annex group archivedrive archive - git annex content archivedrive standard + git annex wanted archivedrive standard git annex describe archivedrive "my first archive drive (SATA)" Or you can use the assistant to set up the drive for you. diff --git a/doc/tips/offline_archive_drives/comment_3_7be2ccaf70c9ecfc9a34384e0e31f490._comment b/doc/tips/offline_archive_drives/comment_3_7be2ccaf70c9ecfc9a34384e0e31f490._comment index c9eb583a8..cd5888009 100644 --- a/doc/tips/offline_archive_drives/comment_3_7be2ccaf70c9ecfc9a34384e0e31f490._comment +++ b/doc/tips/offline_archive_drives/comment_3_7be2ccaf70c9ecfc9a34384e0e31f490._comment @@ -6,5 +6,5 @@ content=""" The example was missing a preferred content setting, without which --auto doesn't copy anything unless needed to satisfy numcopies: -git annex content archivedrive standard +git annex wanted archivedrive standard """]] -- cgit v1.2.3