# HG changeset patch # User Patrick Mezard # Date 1197929164 -3600 # Node ID e11940d84606541475e9722e9b2ac86f4fe3768f # Parent 5d3e2f918d6501153536172509542d53e2dfc960 patch: avoid file existence tests when possible in selectfile() diff -r 5d3e2f918d65 -r e11940d84606 mercurial/patch.py --- a/mercurial/patch.py Mon Dec 17 23:06:01 2007 +0100 +++ b/mercurial/patch.py Mon Dec 17 23:06:04 2007 +0100 @@ -796,12 +796,12 @@ nulla = afile_orig == "/dev/null" nullb = bfile_orig == "/dev/null" afile = pathstrip(afile_orig, strip) - gooda = os.path.exists(afile) and not nulla + gooda = not nulla and os.path.exists(afile) bfile = pathstrip(bfile_orig, strip) if afile == bfile: goodb = gooda else: - goodb = os.path.exists(bfile) and not nullb + goodb = not nullb and os.path.exists(bfile) createfunc = hunk.createfile if reverse: createfunc = hunk.rmfile