Mercurial > public > mercurial-scm > hg
diff tests/test-hook.t @ 13121:bf763946f8b0
make_file: always return a fresh file handle that can be closed
Currently, cmdutil.make_file() will return a freshly made file handle,
except when given a pattern of '-'. If callers would want to close the
handle, they would have to make sure that it's neither sys.stdin or
sys.stdout. Instead, returning a duplicate of either of the two
ensures that make_file() lives up to its name and creates a new
file handle regardless of the input.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Tue, 07 Dec 2010 16:08:16 +0100 |
parents | 6cc4b14fb76b |
children | 1775382ff833 |
line wrap: on
line diff
--- a/tests/test-hook.t Fri Dec 10 19:20:11 2010 -0600 +++ b/tests/test-hook.t Tue Dec 07 16:08:16 2010 +0100 @@ -73,8 +73,8 @@ [1] $ hg cat b pre-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] + b post-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] HG_RESULT=0 - b $ cd ../b $ hg pull ../a