terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

render conflicted commits with × glyph in graph renderer

Query conflict() from jj template and thread it through jj_commit -> node.
Conflicted nodes display bold red × instead of ○, matching jj's native format.

+80 -53
+6 -15
jj_tui/bin/graph_view.ml
··· 56 56 let open Notty in 57 57 let open Render_jj_graph in 58 58 let content_lines = render_content node_row.node in 59 - 60 59 let available_rows = node_row :: continuation_rows in 61 60 let result = ref [] in 62 61 (* Distribute content lines across available rows *) ··· 73 72 (* If content needs more lines than available, add synthetic continuation rows *) 74 73 if List.length content_lines > List.length available_rows 75 74 then ( 76 - let node_glyphs = [ "○"; "@"; "◌"; "◆" ] in 75 + let node_glyphs = [ "○"; "@"; "◌"; "◆"; "×" ] in 77 76 let synthetic_graph = 78 77 let chars = node_row.graph_chars in 79 78 let replaced = ref chars in ··· 158 157 | `Branch -> 159 158 "branch" 160 159 in 161 - let base = 162 - Printf.sprintf "Preview: dest=%s source=%s" mode_str source_str 163 - in 164 - let label = 165 - match invalid with 166 - | None -> 167 - base 168 - | Some msg -> 169 - base ^ " - " ^ msg 170 - in 160 + let base = Printf.sprintf "Preview: dest=%s source=%s" mode_str source_str in 161 + let label = match invalid with None -> base | Some msg -> base ^ " - " ^ msg in 171 162 W.string label) 172 163 in 173 164 let items = ··· 223 214 Render_jj_graph.render_nodes_structured 224 215 state 225 216 nodes 226 - ~node_attr:(Commit_render.graph_node_attr) 217 + ~node_attr:Commit_render.graph_node_attr 227 218 in 228 219 error_var $= None; 229 220 rendered_rows, rev_ids ··· 323 314 Vars.ui_state.trigger_update $= ())) 324 315 else ( 325 316 (*If the files are focused we shouldn't send this*) 326 - if Focus.peek_has_focus focus 327 - then Show_view.(push_status (Graph_preview (Vars.get_hovered_rev ()))); 317 + (if Focus.peek_has_focus focus 318 + then Show_view.(push_status (Graph_preview (Vars.get_hovered_rev ())))); 328 319 [%log debug "Hovered revision: '%s'" (Global_vars.get_unique_id hovered)]; 329 320 Global_funcs.update_views_async ()))) 330 321 ~custom_handler:(fun ~selected ~selectable_items key -> handleKeys key)
+2
jj_tui/lib/commit_render.ml
··· 22 22 then fg lightblack 23 23 else if node.working_copy 24 24 then fg green ++ st bold 25 + else if node.conflict 26 + then fg red ++ st bold 25 27 else if node.immutable 26 28 then fg cyan 27 29 else fg white
+7 -7
jj_tui/lib/commit_render_tests.ml
··· 13 13 Notty.Render.to_buffer buf Notty.Cap.dumb (0, 0) (w, h) img; 14 14 Buffer.contents buf 15 15 ;; 16 - let render_and_print node= 17 - render_commit_content node 18 - |>List.iter (fun img->print_endline (image_to_string img)); 19 16 17 + let render_and_print node = 18 + render_commit_content node |> List.iter (fun img -> print_endline (image_to_string img)) 20 19 ;; 21 20 22 21 (** Create a test node with specified prefix/rest values *) ··· 50 49 ; empty 51 50 ; hidden = false 52 51 ; divergent = false 52 + ; conflict = false 53 53 ; is_preview 54 54 ; change_id_prefix 55 55 ; change_id_rest ··· 107 107 () 108 108 in 109 109 let img = render_commit_content node in 110 - img|>List.iter (fun img->print_endline (image_to_string img)); 110 + img |> List.iter (fun img -> print_endline (image_to_string img)); 111 111 [%expect 112 112 {| 113 113 xyz123 test@example.com 2024-01-01 aaabbb ··· 144 144 ~description:"Short IDs" 145 145 () 146 146 in 147 - render_and_print node; 147 + render_and_print node; 148 148 [%expect 149 149 {| 150 150 short test@example.com 2024-01-01 min ··· 162 162 ~description:"First line\nSecond line\nThird line" 163 163 () 164 164 in 165 - render_and_print node; 165 + render_and_print node; 166 166 [%expect 167 167 {| 168 168 multiline test@example.com 2024-01-01 abcdef ··· 180 180 ~description:"" 181 181 () 182 182 in 183 - render_and_print node; 183 + render_and_print node; 184 184 [%expect 185 185 {| 186 186 nodesc test@example.com 2024-01-01 111222
+3
jj_tui/lib/jj_json.ml
··· 26 26 ; wip : bool 27 27 ; hidden : bool 28 28 ; divergent : bool 29 + ; conflict : bool 29 30 ; empty : bool 30 31 ; bookmarks : string list 31 32 ; author : jj_author ··· 48 49 ++ ',"wip":' ++ json(description.first_line().starts_with("wip:")) 49 50 ++ ',"hidden":' ++ json(hidden) 50 51 ++ ',"divergent":' ++ json(divergent) 52 + ++ ',"conflict":' ++ json(conflict) 51 53 ++ ',"empty":' ++ json(empty) 52 54 ++ ',"bookmarks":[' 53 55 ++ bookmarks ··· 142 144 ; empty = jj_commit.empty 143 145 ; hidden = jj_commit.hidden 144 146 ; divergent = jj_commit.divergent 147 + ; conflict = jj_commit.conflict 145 148 ; is_preview = false 146 149 ; change_id_prefix = jj_commit.change_id_prefix 147 150 ; change_id_rest = jj_commit.change_id_rest
+19 -19
jj_tui/lib/jj_json_tests.ml
··· 2 2 3 3 let%expect_test "parse_valid_jsonl" = 4 4 let input = 5 - {|{"commit_id":"abc123","parents":[],"change_id":"xyz","description":"First commit","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"abc","commit_id_rest":"123"} 6 - {"commit_id":"def456","parents":["abc123"],"change_id":"uvw","description":"Second commit","working_copy":true,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":["main"],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"uv","change_id_rest":"w","commit_id_prefix":"def","commit_id_rest":"456"}|} 5 + {|{"commit_id":"abc123","parents":[],"change_id":"xyz","description":"First commit","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"abc","commit_id_rest":"123"} 6 + {"commit_id":"def456","parents":["abc123"],"change_id":"uvw","description":"Second commit","working_copy":true,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":["main"],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"uv","change_id_rest":"w","commit_id_prefix":"def","commit_id_rest":"456"}|} 7 7 in 8 8 (match parse_jj_log_output input with 9 9 | Ok commits -> ··· 27 27 28 28 let%expect_test "parse_root_commit" = 29 29 let input = 30 - {|{"commit_id":"root","parents":[],"change_id":"xyz","description":"Root","working_copy":false,"immutable":true,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"ro","commit_id_rest":"ot"}|} 30 + {|{"commit_id":"root","parents":[],"change_id":"xyz","description":"Root","working_copy":false,"immutable":true,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"ro","commit_id_rest":"ot"}|} 31 31 in 32 32 (match parse_jj_log_output input with 33 33 | Ok commits -> ··· 43 43 44 44 let%expect_test "commits_to_nodes_parent_linking" = 45 45 let input = 46 - {|{"commit_id":"parent","parents":[],"change_id":"p","description":"Parent","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"p","change_id_rest":"","commit_id_prefix":"par","commit_id_rest":"ent"} 47 - {"commit_id":"child","parents":["parent"],"change_id":"c","description":"Child","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"","commit_id_prefix":"chi","commit_id_rest":"ld"}|} 46 + {|{"commit_id":"parent","parents":[],"change_id":"p","description":"Parent","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"p","change_id_rest":"","commit_id_prefix":"par","commit_id_rest":"ent"} 47 + {"commit_id":"child","parents":["parent"],"change_id":"c","description":"Child","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"","commit_id_prefix":"chi","commit_id_rest":"ld"}|} 48 48 in 49 49 (match parse_jj_log_output input with 50 50 | Ok commits -> ··· 70 70 71 71 let%expect_test "parse_multiple_parents" = 72 72 let input = 73 - {|{"commit_id":"parent1","parents":[],"change_id":"p1","description":"Parent 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"p","change_id_rest":"1","commit_id_prefix":"par","commit_id_rest":"ent1"} 74 - {"commit_id":"parent2","parents":[],"change_id":"p2","description":"Parent 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"p","change_id_rest":"2","commit_id_prefix":"par","commit_id_rest":"ent2"} 75 - {"commit_id":"merge","parents":["parent1","parent2"],"change_id":"m","description":"Merge commit","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"m","change_id_rest":"","commit_id_prefix":"mer","commit_id_rest":"ge"}|} 73 + {|{"commit_id":"parent1","parents":[],"change_id":"p1","description":"Parent 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"p","change_id_rest":"1","commit_id_prefix":"par","commit_id_rest":"ent1"} 74 + {"commit_id":"parent2","parents":[],"change_id":"p2","description":"Parent 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"p","change_id_rest":"2","commit_id_prefix":"par","commit_id_rest":"ent2"} 75 + {"commit_id":"merge","parents":["parent1","parent2"],"change_id":"m","description":"Merge commit","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"m","change_id_rest":"","commit_id_prefix":"mer","commit_id_rest":"ge"}|} 76 76 in 77 77 (match parse_jj_log_output input with 78 78 | Ok commits -> ··· 100 100 101 101 let%expect_test "parse_commit_with_bookmarks" = 102 102 let input = 103 - {|{"commit_id":"abc123","parents":[],"change_id":"xyz","description":"Commit with bookmarks","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":["main","feature"],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"abc","commit_id_rest":"123"}|} 103 + {|{"commit_id":"abc123","parents":[],"change_id":"xyz","description":"Commit with bookmarks","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":["main","feature"],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"abc","commit_id_rest":"123"}|} 104 104 in 105 105 (match parse_jj_log_output input with 106 106 | Ok commits -> ··· 119 119 120 120 let%expect_test "parse_wip_commit" = 121 121 let input = 122 - {|{"commit_id":"wip123","parents":[],"change_id":"xyz","description":"wip: work in progress","working_copy":true,"immutable":false,"wip":true,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"wip","commit_id_rest":"123"}|} 122 + {|{"commit_id":"wip123","parents":[],"change_id":"xyz","description":"wip: work in progress","working_copy":true,"immutable":false,"wip":true,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"wip","commit_id_rest":"123"}|} 123 123 in 124 124 (match parse_jj_log_output input with 125 125 | Ok commits -> ··· 165 165 166 166 let%expect_test "commits_to_nodes_preserves_order" = 167 167 let input = 168 - {|{"commit_id":"first","parents":[],"change_id":"f","description":"First","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"f","change_id_rest":"","commit_id_prefix":"fir","commit_id_rest":"st"} 169 - {"commit_id":"second","parents":["first"],"change_id":"s","description":"Second","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"s","change_id_rest":"","commit_id_prefix":"sec","commit_id_rest":"ond"} 170 - {"commit_id":"third","parents":["second"],"change_id":"t","description":"Third","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"t","change_id_rest":"","commit_id_prefix":"thi","commit_id_rest":"rd"}|} 168 + {|{"commit_id":"first","parents":[],"change_id":"f","description":"First","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"f","change_id_rest":"","commit_id_prefix":"fir","commit_id_rest":"st"} 169 + {"commit_id":"second","parents":["first"],"change_id":"s","description":"Second","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"s","change_id_rest":"","commit_id_prefix":"sec","commit_id_rest":"ond"} 170 + {"commit_id":"third","parents":["second"],"change_id":"t","description":"Third","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"t","change_id_rest":"","commit_id_prefix":"thi","commit_id_rest":"rd"}|} 171 171 in 172 172 (match parse_jj_log_output input with 173 173 | Ok commits -> ··· 186 186 187 187 let%expect_test "commits_to_nodes_copies_fields" = 188 188 let input = 189 - {|{"commit_id":"test","parents":[],"change_id":"xyz","description":"Test commit","working_copy":true,"immutable":true,"wip":true,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"te","commit_id_rest":"st"}|} 189 + {|{"commit_id":"test","parents":[],"change_id":"xyz","description":"Test commit","working_copy":true,"immutable":true,"wip":true,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-01"},"change_id_prefix":"xy","change_id_rest":"z","commit_id_prefix":"te","commit_id_rest":"st"}|} 190 190 in 191 191 (match parse_jj_log_output input with 192 192 | Ok commits -> ··· 210 210 211 211 let%expect_test "commits_to_nodes_missing_parent_creates_elided" = 212 212 let input = 213 - {|{"commit_id":"child","parents":["missing_parent"],"change_id":"c","description":"Child with missing parent","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"","commit_id_prefix":"chi","commit_id_rest":"ld"}|} 213 + {|{"commit_id":"child","parents":["missing_parent"],"change_id":"c","description":"Child with missing parent","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"","commit_id_prefix":"chi","commit_id_rest":"ld"}|} 214 214 in 215 215 (match parse_jj_log_output input with 216 216 | Ok commits -> ··· 237 237 238 238 let%expect_test "commits_to_nodes_multiple_children_same_missing_parent" = 239 239 let input = 240 - {|{"commit_id":"child1","parents":["missing_parent"],"change_id":"c1","description":"Child 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"1","commit_id_prefix":"chi","commit_id_rest":"ld1"} 241 - {"commit_id":"child2","parents":["missing_parent"],"change_id":"c2","description":"Child 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"c","change_id_rest":"2","commit_id_prefix":"chi","commit_id_rest":"ld2"}|} 240 + {|{"commit_id":"child1","parents":["missing_parent"],"change_id":"c1","description":"Child 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"1","commit_id_prefix":"chi","commit_id_rest":"ld1"} 241 + {"commit_id":"child2","parents":["missing_parent"],"change_id":"c2","description":"Child 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"c","change_id_rest":"2","commit_id_prefix":"chi","commit_id_rest":"ld2"}|} 242 242 in 243 243 (match parse_jj_log_output input with 244 244 | Ok commits -> ··· 264 264 265 265 let%expect_test "commits_to_nodes_same_missing_parent_physical_equality" = 266 266 let input = 267 - {|{"commit_id":"child1","parents":["missing_parent"],"change_id":"c1","description":"Child 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"1","commit_id_prefix":"chi","commit_id_rest":"ld1"} 268 - {"commit_id":"child2","parents":["missing_parent"],"change_id":"c2","description":"Child 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"c","change_id_rest":"2","commit_id_prefix":"chi","commit_id_rest":"ld2"}|} 267 + {|{"commit_id":"child1","parents":["missing_parent"],"change_id":"c1","description":"Child 1","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-02"},"change_id_prefix":"c","change_id_rest":"1","commit_id_prefix":"chi","commit_id_rest":"ld1"} 268 + {"commit_id":"child2","parents":["missing_parent"],"change_id":"c2","description":"Child 2","working_copy":false,"immutable":false,"wip":false,"hidden":false,"divergent":false,"conflict":false,"empty":false,"bookmarks":[],"author":{"email":"test@example.com","timestamp":"2024-01-03"},"change_id_prefix":"c","change_id_rest":"2","commit_id_prefix":"chi","commit_id_rest":"ld2"}|} 269 269 in 270 270 (match parse_jj_log_output input with 271 271 | Ok commits ->
+7
jj_tui/lib/render_jj_graph.ml
··· 33 33 let working_copy = Util.make_uchar "@" 34 34 let wip = Util.make_uchar "◌" 35 35 let immutable = Util.make_uchar "◆" 36 + let conflict = Util.make_uchar "×" 36 37 end 37 38 end 38 39 ··· 52 53 ; empty : bool 53 54 ; hidden : bool 54 55 ; divergent : bool 56 + ; conflict : bool 55 57 ; is_preview : bool 56 58 ; change_id_prefix : string 57 59 ; change_id_rest : string ··· 79 81 ; empty = false 80 82 ; hidden = true 81 83 ; divergent = false 84 + ; conflict = false 82 85 ; is_preview = false 83 86 ; change_id_prefix = "" 84 87 ; change_id_rest = "" ··· 119 122 ; empty = false 120 123 ; hidden = false 121 124 ; divergent = false 125 + ; conflict = false 122 126 ; is_preview = true 123 127 ; change_id_prefix = "" 124 128 ; change_id_rest = "" ··· 1279 1283 let glyph = 1280 1284 if n.working_copy 1281 1285 then P.Node.working_copy 1286 + else if n.conflict 1287 + then P.Node.conflict 1282 1288 else if n.immutable 1283 1289 then P.Node.immutable 1284 1290 else if n.wip ··· 1543 1549 || contains_str line "@" 1544 1550 || contains_str line "◌" 1545 1551 || contains_str line "◆" 1552 + || contains_str line "×" 1546 1553 in 1547 1554 let has_term = contains_str line "~" in 1548 1555 let has_merge_fork =
+35 -11
jj_tui/lib/render_jj_graph_tests.ml
··· 16 16 ; empty = false 17 17 ; hidden = false 18 18 ; divergent = false 19 + ; conflict = false 19 20 ; is_preview = false 20 21 ; change_id_prefix = "" 21 22 ; change_id_rest = "" ··· 24 25 } 25 26 ;; 26 27 27 - let find_node_exn nodes commit_id = 28 - nodes |> List.find (fun n -> n.commit_id = commit_id) 29 - ;; 30 - 31 - let find_preview_exn nodes = 32 - nodes |> List.find (fun n -> n.is_preview) 33 - ;; 34 - 28 + let find_node_exn nodes commit_id = nodes |> List.find (fun n -> n.commit_id = commit_id) 29 + let find_preview_exn nodes = nodes |> List.find (fun n -> n.is_preview) 35 30 let parent_ids node = node.parents |> List.map (fun p -> p.commit_id) 36 - ;; 37 31 38 32 let%expect_test "apply_rebase_preview_insert_before" = 39 33 let c = make_node "c" in 40 34 let b = make_node ~parents:[ c ] "b" in 41 35 let a = make_node ~parents:[ b ] "a" in 42 36 let nodes, invalid = 43 - apply_rebase_preview ~mode:`Insert_before ~sources:[ "c" ] ~targets:[ "b" ] [ a; b; c ] 37 + apply_rebase_preview 38 + ~mode:`Insert_before 39 + ~sources:[ "c" ] 40 + ~targets:[ "b" ] 41 + [ a; b; c ] 44 42 in 45 43 let preview = find_preview_exn nodes in 46 44 let b = find_node_exn nodes "b" in ··· 92 90 let b = make_node ~parents:[ c ] "b" in 93 91 let a = make_node ~parents:[ b ] "a" in 94 92 let nodes, invalid = 95 - apply_rebase_preview ~mode:`Insert_before ~sources:[ "a" ] ~targets:[ "b" ] [ a; b; c ] 93 + apply_rebase_preview 94 + ~mode:`Insert_before 95 + ~sources:[ "a" ] 96 + ~targets:[ "b" ] 97 + [ a; b; c ] 96 98 in 97 99 let preview_count = nodes |> List.filter (fun n -> n.is_preview) |> List.length in 98 100 print_endline (Option.value invalid ~default:"ok"); ··· 124 126 ; empty = false 125 127 ; hidden = false 126 128 ; divergent = false 129 + ; conflict = false 127 130 ; is_preview = false 128 131 ; change_id_prefix = "" 129 132 ; change_id_rest = "" ··· 147 150 ; empty = false 148 151 ; hidden = false 149 152 ; divergent = false 153 + ; conflict = false 150 154 ; is_preview = false 151 155 ; change_id_prefix = "" 152 156 ; change_id_rest = "" ··· 170 174 ; empty = false 171 175 ; hidden = false 172 176 ; divergent = false 177 + ; conflict = false 173 178 ; is_preview = false 174 179 ; change_id_prefix = "" 175 180 ; change_id_rest = "" ··· 193 198 ; empty = false 194 199 ; hidden = false 195 200 ; divergent = false 201 + ; conflict = false 196 202 ; is_preview = false 197 203 ; change_id_prefix = "" 198 204 ; change_id_rest = "" ··· 241 247 ; empty = false 242 248 ; hidden = false 243 249 ; divergent = false 250 + ; conflict = false 244 251 ; is_preview = false 245 252 ; change_id_prefix = "" 246 253 ; change_id_rest = "" ··· 264 271 ; empty = false 265 272 ; hidden = false 266 273 ; divergent = false 274 + ; conflict = false 267 275 ; is_preview = false 268 276 ; change_id_prefix = "" 269 277 ; change_id_rest = "" ··· 287 295 ; empty = false 288 296 ; hidden = false 289 297 ; divergent = false 298 + ; conflict = false 290 299 ; is_preview = false 291 300 ; change_id_prefix = "" 292 301 ; change_id_rest = "" ··· 310 319 ; empty = false 311 320 ; hidden = false 312 321 ; divergent = false 322 + ; conflict = false 313 323 ; is_preview = false 314 324 ; change_id_prefix = "" 315 325 ; change_id_rest = "" ··· 333 343 ; empty = false 334 344 ; hidden = false 335 345 ; divergent = false 346 + ; conflict = false 336 347 ; is_preview = false 337 348 ; change_id_prefix = "" 338 349 ; change_id_rest = "" ··· 356 367 ; empty = false 357 368 ; hidden = false 358 369 ; divergent = false 370 + ; conflict = false 359 371 ; is_preview = false 360 372 ; change_id_prefix = "" 361 373 ; change_id_rest = "" ··· 379 391 ; empty = false 380 392 ; hidden = false 381 393 ; divergent = false 394 + ; conflict = false 382 395 ; is_preview = false 383 396 ; change_id_prefix = "" 384 397 ; change_id_rest = "" ··· 402 415 ; empty = false 403 416 ; hidden = false 404 417 ; divergent = false 418 + ; conflict = false 405 419 ; is_preview = false 406 420 ; change_id_prefix = "" 407 421 ; change_id_rest = "" ··· 425 439 ; empty = false 426 440 ; hidden = false 427 441 ; divergent = false 442 + ; conflict = false 428 443 ; is_preview = false 429 444 ; change_id_prefix = "" 430 445 ; change_id_rest = "" ··· 448 463 ; empty = false 449 464 ; hidden = false 450 465 ; divergent = false 466 + ; conflict = false 451 467 ; is_preview = false 452 468 ; change_id_prefix = "" 453 469 ; change_id_rest = "" ··· 545 561 ; empty = false 546 562 ; hidden = false 547 563 ; divergent = false 564 + ; conflict = false 548 565 ; is_preview = false 549 566 ; change_id_prefix = "" 550 567 ; change_id_rest = "" ··· 673 690 ; empty = false 674 691 ; hidden = false 675 692 ; divergent = false 693 + ; conflict = false 676 694 ; is_preview = false 677 695 ; change_id_prefix = "" 678 696 ; change_id_rest = "" ··· 704 722 ; empty = false 705 723 ; hidden = false 706 724 ; divergent = false 725 + ; conflict = false 707 726 ; is_preview = false 708 727 ; change_id_prefix = "" 709 728 ; change_id_rest = "" ··· 773 792 ; empty = false 774 793 ; hidden = false 775 794 ; divergent = false 795 + ; conflict = false 776 796 ; is_preview = false 777 797 ; change_id_prefix = "" 778 798 ; change_id_rest = "" ··· 796 816 ; empty = false 797 817 ; hidden = false 798 818 ; divergent = false 819 + ; conflict = false 799 820 ; is_preview = false 800 821 ; change_id_prefix = "" 801 822 ; change_id_rest = "" ··· 819 840 ; empty = false 820 841 ; hidden = false 821 842 ; divergent = false 843 + ; conflict = false 822 844 ; is_preview = false 823 845 ; change_id_prefix = "" 824 846 ; change_id_rest = "" ··· 842 864 ; empty = false 843 865 ; hidden = false 844 866 ; divergent = false 867 + ; conflict = false 845 868 ; is_preview = false 846 869 ; change_id_prefix = "" 847 870 ; change_id_rest = "" ··· 908 931 ; empty = false 909 932 ; hidden = false 910 933 ; divergent = false 934 + ; conflict = false 911 935 ; is_preview = false 912 936 ; change_id_prefix = "" 913 937 ; change_id_rest = ""
+1 -1
test_render.ml
··· 63 63 Printf.printf "│ (empty) (no description set)\n"; 64 64 Printf.printf "\nActual rendering test:\n"; 65 65 66 - let node_glyphs = [ "○"; "@"; "◌"; "◆" ] in 66 + let node_glyphs = [ "○"; "@"; "◌"; "◆"; "×" ] in 67 67 let graph_continuation = 68 68 let chars = "@ " in 69 69 let replaced = ref chars in