Using monotone-viz/git-viz with mercurial
Radoslaw Szkodzinski
astralstorm at gorzow.mm.pl
Sun Jun 19 22:27:27 UTC 2005
Some patches follow. Should be self-describing.
These make git-viz a charm to work with.
###
Allow git-viz to display diffs without cogito
and thus make it work with hgit.
--- git-viz-0.1/git.ml 2005-06-20 00:19:14.372221574 +0200
+++ git-viz-0.2/git.ml 2005-06-20 00:07:14.363687478 +0200
@@ -326,10 +326,10 @@
cb (`SUB_PROC_ERROR "Diffs are not suported with git yet") ;
false))
| `PASKY ->
- let cmd = [ "cg-diff"; "-r"; parent^":"^child ] in
+ let cmd = [ "git-diff-tree"; "-r"; "-p"; parent; child ] in
log "exec" "### exec: Running '%s'" (String.concat " " cmd) ;
try
- status#push "Running cg-diff ..." ;
+ status#push "Running git-diff-tree ..." ;
ignore (
Subprocess.spawn_out
~working_directory:d.base
@@ -339,10 +339,10 @@
if status <> 0 then
if stderr = ""
then
- error "cg-diff exited with status %d:\n%s" status
+ error "git-diff-tree exited with status %d:\n%s" status
(String.concat "\n" (List.map Printexc.to_string
exceptions)) else
- error "cg-diff error:\n%s" stderr
+ error "git-diff-tree error:\n%s" stderr
else
cb (`DIFF stdout)))
with Gspawn.Error (_, msg) ->
###
Cosmetics this time.
--- git-viz-0.1/unidiff.ml 2005-04-17 20:20:06.000000000 +0200
+++ git-viz-0.2/unidiff.ml 2005-06-20 00:10:13.926081292 +0200
@@ -89,7 +89,7 @@
let s = GWindow.file_chooser_dialog
~action:`SAVE ~parent
~destroy_with_parent:true
- ~title:"Save monotone diff output" () in
+ ~title:"Save git diff output" () in
s#add_button_stock `CANCEL `CANCEL ;
s#add_select_button_stock `SAVE `SAVE ;
s#set_default_response `SAVE ;
@@ -102,13 +102,13 @@
with_file_out
(fun oc -> output_string oc text) f
with Sys_error _ ->
- Viz_types.errorf "Could not write monotone diff output to '%s'"
f)) ;
+ Viz_types.errorf "Could not write git diff output to '%s'" f)) ;
s
let view_diff ?parent (junk_end, tags_coords) text =
let window = GWindow.dialog
~no_separator:true ?parent
- ~title:"Monotone diff output"
+ ~title:"Git diff output"
~type_hint:`NORMAL
~icon:(Lazy.force Icon.monotone) () in
window#add_button_stock `SAVE `SAVE ;
@@ -179,6 +179,6 @@
~buttons:GWindow.Buttons.close
?parent
~destroy_with_parent:true
- ~title:"Monotone diff output" () in
+ ~title:"Git diff output" () in
ignore (d#connect#response (fun _ -> d#destroy ())) ;
d#show ()
###
AstralStorm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20050620/e2957de8/attachment-0001.asc>
More information about the Mercurial
mailing list