Wheels within Wheels James Falkner's Blog

Thursday Jul 26, 2007

Just a quickie today.  I am merging some work I did from a really old Mercurial repository, into a much more recent repository.  Because of the big changes that have gone in, I am hand-merging.  I needed a way to easily browse diffs from the old work, so that I can manually cut/paste as needed into the new repository.  Here is a short script I wrote which uses Zenity to show a list of files with diffs, and when I double-click on the file, it brings up the diffs in tkdiff.


#!/bin/sh
while [ 1 ] ; do
FILELIST=`hg status -n`
FILE=`zenity --list --column="File to show diffs for" $FILELIST`
if [ -z "$FILE" ] ; then
exit 0
fi
hg cat $FILE > /tmp/hg.orig.$$
tkdiff /tmp/hg.orig.$$ `hg root`/$FILE
rm -f /tmp/hg.orig.$$
done

 

 

Comments:

Thanks a lot for this. Gave me a nice introduction to how simple zenity is, along with a very useful script to have :)

Posted by Sameer on August 14, 2008 at 05:22 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed