[svk-devel] Patch: -g for diff
svk at rjlov.com
svk at rjlov.com
Wed Aug 2 08:33:40 EDT 2006
Hi there.
Firstly, thanks very much for SVK clkao et al.
Now, to business. :)
I sometimes like to use a graphical diff tool, but not all the time.
Sometimes it's a pain to fiddle SVKDIFF depending on what I want
to do.
So, this very simple patch adds a -g/--graphical to the diff
command. If this flag is set, then it uses the program in SVKGDIFF,
instead of SVKDIFF. This means I can set SVKGDIFF, and then -g gives
me a graphical diff.
I find it very handy, so if you think anybody else would like this
behaviour, well, here's the patch. :)
Cheers,
Richard.
==== Patch <gdiff.patch> level 1
Source: [No source]
Target: 4ccb8a5b-8ae0-0310-9b02-86531366991d:/trunk:1877 [mirrored]
(svn://svn.clkao.org/svk/trunk)
Log:
Add -g / --graphical to Diff, uses the SVKGDIFF tool
=== lib/SVK/Command/Diff.pm
==================================================================
--- lib/SVK/Command/Diff.pm (revision 1877)
+++ lib/SVK/Command/Diff.pm (patch gdiff.patch level 1)
@@ -9,6 +9,7 @@
sub options {
("v|verbose" => 'verbose',
+ "g|graphical" => 'graphical',
"s|summarize" => 'summarize',
"X|expand" => 'expand',
"r|revision=s@" => 'revspec');
@@ -76,7 +77,7 @@
( $cb_llabel ? (cb_llabel => $cb_llabel) : (llabel => "revision
".($target->revision)),
rlabel => $target2->isa('SVK::Path::Checkout')
? 'local' : "revision ".($target2->revision),
- external => $ENV{SVKDIFF},
+ external => ( $self->{graphical} ? $ENV{SVKGDIFF} :
$ENV{SVKDIFF} ),
$target->path_anchor ne $target2->path_anchor ?
( lpath => $target->path_anchor,
rpath => $target2->path_anchor ) : (),
@@ -178,8 +179,9 @@
-v [--verbose] : print extra information
-X [--expand] : expand files copied as new files
-N [--non-recursive] : do not descend recursively
+ -g [--graphical] : use command in SVKGDIFF to present diff
- See also SVKDIFF in svk help environment.
+ See also SVKDIFF, SVKGDIFF in svk help environment.
=head1 AUTHORS
=== lib/SVK/Help/Environment.pod
==================================================================
--- lib/SVK/Help/Environment.pod (revision 1877)
+++ lib/SVK/Help/Environment.pod (patch gdiff.patch level 1)
@@ -30,6 +30,12 @@
If you'd prefer to use an external "diff" tool instead of svk's builtin
diff library, set this variable to your tool's name or path.
+=item $SVKGDIFF
+
+If only SOMETIMES you'd prefer to use an external "diff" tool,
+set this variable to your tool's name or path. Then you can
+launch it using "svk diff -g ...".
+
=item $SVKMERGE
svk lets you resolve conflicts, interactively, with a text editor or
--
Richard Lovejoy
rjlovejoy at fastmail.fm
+61 400 841473
More information about the svk-devel
mailing list