1module Darcs.Repository.Flags
2    (
3      Compression (..)
4    , RemoteDarcs (..)
5    , remoteDarcs
6    , Reorder (..)
7    , Verbosity (..)
8    , UpdatePending (..)
9    , UseCache (..)
10    , DryRun (..)
11    , UMask (..)
12    , LookForAdds (..)
13    , LookForReplaces (..)
14    , DiffAlgorithm (..)
15    , LookForMoves (..)
16    , RunTest (..)
17    , SetScriptsExecutable (..)
18    , LeaveTestDir (..)
19    , RemoteRepos (..)
20    , SetDefault (..)
21    , InheritDefault (..)
22    , UseIndex (..)
23    , ScanKnown (..)
24    , CloneKind (..)
25    , AllowConflicts (..)
26    , ExternalMerge (..)
27    , WorkRepo (..)
28    , WantGuiPause (..)
29    , WithPatchIndex (..)
30    , WithWorkingDir (..)
31    , ForgetParent (..)
32    , PatchFormat (..)
33    , IncludeBoring (..)
34    , HooksConfig (..)
35    , HookConfig (..)
36    ) where
37
38import Darcs.Prelude
39
40import Darcs.Util.Diff ( DiffAlgorithm(..) )
41import Darcs.Util.Global ( defaultRemoteDarcsCmd )
42
43
44data Verbosity = Quiet | NormalVerbosity | Verbose
45    deriving ( Eq, Show )
46
47data Compression = NoCompression
48                 | GzipCompression
49    deriving ( Eq, Show )
50
51data WithPatchIndex = YesPatchIndex | NoPatchIndex
52    deriving ( Eq, Show )
53
54data RemoteDarcs = RemoteDarcs String
55                 | DefaultRemoteDarcs
56    deriving ( Eq, Show )
57
58remoteDarcs :: RemoteDarcs -> String
59remoteDarcs DefaultRemoteDarcs = defaultRemoteDarcsCmd
60remoteDarcs (RemoteDarcs x) = x
61
62data Reorder = NoReorder | Reorder
63    deriving ( Eq )
64
65data UpdatePending = YesUpdatePending | NoUpdatePending
66    deriving ( Eq, Show )
67
68data UseCache = YesUseCache | NoUseCache
69    deriving ( Eq, Show )
70
71data DryRun = YesDryRun | NoDryRun
72    deriving ( Eq, Show )
73
74data UMask = YesUMask String | NoUMask
75    deriving ( Eq, Show )
76
77data LookForAdds = YesLookForAdds | NoLookForAdds
78    deriving ( Eq, Show )
79
80data LookForReplaces = YesLookForReplaces | NoLookForReplaces
81    deriving ( Eq, Show )
82
83data LookForMoves = YesLookForMoves | NoLookForMoves
84    deriving ( Eq, Show )
85
86data IncludeBoring = YesIncludeBoring | NoIncludeBoring
87    deriving ( Eq, Show )
88
89data RunTest = YesRunTest | NoRunTest
90    deriving ( Eq, Show )
91
92data SetScriptsExecutable = YesSetScriptsExecutable | NoSetScriptsExecutable
93    deriving ( Eq, Show )
94
95data LeaveTestDir = YesLeaveTestDir | NoLeaveTestDir
96    deriving ( Eq, Show )
97
98data RemoteRepos = RemoteRepos [String]
99    deriving ( Eq, Show )
100
101data SetDefault = YesSetDefault Bool | NoSetDefault Bool
102    deriving ( Eq, Show )
103
104data InheritDefault = YesInheritDefault | NoInheritDefault
105    deriving ( Eq, Show )
106
107data UseIndex = UseIndex | IgnoreIndex deriving ( Eq, Show )
108
109data ScanKnown = ScanKnown -- ^Just files already known to darcs
110               | ScanAll -- ^All files, i.e. look for new ones
111               | ScanBoring -- ^All files, even boring ones
112    deriving ( Eq, Show )
113
114-- Various kinds of getting repositories
115data CloneKind = LazyClone       -- ^Just copy pristine and inventories
116               | NormalClone     -- ^First do a lazy clone then copy everything
117               | CompleteClone   -- ^Same as Normal but omit telling user they can interrumpt
118    deriving ( Eq, Show )
119
120data AllowConflicts = NoAllowConflicts | YesAllowConflicts | YesAllowConflictsAndMark
121    deriving ( Eq, Show )
122
123data ExternalMerge = YesExternalMerge String | NoExternalMerge
124    deriving ( Eq, Show )
125
126data WorkRepo = WorkRepoDir String | WorkRepoPossibleURL String | WorkRepoCurrentDir
127    deriving ( Eq, Show )
128
129data WantGuiPause = YesWantGuiPause | NoWantGuiPause
130    deriving ( Eq, Show )
131
132data WithWorkingDir = WithWorkingDir | NoWorkingDir
133    deriving ( Eq, Show )
134
135data ForgetParent = YesForgetParent | NoForgetParent
136    deriving ( Eq, Show )
137
138data PatchFormat = PatchFormat1 | PatchFormat2 | PatchFormat3
139    deriving ( Eq, Show )
140
141data HooksConfig = HooksConfig
142  { pre :: HookConfig
143  , post :: HookConfig
144  }
145
146data HookConfig = HookConfig
147  { cmd :: Maybe String
148  , prompt :: Bool
149  }
150