simulated repository construction working
This commit is contained in:
parent
a2c0d5e4a9
commit
ec7f1f2736
2 changed files with 64 additions and 1 deletions
|
@ -9,6 +9,10 @@ module Command.Sim where
|
|||
|
||||
import Command
|
||||
import Annex.Sim
|
||||
import qualified Annex
|
||||
import Utility.Tmp.Dir
|
||||
|
||||
import System.Random
|
||||
|
||||
cmd :: Command
|
||||
cmd = command "sim" SectionTesting
|
||||
|
@ -16,4 +20,18 @@ cmd = command "sim" SectionTesting
|
|||
paramCommand (withParams seek)
|
||||
|
||||
seek :: CmdParams -> CommandSeek
|
||||
seek = undefined
|
||||
seek _ = do
|
||||
rng <- initStdGen
|
||||
repobyname <- mkGetExistingRepoByName
|
||||
r <- Annex.gitRepo
|
||||
withTmpDir "sim" $ \tmpdir -> do
|
||||
let st = emptySimState rng repobyname
|
||||
st' <- runSimCommand (CommandInit (RepoName "foo")) st
|
||||
>>= runSimCommand (CommandTrustLevel (RepoName "foo") "trusted")
|
||||
>>= runSimCommand (CommandUse (RepoName "bar") "here")
|
||||
let simdir = \u -> tmpdir </> fromUUID u
|
||||
st'' <- liftIO $ updateSimRepos r simdir st'
|
||||
liftIO $ print tmpdir
|
||||
_ <- liftIO $ getLine
|
||||
return ()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue