Bug 3724 - histedit does not conserve phase of "pick" changesets
Summary: histedit does not conserve phase of "pick" changesets
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: histedit (show other bugs)
Version: earlier
Hardware: PC Linux
: normal bug
Assignee: Pierre-Yves David
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 11:47 UTC by Fabrice Gabolde
Modified: 2017-11-01 18:04 UTC (History)
1 user (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabrice Gabolde 2012-12-06 11:47 UTC
Hi,

histedit seems to change the phase of rewritten changesets, including promoting secret changesets to draft:

# commit some changesets in draft
$ hg phase --secret --force tip
$ hg phase tip
N: secret
$ hg histedit -r somewhere_in_the_past
# reorder two commits before tip (not necessarily tip itself)
$ hg phase tip
N: draft
# expected: N: secret

I assume future changesets will inherit tip's new phase as well, marking the rest of the branch as draft (and leaking into the upstream repository) unless the user remembers to phase tip back into secret.
Comment 1 Augie Fackler 2012-12-06 11:49 UTC
I'm not convinced that's a bug - histedit is making new commits, and honoring your default phase setting for new commits.
Comment 2 Pierre-Yves David 2012-12-06 11:52 UTC
This is a bug, histedit should prevent the phase of part of history it rewrite. Draft changeset should stay draft even if new-commit option is set to secret. secret changeset should stay secret.

In case of reordering or folding, the highest phase win (default < secret)
Comment 3 Augie Fackler 2012-12-06 11:54 UTC
Seems likely you'll do this before me.
Comment 4 HG Bot 2013-01-18 13:45 UTC
Fixed by http://selenic.com/repo/hg/rev/c6e3fa134da5
Pierre-Yves David <pierre-yves.david@logilab.fr>
test-histedit: reorder phases test and prepare for more

We are going to add a lot regarding phase of test while fixing issue3724.

This movement allows to put them after this first phase test.

(please test the fix)
Comment 5 HG Bot 2013-01-18 13:45 UTC
Fixed by http://selenic.com/repo/hg/rev/35513c59f376
Pierre-Yves David <pierre-yves.david@logilab.fr>
histedit: proper phase conservation (issue3724)

Before this changeset, histedit created all new changesets according
phases.new-commit option without any regards for the phases of the original
changesets.

This changeset fix that using the phase of rewritten changeset to decide the
phase of the resulting changeset. In case of reordering or folding, we keep
secret item secret as it seems the safer path.

temporary commit creation are not affected. They are head only and stripped at
the end of the histedit.

As for the resolution of issue3681 (obsolescence cycle prevention), we do not
handle changesets created by edit command.

(please test the fix)
Comment 6 Fabrice Gabolde 2013-01-22 06:14 UTC
OK, this works fine in 2.5-rc now.

Thanks for the fix!