def do_diff(self, options): """Print the diff to apply after the upgrade. """ git = Git(options.upstream) status = self.check_files(git, options.files) for check_file in status: local_chunks = status[check_file]['local_chunks'] if local_chunks: print_diff(git.get_diff(check_file))
def do_check(self, options): """Checks local modifcations if are in upstream. """ git = Git(options.upstream) n_files = 0 n_chunks = 0 status = self.check_files(git, options.files) for check_file in status: pymd5 = status[check_file]['checksum'] local_chunks = status[check_file]['local_chunks'] if local_chunks: n_files += 1 n_chunks += len(local_chunks.values()) puts(RED("FAIL %s %s" % (pymd5, check_file))) if options.diff: for chunk in local_chunks.values(): print_diff(chunk) else: puts(GREEN("OK %s %s" % (pymd5, check_file)))