This is an archive of the discontinued Mercurial Phabricator instance.

uncommit: allow power users to leave an empty commit around
ClosedPublic

Authored by quark on Jul 20 2017, 3:19 PM.
Tags
None
Subscribers

Details

Summary

Some power user workflow requires uncommit to leave an empty commit so
they can run hg amend afterwards. I don't find easy alternatives so let's
allow that if ui.allowemptyconfig is set.

Note: ui.allowemptyconfig is an internal config that is not documented for
end-users. Core Mercurial seems to be trying to prevent the empty commit
case from normal users (like, comment disallows that, rebase will skip a
commit if after rebasing it becomes empty). So it seems better to still use
that undocumented config instead of a more discoverable flag.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark created this revision.Jul 20 2017, 3:19 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 20 2017, 3:19 PM
ryanmce accepted this revision.Jul 21 2017, 8:20 AM
ryanmce added a subscriber: ryanmce.

I'd prefer this to be a little more accessible via a flag to uncommit like --allow-empty. I agree with also looking at the config though, so accepting and letting you decide if you want to add the flag.

This revision is now accepted and ready to land.Jul 21 2017, 8:20 AM
In D156#2462, @ryanmce wrote:

I'd prefer this to be a little more accessible via a flag to uncommit like --allow-empty. I agree with also looking at the config though, so accepting and letting you decide if you want to add the flag.

Since ui.allowemptycommit is an "internal" config (see line 1823 in localrepo.py), I think core Mercurial wants to prevent that from normal users. Basically there is no way to create an empty commit using core Mercurial commands. So I prefer making it less discoverable.

quark edited the summary of this revision. (Show Details)Jul 21 2017, 11:01 AM
This revision was automatically updated to reflect the committed changes.