##// END OF EJS Templates
amend: stop committing unrequested file reverts (issue6157)...
Valentin Gatien-Baron -
r42866:ce523771 stable
parent child Browse files
Show More
@@ -2505,8 +2505,8 b' def amend(ui, repo, old, extra, pats, op'
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:
@@ -456,7 +456,7 b' Corner case of amend from issue6157:'
456 - working copy parent has a change to file `a`
456 - working copy parent has a change to file `a`
457 - working copy has the inverse change
457 - working copy has the inverse change
458 - we amend the working copy parent for files other than `a`
458 - we amend the working copy parent for files other than `a`
459 hg includes the changes to `a` anyway.
459 hg used to include the changes to `a` anyway.
460
460
461 $ hg init 6157; cd 6157
461 $ hg init 6157; cd 6157
462 $ echo a > a; echo b > b; hg commit -qAm_
462 $ echo a > a; echo b > b; hg commit -qAm_
@@ -466,5 +466,6 b' hg includes the changes to `a` anyway.'
466 1 files changed, 1 insertions(+), 1 deletions(-)
466 1 files changed, 1 insertions(+), 1 deletions(-)
467 $ echo a > a; echo b2 > b; hg amend -q b
467 $ echo a > a; echo b2 > b; hg amend -q b
468 $ hg diff --stat -c .
468 $ hg diff --stat -c .
469 a | 2 +-
469 b | 2 +-
470 b | 2 +-
470 1 files changed, 1 insertions(+), 1 deletions(-)
471 2 files changed, 2 insertions(+), 2 deletions(-)
General Comments 0
You need to be logged in to leave comments. Login now