# # # patch "Makefile" # from [a2dbbaf833566ba9d6ac02937ffd34fdf5372cfb] # to [09914e7271530740f1aa3a427bf03e2bb3821ac5] # # patch "main.ml" # from [8e7e32724f4bd07a10a9c6caee878dfff2b33281] # to [48c8bf9770ef66c773889f553a1f33ec93b1a087] # ============================================================ --- Makefile a2dbbaf833566ba9d6ac02937ffd34fdf5372cfb +++ Makefile 09914e7271530740f1aa3a427bf03e2bb3821ac5 @@ -101,7 +101,7 @@ gnomecanvas_hack.o : CINCDIRS = -ccopt "$(GNOMECANVAS_CFLAGS)" $(EXTLIB)/unzip.% : MLFLAGS += -w y -REVISION_FILE := $(shell test -r MT/revision && echo MT/revision) +REVISION_FILE := $(shell test -r _MTN/revision && echo _MTN/revision) REVISION_ID = $(if $(REVISION_FILE),$(shell cat $(REVISION_FILE))) version.ml : version.ml.in $(REVISION_FILE) sed -e 's/@REVISION@/$(REVISION_ID)/' -e 's/@VERSION@/$(VERSION)/' < $< > $@ ============================================================ --- main.ml 8e7e32724f4bd07a10a9c6caee878dfff2b33281 +++ main.ml 48c8bf9770ef66c773889f553a1f33ec93b1a087 @@ -1,10 +1,10 @@ open Viz_misc -type mt_options = - | MTopt_none - | MTopt_db of string - | MTopt_branch of string * string - | MTopt_full of string * string * string +type mtn_options = + | MTNopt_none + | MTNopt_db of string + | MTNopt_branch of string * string + | MTNopt_full of string * string * string let unquote s = if s.[0] = '"' @@ -15,27 +15,27 @@ (Lexing.from_string (String.sub s 1 (len - 1))) else s -let find_MT_dir () = +let find_MTN_dir () = let rec up = function | "/" -> raise Not_found | p -> let d = Filename.dirname p in - let m = Filename.concat d "MT" in + let m = Filename.concat d "_MTN" in if Sys.file_exists m then m else up d in - if Sys.file_exists "MT" - then "MT" + if Sys.file_exists "_MTN" + then "_MTN" else up (Sys.getcwd ()) -let parse_MT_options () = - let mt_file = - let mt_dir = Lazy.lazy_from_fun find_MT_dir in - fun f -> Filename.concat (Lazy.force mt_dir) f in +let parse_MTN_options () = + let mtn_file = + let mtn_dir = Lazy.lazy_from_fun find_MTN_dir in + fun f -> Filename.concat (Lazy.force mtn_dir) f in match - try with_file_in input_lines (mt_file "options") + try with_file_in input_lines (mtn_file "options") with Not_found | Sys_error _ -> [] with - | [] -> MTopt_none + | [] -> MTNopt_none | lines -> let options = try @@ -47,7 +47,7 @@ lines [] with Failure _ -> [] in match may_assoc "database" options with - | None -> MTopt_none + | None -> MTNopt_none | Some db_raw -> try let db = Glib.Convert.filename_from_utf8 db_raw in @@ -55,32 +55,32 @@ | Some branch when Glib.Utf8.validate branch -> begin try - let revision = with_file_in input_line (mt_file "revision") in - MTopt_full (db, branch, revision) + let revision = with_file_in input_line (mtn_file "revision") in + MTNopt_full (db, branch, revision) with Sys_error _ -> - MTopt_branch (db, branch) + MTNopt_branch (db, branch) end | _ -> - MTopt_db db + MTNopt_db db with Glib.Convert.Error _ -> - MTopt_none + MTNopt_none let parse_options args = match args with | [] -> - parse_MT_options () + parse_MTN_options () | db :: [] | db :: "" :: _ -> - MTopt_db db + MTNopt_db db | db :: branch_raw :: rest -> try let branch = Glib.Convert.locale_to_utf8 branch_raw in match rest with | [] | "" :: _ -> - MTopt_branch (db, branch) + MTNopt_branch (db, branch) | revision :: _ -> - MTopt_full (db, branch, revision) + MTNopt_full (db, branch, revision) with Glib.Convert.Error _ -> - MTopt_db db + MTNopt_db db let print_version () = Printf.printf "monotone-viz %s (base revision: %s)\n" Version.version Version.revision ; @@ -120,7 +120,7 @@ ~icon:(Lazy.force Icon.monotone) () in ignore (w#connect#destroy GMain.quit) ; - let (aa, mt_options) = parse_cli () in + let (aa, mtn_options) = parse_cli () in let prefs = Viz_style.load () in @@ -133,14 +133,14 @@ (fun () -> begin try - match mt_options with - | MTopt_none -> + match mtn_options with + | MTNopt_none -> ctrl#show_open () - | MTopt_db fname -> + | MTNopt_db fname -> ctrl#open_db fname - | MTopt_branch (fname, branch) -> + | MTNopt_branch (fname, branch) -> ctrl#open_db ~branch fname - | MTopt_full (fname, branch, id) -> + | MTNopt_full (fname, branch, id) -> ctrl#open_db ~id ~branch fname with exn -> exn_handler ctrl exn end ;