# # patch "monotone-viz.style.sample" # from [d2229180e722ecf5dc103a266a3e980d95b11b50] # to [2b1aae3306e9d965633540ecb56c73d2276aeec4] # # patch "view.ml" # from [9adb759b137d216ad689d2662438c0cfe20b301f] # to [ede5932de2c0b8af4c78f3694a9bfeb3be9f9261] # # patch "viz_style.ml" # from [72c4f46ab2286a2da56f910a2db3c408bf8b4b47] # to [57da0f658c445e9f543c3f26f66c46e96c2a41bd] # # patch "viz_style.mli" # from [1bbbbfca7c1ba5360b0612375445623a7549a033] # to [0ef255a1d99f080be0f2fceb5b35bb34f9dd7644] # ======================================================================== --- monotone-viz.style.sample d2229180e722ecf5dc103a266a3e980d95b11b50 +++ monotone-viz.style.sample 2b1aae3306e9d965633540ecb56c73d2276aeec4 @@ -1,8 +1,9 @@ (* This file should be named `.monotone-viz.style' . *) font "Monospace" +ignored_certs "gitcommit-id" cert tag "." [ outline_color = "royalblue"; ] ======================================================================== --- view.ml 9adb759b137d216ad689d2662438c0cfe20b301f +++ view.ml ede5932de2c0b8af4c78f3694a9bfeb3be9f9261 @@ -347,14 +347,17 @@ certs = [] ; } + let filter_certs ignored_certs data = + { data with certs = List.filter (fun c -> not (List.mem c.c_name ignored_certs)) data.certs } + let fetch_and_display_data v id = + let data = + try Database.fetch_certs_and_revision (some v.db) id + with Viz_types.Error msg -> + error_notice ~parent:v.info.revision_label msg ; + failed_node_data in display_info v.info - begin - try Database.fetch_certs_and_revision (some v.db) id - with Viz_types.Error msg -> - error_notice ~parent:v.info.revision_label msg ; - failed_node_data - end + (filter_certs v.prefs.Viz_style.ignored_certs data) end @@ -569,6 +572,9 @@ let canvas = GnoCanvas.canvas ~aa ~packing:sw#add () in let selection_rect = GnoCanvas.rect ~fill_color:"tomato" canvas#root in selection_rect#hide () ; + ignore (canvas#event#connect#button_press (fun ev -> + canvas#misc#grab_focus () ; + false)) ; { w = canvas ; ppu = 1. ; branch_items = None ; @@ -1200,6 +1206,7 @@ lr_layout : bool ; monotone_path : string ; dot_path : string ; + ignored_certs : string list ; style : Viz_style.style ; } ======================================================================== --- viz_style.ml 72c4f46ab2286a2da56f910a2db3c408bf8b4b47 +++ viz_style.ml 57da0f658c445e9f543c3f26f66c46e96c2a41bd @@ -32,6 +32,9 @@ let string_of_item = function | `STRING s -> s | _ -> failwith "string_of_item" +let string_list_of_item = function + | `STRING s -> Str.split (Str.regexp ", *") s + | _ -> failwith "string_list_of_item" let autocolor_of_item = function | `STRING "none" | `BOOL false -> NONE @@ -50,6 +53,7 @@ type 'a key = string * (item -> 'a) let bool_key s = (s, bool_of_item) let string_key s = (s, string_of_item) +let string_list_key s = (s, string_list_of_item) let autocolor_key s = (s, autocolor_of_item) let add_pref l (k, v) = @@ -75,6 +79,7 @@ lr_layout : bool ; monotone_path : string ; dot_path : string ; + ignored_certs : string list ; style : style ; } @@ -244,6 +249,7 @@ lr_layout = false ; monotone_path = "monotone" ; dot_path = "dot" ; + ignored_certs = [] ; style = [] ; } @@ -254,6 +260,7 @@ lr_layout = get bool_key "lr_layout" ; monotone_path = get string_key "monotone" ; dot_path = get string_key "dot" ; + ignored_certs = get string_list_key "ignored_certs" ; style = style ; } @@ -263,6 +270,7 @@ "lr_layout", `BOOL p.lr_layout ; "monotone", `STRING p.monotone_path ; "dot", `STRING p.dot_path ; + "ignored_certs", `STRING (String.concat "," p.ignored_certs) ; ], p.style let style_file_name = @@ -277,6 +285,12 @@ let separator = "-*- monotone-viz -*-" +let save_prefs b prefs = + Printf.bprintf b "autocolor %s\n" (string_of_autocolor prefs.autocolor) ; + Printf.bprintf b "lr_layout %B\n" prefs.lr_layout ; + Printf.bprintf b "monotone %S\n" prefs.monotone_path ; + Printf.bprintf b "dot %S\n" prefs.dot_path + let save prefs = let lines = if Sys.file_exists style_file_name @@ -297,9 +311,7 @@ (parse (lex (Stream.of_string (String.concat "\n" keep_lines)))) [] in let b = Buffer.create 4096 in - Printf.bprintf b "autocolor %s\n" (string_of_autocolor prefs.autocolor) ; - Printf.bprintf b "lr_layout %B\n" prefs.lr_layout ; - Printf.bprintf b "monotone %S\n" prefs.monotone_path ; + save_prefs b prefs ; List.iter (function | s when List.mem s keep_styles -> () ======================================================================== --- viz_style.mli 1bbbbfca7c1ba5360b0612375445623a7549a033 +++ viz_style.mli 0ef255a1d99f080be0f2fceb5b35bb34f9dd7644 @@ -9,6 +9,7 @@ lr_layout : bool ; monotone_path : string ; dot_path : string ; + ignored_certs : string list ; style : style ; }