comparison mercurial/patch.py @ 14533:aa12e1bbde10

patch: remove unnecessary exists() call in selectfile()
author Patrick Mezard <pmezard@gmail.com>
date Sun, 05 Jun 2011 22:24:11 +0200
parents b88368a3ade4
children ecc79816d31e
comparison
equal deleted inserted replaced
14532:2498128821a9 14533:aa12e1bbde10
1021 # Git patches do not play games. Excluding copies from the 1021 # Git patches do not play games. Excluding copies from the
1022 # following heuristic avoids a lot of confusion 1022 # following heuristic avoids a lot of confusion
1023 fname = pathstrip(gp.path, strip - 1)[1] 1023 fname = pathstrip(gp.path, strip - 1)[1]
1024 create = gp.op in ('ADD', 'COPY', 'RENAME') 1024 create = gp.op in ('ADD', 'COPY', 'RENAME')
1025 remove = gp.op == 'DELETE' 1025 remove = gp.op == 'DELETE'
1026 missing = not create and not backend.exists(fname)
1027 return fname, create, remove 1026 return fname, create, remove
1028 nulla = afile_orig == "/dev/null" 1027 nulla = afile_orig == "/dev/null"
1029 nullb = bfile_orig == "/dev/null" 1028 nullb = bfile_orig == "/dev/null"
1030 create = nulla and hunk.starta == 0 and hunk.lena == 0 1029 create = nulla and hunk.starta == 0 and hunk.lena == 0
1031 remove = nullb and hunk.startb == 0 and hunk.lenb == 0 1030 remove = nullb and hunk.startb == 0 and hunk.lenb == 0