summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-20 15:56:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-20 15:56:45 -0400
commite8dd341a562e3ef7926f5f51009f4b71bdc4dad9 (patch)
tree7913041d8dce2ed1d96f7b63b24d46e8c10a1d42
parent805340f3304fbc2962ce334f4d887c4cbf28395c (diff)
fsck: Refuse to do anything if more than one of --incremental, --more, and --incremental-schedule are given, since it's not clear which option should win.
-rw-r--r--Command/Fsck.hs8
-rw-r--r--debian/changelog3
2 files changed, 8 insertions, 3 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index d21f2191d..766154a4a 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -67,6 +67,7 @@ seek :: CommandSeek
seek ps = do
from <- getOptionField fsckFromOption Remote.byNameWithUUID
i <- getIncremental
+ liftIO $ print i
withKeyOptions
(\k -> startKey i k =<< getNumCopies)
(withFilesInGit $ whenAnnexed $ start from i)
@@ -80,11 +81,12 @@ getIncremental = do
morei <- Annex.getFlag (optionName moreIncrementalOption)
case (i, starti, morei) of
(False, False, False) -> return NonIncremental
- (False, True, _) -> startIncremental
+ (False, True, False) -> startIncremental
(False ,False, True) -> ContIncremental <$> getStartTime
- (True, _, _) ->
+ (True, False, False) ->
maybe startIncremental (return . ContIncremental . Just)
=<< getStartTime
+ _ -> error "Specify only one of --incremental, --more, or --incremental-schedule"
where
startIncremental = do
recordStartTime
@@ -408,7 +410,7 @@ badContentRemote remote key = do
++ Remote.name remote
data Incremental = StartIncremental | ContIncremental (Maybe EpochTime) | NonIncremental
- deriving (Eq)
+ deriving (Eq, Show)
runFsck :: Incremental -> FilePath -> Key -> Annex Bool -> CommandStart
runFsck inc file key a = ifM (needFsck inc key)
diff --git a/debian/changelog b/debian/changelog
index 04414f753..872786d83 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ git-annex (5.20140211) UNRELEASED; urgency=medium
overridden in .git/config.
* glacier: Do not try to run glacier value create when an existing glacier
remote is enabled.
+ * fsck: Refuse to do anything if more than one of --incremental, --more,
+ and --incremental-schedule are given, since it's not clear which option
+ should win.
* Windows webapp: Can set up box.com, Amazon S3, and rsync.net remotes
* Windows webapp: Can create repos on removable drives.
* Windows: Ensure HOME is set, as needed by bundled cygwin utilities.