Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 12357:cb59654c2c7a
Restore lexists() changes lost in e0ee3e822a9a merge
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 20 Sep 2010 22:41:10 +0200 |
parents | e0ee3e822a9a |
children | 2063d36b406e |
comparison
equal
deleted
inserted
replaced
12345:e0ee3e822a9a | 12357:cb59654c2c7a |
---|---|
361 gp = patches[f] | 361 gp = patches[f] |
362 if gp and gp.mode: | 362 if gp and gp.mode: |
363 islink, isexec = gp.mode | 363 islink, isexec = gp.mode |
364 dst = repo.wjoin(gp.path) | 364 dst = repo.wjoin(gp.path) |
365 # patch won't create empty files | 365 # patch won't create empty files |
366 if gp.op == 'ADD' and not os.path.exists(dst): | 366 if gp.op == 'ADD' and not os.path.lexists(dst): |
367 flags = (isexec and 'x' or '') + (islink and 'l' or '') | 367 flags = (isexec and 'x' or '') + (islink and 'l' or '') |
368 repo.wwrite(gp.path, '', flags) | 368 repo.wwrite(gp.path, '', flags) |
369 util.set_flags(dst, islink, isexec) | 369 util.set_flags(dst, islink, isexec) |
370 addremove(repo, cfiles, similarity=similarity) | 370 addremove(repo, cfiles, similarity=similarity) |
371 files = patches.keys() | 371 files = patches.keys() |
519 # component of the source path or it does not. | 519 # component of the source path or it does not. |
520 def evalpath(striplen): | 520 def evalpath(striplen): |
521 score = 0 | 521 score = 0 |
522 for s in srcs: | 522 for s in srcs: |
523 t = os.path.join(dest, util.localpath(s[0])[striplen:]) | 523 t = os.path.join(dest, util.localpath(s[0])[striplen:]) |
524 if os.path.exists(t): | 524 if os.path.lexists(t): |
525 score += 1 | 525 score += 1 |
526 return score | 526 return score |
527 | 527 |
528 abspfx = util.localpath(abspfx) | 528 abspfx = util.localpath(abspfx) |
529 striplen = len(abspfx) | 529 striplen = len(abspfx) |