This is an archive of the discontinued Mercurial Phabricator instance.

commit: warn the user when a commit already exists
ClosedPublic

Authored by danchr on Oct 29 2020, 3:03 AM.

Details

Summary

Sometimes, a commit will result in an exact match of a preexisting
commit, and if that commit isn't a branch head, hg will incorrectly
note that it created a new head. Instead, we should warn the user that
commit already existed in the repository.

In practice, this bug is rather uncommon, and will only occur when the
usr explicitly sets the date.

Please note that this commit contains an API change to
cmdutil.commitstatus()

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

danchr created this revision.Oct 29 2020, 3:03 AM
danchr updated this revision to Diff 23356.Oct 29 2020, 3:10 AM
danchr retitled this revision from commit, backout: warn the user when a commit already exists to commit: warn the user when a commit already exists.
danchr edited the summary of this revision. (Show Details)
danchr updated this revision to Diff 23363.
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.

@durin42, this was queued for stable. It doesn't seem like a bug fix to me and I'm a little worried that the warning happens in benign situations and isn't actionable. I'd prefer if we moved it to the default branch.