comparison mercurial/cmdutil.py @ 42643:ce52377102db stable

amend: stop committing unrequested file reverts (issue6157) Differential Revision: https://phab.mercurial-scm.org/D6667
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Mon, 22 Jul 2019 06:33:11 -0400
parents 5162753c4c14
children 3cf091843b4f
comparison
equal deleted inserted replaced
42642:464aa857c717 42643:ce52377102db
2503 # copy, then those two files are the same and 2503 # copy, then those two files are the same and
2504 # we can discard X from our list of files. Likewise if X 2504 # we can discard X from our list of files. Likewise if X
2505 # was removed, it's no longer relevant. If X is missing (aka 2505 # was removed, it's no longer relevant. If X is missing (aka
2506 # deleted), old X must be preserved. 2506 # deleted), old X must be preserved.
2507 files.update(filestoamend) 2507 files.update(filestoamend)
2508 files = [f for f in files if (not samefile(f, wctx, base) 2508 files = [f for f in files if (f not in filestoamend
2509 or f in wctx.deleted())] 2509 or not samefile(f, wctx, base))]
2510 2510
2511 def filectxfn(repo, ctx_, path): 2511 def filectxfn(repo, ctx_, path):
2512 try: 2512 try:
2513 # If the file being considered is not amongst the files 2513 # If the file being considered is not amongst the files
2514 # to be amended, we should return the file context from the 2514 # to be amended, we should return the file context from the