-
Notifications
You must be signed in to change notification settings - Fork 125
/
datas.ml
47 lines (36 loc) · 1.28 KB
/
datas.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(*
Copyright © 2011 MLstate
This file is part of OPA.
OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(*
@author1 Henri Binsztok,
@author2 Gregoire Makridis
**)
type ns =
| Data of DataImpl.t
| Link of Path.t
| Copy of Revision.t option * Path.t
| UnsetData
type t = ns
type io = ns
let empty = UnsetData
let to_string = function
| UnsetData -> "# UNSET #"
| Link p -> Printf.sprintf "# LINK --> %s #" (Path.to_string p)
| Copy (r, p) -> Printf.sprintf "# COPY --> %s, %s #"
(Option.to_string Revision.to_string r) (Path.to_string p)
| Data e -> Printf.sprintf "# DATA %s #" (DataImpl.to_string e)
let get_string = to_string
let version = 1
let index_fun = function
| Data d -> DataImpl.index_fun d
| _ -> StringMap.empty