# HG changeset patch # User Christian Humer # Date 1395270949 -3600 # Node ID 4f8268dee8aa5fe75cb57663dbda4e99b86bdb17 # Parent ed3bfe43d7722d0a7bdc3f77fd5b5389600d7f2a mx: eclipseformat now prints all the changes that were found to the console. diff -r ed3bfe43d772 -r 4f8268dee8aa mxtool/mx.py --- a/mxtool/mx.py Wed Mar 19 21:10:34 2014 +0100 +++ b/mxtool/mx.py Thu Mar 20 00:15:49 2014 +0100 @@ -40,6 +40,7 @@ import xml.parsers.expat import shutil, re, xml.dom.minidom import pipes +import difflib from collections import Callable from threading import Thread from argparse import ArgumentParser, REMAINDER @@ -1930,6 +1931,7 @@ with open(self.path) as fp: content = fp.read() if self.content != content: + self.diff = difflib.unified_diff(self.content.splitlines(1), content.splitlines(1)) self.content = content return True os.utime(self.path, self.times) @@ -1967,6 +1969,7 @@ modified.append(fi) log('{0} files were modified'.format(len(modified))) + if len(modified) != 0: arcbase = _primary_suite.dir if args.backup: @@ -1975,6 +1978,8 @@ for fi in modified: name = os.path.relpath(fi.path, arcbase) log(' - {0}'.format(name)) + log('Changes:') + log(''.join(fi.diff)) if args.backup: arcname = name.replace(os.sep, '/') zf.writestr(arcname, fi.content)