evolve: do not exit 1 when there are no troubled changesets (issue5823)
There are possibly other cases we also do not wish to exit non-zero for in this
function, but I did not analyze them closely and am just looking at resolving
issue5823.
import sys
formatted_args = []
UNSAFE_CHARACTERS = [" ", "!", "\"", "#", "$", "&", "'", "(", ")", "*", ",", ";", "<", ">", "?", "[", "\\", "]", "^", "`", "{", "|", "}", ":", "~", "/"]
def find_unsafe(arg):
for unsafe in UNSAFE_CHARACTERS:
if unsafe in arg:
return True
return False
for arg in sys.argv[1:]:
if find_unsafe(arg):
formatted_args.append('"%s"' % arg)
else:
formatted_args.append(arg)
print("$ " + " ".join(formatted_args))