diff options
-rw-r--r-- | Annex.hs | 2 | ||||
-rw-r--r-- | Command.hs | 6 | ||||
-rw-r--r-- | GitAnnex/Options.hs | 3 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/annex.numcopies_not_overriden_by_--numcopies_option.mdwn | 3 |
5 files changed, 12 insertions, 3 deletions
@@ -92,6 +92,7 @@ data AnnexState = AnnexState , catfilehandles :: M.Map FilePath CatFileHandle , checkattrhandle :: Maybe CheckAttrHandle , forcebackend :: Maybe String + , forcenumcopies :: Maybe Int , limit :: Matcher (FileInfo -> Annex Bool) , uuidmap :: Maybe UUIDMap , preferredcontentmap :: Maybe PreferredContentMap @@ -123,6 +124,7 @@ newState gitrepo = AnnexState , catfilehandles = M.empty , checkattrhandle = Nothing , forcebackend = Nothing + , forcenumcopies = Nothing , limit = Left [] , uuidmap = Nothing , preferredcontentmap = Nothing diff --git a/Command.hs b/Command.hs index 06126103b..8083e0d7c 100644 --- a/Command.hs +++ b/Command.hs @@ -99,7 +99,11 @@ isBareRepo :: Annex Bool isBareRepo = fromRepo Git.repoIsLocalBare numCopies :: FilePath -> Annex (Maybe Int) -numCopies file = readish <$> checkAttr "annex.numcopies" file +numCopies file = do + forced <- Annex.getState Annex.forcenumcopies + case forced of + Just n -> return $ Just n + Nothing -> readish <$> checkAttr "annex.numcopies" file numCopiesCheck :: FilePath -> Key -> (Int -> Int -> Bool) -> Annex Bool numCopiesCheck file key vs = do diff --git a/GitAnnex/Options.hs b/GitAnnex/Options.hs index e74fc0a03..2cfdfafd2 100644 --- a/GitAnnex/Options.hs +++ b/GitAnnex/Options.hs @@ -53,10 +53,9 @@ options = Option.common ++ ] ++ Option.matcher where setnumcopies v = maybe noop - (\n -> Annex.changeGitConfig $ \c -> c { annexNumCopies = n }) + (\n -> Annex.changeState $ \s -> s { Annex.forcenumcopies = Just n }) (readish v) setgitconfig v = Annex.changeGitRepo =<< inRepo (Git.Config.store v) - trustArg t = ReqArg (Remote.forceTrust t) paramRemote keyOptions :: [Option] diff --git a/debian/changelog b/debian/changelog index dec7bed0a..ac5f3dadb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,7 @@ git-annex (4.20130628) UNRELEASED; urgency=low does not correspond to any unused key. * fsck: Don't claim to fix direct mode when run on a symlink whose content is not present. + * Make --numcopies override annex.numcopies set in .gitattributes. -- Joey Hess <joeyh@debian.org> Tue, 02 Jul 2013 15:40:55 -0400 diff --git a/doc/bugs/annex.numcopies_not_overriden_by_--numcopies_option.mdwn b/doc/bugs/annex.numcopies_not_overriden_by_--numcopies_option.mdwn index b4d54dd31..ba63897ba 100644 --- a/doc/bugs/annex.numcopies_not_overriden_by_--numcopies_option.mdwn +++ b/doc/bugs/annex.numcopies_not_overriden_by_--numcopies_option.mdwn @@ -11,3 +11,6 @@ Second line fails if only one other copy exists. ### What version of git-annex are you using? On what operating system? git-annex version: 4.20130627 + +> I don't think this was ever handled correctly. +> I've fixed it now. [[done]] --[[Joey]] |