( )⚙ D2862 uncommit: leave empty commit if all files are uncommitted

This is an archive of the discontinued Mercurial Phabricator instance.

uncommit: leave empty commit if all files are uncommitted
ClosedPublic

Authored by martinvonz on Mar 14 2018, 2:21 PM.

Details

Summary

We had instructions for our internal users to add copy information
after commit like this:

hg uncommit <srcfile> <dstfile>
hg cp --after <srcfile> <dstfile>
hg amend

That usually works, but if the rename was the only change in that
commit, then the commit would get pruned. It's easy to fix the recipe:
just pass the --keep option. However, it seems too subtle, so I think
this is an indication that the commit should not be pruned if any
patterns were given.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.Mar 14 2018, 2:21 PM
pulkit added a subscriber: pulkit.Mar 17 2018, 7:45 AM

Queuing this many thanks. Can you please send a followup with documenting the behavior of command related to pruning the empty changeset?

This revision was automatically updated to reflect the committed changes.