whitespace fixes
This commit is contained in:
parent
f87a781aa6
commit
0d50a6105b
33 changed files with 97 additions and 100 deletions
|
@ -206,7 +206,7 @@ fixLink key file = do
|
||||||
return True
|
return True
|
||||||
|
|
||||||
{- Checks that the location log reflects the current status of the key,
|
{- Checks that the location log reflects the current status of the key,
|
||||||
in this repository only. -}
|
- in this repository only. -}
|
||||||
verifyLocationLog :: Key -> String -> Annex Bool
|
verifyLocationLog :: Key -> String -> Annex Bool
|
||||||
verifyLocationLog key desc = do
|
verifyLocationLog key desc = do
|
||||||
present <- inAnnex key
|
present <- inAnnex key
|
||||||
|
|
|
@ -39,12 +39,12 @@ perform dest key = do
|
||||||
tmpdest <- fromRepo $ gitAnnexTmpLocation key
|
tmpdest <- fromRepo $ gitAnnexTmpLocation key
|
||||||
liftIO $ createDirectoryIfMissing True (parentDir tmpdest)
|
liftIO $ createDirectoryIfMissing True (parentDir tmpdest)
|
||||||
showAction "copying"
|
showAction "copying"
|
||||||
ok <- liftIO $ copyFileExternal src tmpdest
|
ifM (liftIO $ copyFileExternal src tmpdest)
|
||||||
if ok
|
( do
|
||||||
then do
|
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
removeFile dest
|
removeFile dest
|
||||||
moveFile tmpdest dest
|
moveFile tmpdest dest
|
||||||
thawContent dest
|
thawContent dest
|
||||||
next $ return True
|
next $ return True
|
||||||
else error "copy failed!"
|
, error "copy failed!"
|
||||||
|
)
|
||||||
|
|
|
@ -125,7 +125,7 @@ remoteNamed n constructor = do
|
||||||
return $ r { remoteName = Just n }
|
return $ r { remoteName = Just n }
|
||||||
|
|
||||||
{- Sets the name of a remote based on the git config key, such as
|
{- Sets the name of a remote based on the git config key, such as
|
||||||
"remote.foo.url". -}
|
- "remote.foo.url". -}
|
||||||
remoteNamedFromKey :: String -> IO Repo -> IO Repo
|
remoteNamedFromKey :: String -> IO Repo -> IO Repo
|
||||||
remoteNamedFromKey k = remoteNamed basename
|
remoteNamedFromKey k = remoteNamed basename
|
||||||
where
|
where
|
||||||
|
|
|
@ -11,7 +11,7 @@ import Common
|
||||||
import Git.Types
|
import Git.Types
|
||||||
|
|
||||||
{- Runs an action that causes a git subcommand to emit a Sha, and strips
|
{- Runs an action that causes a git subcommand to emit a Sha, and strips
|
||||||
any trailing newline, returning the sha. -}
|
- any trailing newline, returning the sha. -}
|
||||||
getSha :: String -> IO String -> IO Sha
|
getSha :: String -> IO String -> IO Sha
|
||||||
getSha subcommand a = maybe bad return =<< extractSha <$> a
|
getSha subcommand a = maybe bad return =<< extractSha <$> a
|
||||||
where
|
where
|
||||||
|
|
6
Init.hs
6
Init.hs
|
@ -47,9 +47,9 @@ uninitialize = do
|
||||||
removeVersion
|
removeVersion
|
||||||
|
|
||||||
{- Will automatically initialize if there is already a git-annex
|
{- Will automatically initialize if there is already a git-annex
|
||||||
branch from somewhere. Otherwise, require a manual init
|
- branch from somewhere. Otherwise, require a manual init
|
||||||
to avoid git-annex accidentially being run in git
|
- to avoid git-annex accidentially being run in git
|
||||||
repos that did not intend to use it. -}
|
- repos that did not intend to use it. -}
|
||||||
ensureInitialized :: Annex ()
|
ensureInitialized :: Annex ()
|
||||||
ensureInitialized = getVersion >>= maybe needsinit checkVersion
|
ensureInitialized = getVersion >>= maybe needsinit checkVersion
|
||||||
where
|
where
|
||||||
|
|
|
@ -210,8 +210,8 @@ rsyncRemote o callback params = do
|
||||||
ps = rsyncOptions o ++ defaultParams ++ params
|
ps = rsyncOptions o ++ defaultParams ++ params
|
||||||
|
|
||||||
{- To send a single key is slightly tricky; need to build up a temporary
|
{- To send a single key is slightly tricky; need to build up a temporary
|
||||||
directory structure to pass to rsync so it can create the hash
|
- directory structure to pass to rsync so it can create the hash
|
||||||
directories. -}
|
- directories. -}
|
||||||
rsyncSend :: RsyncOpts -> MeterUpdate -> Key -> FilePath -> Annex Bool
|
rsyncSend :: RsyncOpts -> MeterUpdate -> Key -> FilePath -> Annex Bool
|
||||||
rsyncSend o callback k src = withRsyncScratchDir $ \tmp -> do
|
rsyncSend o callback k src = withRsyncScratchDir $ \tmp -> do
|
||||||
let dest = tmp </> Prelude.head (keyPaths k)
|
let dest = tmp </> Prelude.head (keyPaths k)
|
||||||
|
|
|
@ -35,13 +35,12 @@ canWatch = True
|
||||||
canWatch = False
|
canWatch = False
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* With inotify, discrete events will be received when making multiple changes
|
{- With inotify, discrete events will be received when making multiple changes
|
||||||
* to the same filename. For example, adding it, deleting it, and adding it
|
- to the same filename. For example, adding it, deleting it, and adding it
|
||||||
* again will be three events.
|
- again will be three events.
|
||||||
*
|
-
|
||||||
* OTOH, with kqueue, often only one event is received, indicating the most
|
- OTOH, with kqueue, often only one event is received, indicating the most
|
||||||
* recent state of the file.
|
- recent state of the file. -}
|
||||||
*/
|
|
||||||
eventsCoalesce :: Bool
|
eventsCoalesce :: Bool
|
||||||
#if WITH_INOTIFY
|
#if WITH_INOTIFY
|
||||||
eventsCoalesce = False
|
eventsCoalesce = False
|
||||||
|
@ -53,14 +52,13 @@ eventsCoalesce = undefined
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* With inotify, file closing is tracked to some extent, so an add event
|
{- With inotify, file closing is tracked to some extent, so an add event
|
||||||
* will always be received for a file once its writer closes it, and
|
- will always be received for a file once its writer closes it, and
|
||||||
* (typically) not before. This may mean multiple add events for the same file.
|
- (typically) not before. This may mean multiple add events for the same file.
|
||||||
*
|
-
|
||||||
* OTOH, with kqueue, add events will often be received while a file is
|
- OTOH, with kqueue, add events will often be received while a file is
|
||||||
* still being written to, and then no add event will be received once the
|
- still being written to, and then no add event will be received once the
|
||||||
* writer closes it.
|
- writer closes it. -}
|
||||||
*/
|
|
||||||
closingTracked :: Bool
|
closingTracked :: Bool
|
||||||
#if WITH_INOTIFY
|
#if WITH_INOTIFY
|
||||||
closingTracked = True
|
closingTracked = True
|
||||||
|
@ -72,9 +70,8 @@ closingTracked = undefined
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* With inotify, modifications to existing files can be tracked.
|
{- With inotify, modifications to existing files can be tracked.
|
||||||
* Kqueue does not support this.
|
- Kqueue does not support this. -}
|
||||||
*/
|
|
||||||
modifyTracked :: Bool
|
modifyTracked :: Bool
|
||||||
#if WITH_INOTIFY
|
#if WITH_INOTIFY
|
||||||
modifyTracked = True
|
modifyTracked = True
|
||||||
|
@ -86,11 +83,11 @@ modifyTracked = undefined
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Starts a watcher thread. The runStartup action is passed a scanner action
|
{- Starts a watcher thread. The runStartup action is passed a scanner action
|
||||||
* to run, that will return once the initial directory scan is complete.
|
- to run, that will return once the initial directory scan is complete.
|
||||||
* Once runStartup returns, the watcher thread continues running,
|
- Once runStartup returns, the watcher thread continues running,
|
||||||
* and processing events. Returns a DirWatcherHandle that can be used
|
- and processing events. Returns a DirWatcherHandle that can be used
|
||||||
* to shutdown later. */
|
- to shutdown later. -}
|
||||||
#if WITH_INOTIFY
|
#if WITH_INOTIFY
|
||||||
type DirWatcherHandle = INotify.INotify
|
type DirWatcherHandle = INotify.INotify
|
||||||
watchDir :: FilePath -> Pruner -> WatchHooks -> (IO () -> IO ()) -> IO DirWatcherHandle
|
watchDir :: FilePath -> Pruner -> WatchHooks -> (IO () -> IO ()) -> IO DirWatcherHandle
|
||||||
|
|
|
@ -14,9 +14,9 @@ module Utility.JSONStream (
|
||||||
import Text.JSON
|
import Text.JSON
|
||||||
|
|
||||||
{- Text.JSON does not support building up a larger JSON document piece by
|
{- Text.JSON does not support building up a larger JSON document piece by
|
||||||
piece as a stream. To support streaming, a hack. The JSObject is converted
|
- piece as a stream. To support streaming, a hack. The JSObject is converted
|
||||||
to a string with its final "}" is left off, allowing it to be added to
|
- to a string with its final "}" is left off, allowing it to be added to
|
||||||
later. -}
|
- later. -}
|
||||||
start :: JSON a => [(String, a)] -> String
|
start :: JSON a => [(String, a)] -> String
|
||||||
start l
|
start l
|
||||||
| last s == endchar = init s
|
| last s == endchar = init s
|
||||||
|
|
Loading…
Reference in a new issue