svn diff with stripping of code comments
From: John Pye <john_at_curioussymbols.com>
Date: 2006-08-04 04:56:29 CEST
Hi all
Subversion supports calling an external script to perform diffs when
I'd like to use this facility to find non-trivial changes in a code
I've got a preliminary python script which I'll attach here. It's buggy,
I use a wrapper script as suggested in
Cheers
#!/usr/bin/python
from optparse import OptionParser
sys.stderr.write(str(sys.argv))
exit(0)
#parser = OptionParser()
diffargs=[
diffcmd="diff"
# you'll need to compile this file:
astylecmd=['astyle','--mode=c","--style=gnu','--convert-tabs','-a'];
f = file(tmpfile,'w');
strip11 = Popen([catcmd]+[sys.argv[1]],stdout=PIPE,close_fds=True)
strip21 = Popen([catcmd]+[sys.argv[2]],stdout=PIPE,close_fds=True)
f.write(strip23.stdout.read())
p = Popen([diffcmd]+diffargs+["-",tmpfile],stdin=strip13.stdout,stderr=PIPE,close_fds=True)
os.unlink(tmpfile)
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.