Make --numcopies override annex.numcopies set in .gitattributes.
This commit is contained in:
parent
deaf471eb7
commit
b3db88252c
5 changed files with 12 additions and 3 deletions
2
Annex.hs
2
Annex.hs
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -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]]
|
||||
|
|
Loading…
Reference in a new issue