-- everything here has type String/FilePath
{-# OPTIONS_GHC -Wno-missing-signatures #-}
module Darcs.Repository.Paths where

import Darcs.Prelude
import Darcs.Util.Cache ( HashedDir(..), hashedDir )
import Darcs.Util.Global ( darcsdir )
import System.FilePath.Posix( (</>) )

makeDarcsdirPath :: String -> String
makeDarcsdirPath :: String -> String
makeDarcsdirPath String
name = String
darcsdir String -> String -> String
</> String
name

-- | Location of the lock file.
lockPath :: String
lockPath = String -> String
makeDarcsdirPath String
"lock"

-- | Location of the prefs directory.
prefsDir :: String
prefsDir = String
"prefs"
prefsDirPath :: String
prefsDirPath = String -> String
makeDarcsdirPath String
prefsDir

-- | Location of the (one and only) head inventory.
hashedInventory :: String
hashedInventory = String
"hashed_inventory"
hashedInventoryPath :: String
hashedInventoryPath = String -> String
makeDarcsdirPath String
hashedInventory

-- | Location of the (one and only) tentative head inventory.
tentativeHashedInventory :: String
tentativeHashedInventory = String
"tentative_hashed_inventory"
tentativeHashedInventoryPath :: String
tentativeHashedInventoryPath = String -> String
makeDarcsdirPath String
tentativeHashedInventory

-- | Location of parent inventories.
inventoriesDir :: String
inventoriesDir = HashedDir -> String
hashedDir HashedDir
HashedInventoriesDir
inventoriesDirPath :: String
inventoriesDirPath = String -> String
makeDarcsdirPath String
inventoriesDir

-- | Location of pristine trees.
tentativePristinePath :: String
tentativePristinePath = String -> String
makeDarcsdirPath String
"tentative_pristine"
pristineDir :: String
pristineDir = HashedDir -> String
hashedDir HashedDir
HashedPristineDir
pristineDirPath :: String
pristineDirPath = String -> String
makeDarcsdirPath String
pristineDir

-- | Location of patches.
patchesDir :: String
patchesDir = HashedDir -> String
hashedDir HashedDir
HashedPatchesDir
patchesDirPath :: String
patchesDirPath = String -> String
makeDarcsdirPath String
patchesDir

-- | Location of index files.
indexPath :: String
indexPath = String
darcsdir String -> String -> String
</> String
"index"
indexInvalidPath :: String
indexInvalidPath = String
darcsdir String -> String -> String
</> String
"index_invalid"

-- | Location of the rebase patch
rebasePath :: String
rebasePath = String -> String
makeDarcsdirPath String
"rebase"
tentativeRebasePath :: String
tentativeRebasePath = String -> String
makeDarcsdirPath String
"rebase.tentative"

-- | Location of format file
formatPath :: String
formatPath = String -> String
makeDarcsdirPath String
"format"

-- | Location of pending files
pendingPath :: String
pendingPath = String
patchesDirPath String -> String -> String
</> String
"pending"
tentativePendingPath :: String
tentativePendingPath = String
patchesDirPath String -> String -> String
</> String
"pending.tentative"
newPendingPath :: String
newPendingPath = String
patchesDirPath String -> String -> String
</> String
"pending.new"

-- | Location of unrevert bundle.
unrevertPath :: String
unrevertPath = String
patchesDirPath String -> String -> String
</> String
"unrevert"
tentativeUnrevertPath :: String
tentativeUnrevertPath = String
patchesDirPath String -> String -> String
</> String
"unrevert.tentative"

-- | Location of old style (unhashed) files and directories.
oldPristineDirPath :: String
oldPristineDirPath = String -> String
makeDarcsdirPath String
"pristine"
oldCurrentDirPath :: String
oldCurrentDirPath = String -> String
makeDarcsdirPath String
"current"
oldCheckpointDirPath :: String
oldCheckpointDirPath = String -> String
makeDarcsdirPath String
"checkpoints"
oldInventoryPath :: String
oldInventoryPath = String -> String
makeDarcsdirPath String
"inventory"
oldTentativeInventoryPath :: String
oldTentativeInventoryPath = String -> String
makeDarcsdirPath String
"tentative_inventory"