Index: dev-tools/scripts/diffSources.py =================================================================== --- dev-tools/scripts/diffSources.py (revision 0) +++ dev-tools/scripts/diffSources.py (revision 0) @@ -0,0 +1,42 @@ +import subprocess +import sys + +""" +This tool creates an applyable patch between two directories. +""" + +# recursive, unified output format, treat missing files as present but empty +DIFF_FLAGS = '-ruN' + +if '-skipWhitespace' in sys.argv: + sys.argv.remove('-skipWhitespace') + # ignores only whitespace changes + DIFF_FLAGS += 'bBw' + +if len(sys.argv) != 3: + print + print 'Usage: python -u diffSources.py [-skipWhitespace]' + print + sys.exit(0) + +p = subprocess.Popen(['diff', DIFF_FLAGS, '-x', '.svn', '-x', 'build', sys.argv[1], sys.argv[2]], shell=False, stdout=subprocess.PIPE) + +keep = False +while True: + l = p.stdout.readline() + if l == '': + break + if l.endswith('\r\n'): + l = l[:-2] + elif l.endswith('\n'): + l = l[:-1] + if l.startswith('diff ') or l.startswith('Binary files '): + keep = l.lower().find('/build/') == -1 and (l.lower().startswith('Only in') or ((l.lower().endswith('.java') or l.lower().endswith('.txt') or l.lower().endswith('.xml') or l.lower().endswith('.iml')) and l.find('/.svn/') == -1)) + if keep: + print + print + print l.strip() + elif keep: + print l + elif l.startswith('Only in'): + print l.strip() Property changes on: dev-tools/scripts/diffSources.py ___________________________________________________________________ Added: svn:eol-style + native