This is an archive of the discontinued Mercurial Phabricator instance.

amend: stop specifying matcher, get all copies in wctx
ClosedPublic

Authored by spectral on Wed, May 11, 9:16 PM.

Details

Summary

When we're recreating the commit that we'll be committing, we don't want to
filter our copy information based on just the *new* [versions of the] files
we're amending. The test has an example of this case, but for clarity, the
situation is:

$ hg cp src dst && hg commit
<do some work>
$ hg amend some_unrelated_file.txt
$ hg status --copies
A dst
A some_unrelated_file.txt

What *should* happen is that dst should remain marked as a copy of src, but
this did not previously happen. matcher here only includes the files that were
specified on the commandline, so it only gets the copy information (if any, in
this example there's not) for some_unrelated_file.txt. When it goes to apply
the memctx to actually create the commit, the file copy information is
incomplete and loses the information for the files that shouldn't have been
affected at all by the amend.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Wed, May 11, 9:16 PM

Thanks for fixing! I'll apply this on stable.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.