Mercurial > hg > truffle
changeset 13288:9c3c915b5f56
Log modiffied files during eclipseformat
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 11 Dec 2013 12:21:07 +0100 |
parents | 9b053d478a4e |
children | 1734954cc73d |
files | mxtool/mx.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mxtool/mx.py Wed Dec 11 12:14:46 2013 +0100 +++ b/mxtool/mx.py Wed Dec 11 12:21:07 2013 +0100 @@ -2155,13 +2155,17 @@ log('{0} files were modified'.format(len(modified))) if len(modified) != 0: + arcbase = _primary_suite.dir if args.backup: backup = os.path.abspath('eclipseformat.backup.zip') - arcbase = _primary_suite.dir zf = zipfile.ZipFile(backup, 'w', zipfile.ZIP_DEFLATED) - for fi in modified: - arcname = os.path.relpath(fi.path, arcbase).replace(os.sep, '/') + for fi in modified: + name = os.path.relpath(fi.path, arcbase) + log(' - {0}'.format(name)) + if args.backup: + arcname = name.replace(os.sep, '/') zf.writestr(arcname, fi.content) + if args.backup: zf.close() log('Wrote backup of {0} modified files to {1}'.format(len(modified), backup)) return 1