Differences between revisions 1 and 2
Revision 1 as of 2008-03-23 11:19:56
Size: 1196
Editor: abuehl
Comment: moved from TipsAndTricks/Intermediate
Revision 2 as of 2008-03-24 10:05:21
Size: 1182
Editor: abuehl
Comment: oodiff is now local
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 * Install [attachment:TipsAndTricks/oodiff oodiff],  * Install [attachment:oodiff oodiff],

Handling OpenDocument (OpenOffice.org, Koffice, ...) files

To view plaintext diff of OpenDocument files in Mercurial, you can use the extdiff extension, provided with Mercurial.

[extensions]
extdiff =

You can now, for example, do

$ hg extdiff -p oodiff
making snapshot of 1 files from rev 89b7c9334dd5
making snapshot of 1 files from working dir
6c6
<   First version of second item
---
>   Second version of second item

Now, let's automate this a bit more. Add this to your ~/.hgrc:

[extdiff]
cmd.oodiff = oodiff
opts.oodiff = -u

And you can directly run

$ hg oodiff
making snapshot of 1 files from rev 89b7c9334dd5
making snapshot of 1 files from working dir
--- hg.89b7c9334dd5/presentation-expl.odp
+++ hg/presentation-expl.odp
@@ -3,7 +3,7 @@
 
   First item
 
-  First version of second item
+  Second version of second item
 
   Last item

(this is documented [http://www-verimag.imag.fr/~moy/opendocument/ here] too).


CategoryTipsAndTricks

HandlingOpenDocumentFiles (last edited 2009-05-19 19:31:03 by localhost)