tests/printrepr.py
author Brodie Rao <brodie@bitheap.org>
Mon, 30 Aug 2010 11:16:21 -0400
changeset 12135 b6cc68ef2702
parent 10263 25e572394f5c
permissions -rwxr-xr-x
test-serve: ensure KILLQUIETLY is only used once 49463314c24f introduced a feature to the hgserve() function that suppresses errors from kill(1). It wrongly assumed that setting an environment variable when calling a function would make it local to the function. It ended up suppressing kill errors for every call thereafter. This patch sets KILLQUIETLY=N after use.

#!/usr/bin/env python
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

"""prints repr(sys.stdin) but preserves newlines in input"""

import sys
print repr(sys.stdin.read())[1:-1].replace('\\n', '\n'),