Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Mercurial, can obsolete changesets be forced to become not obsolete?

Tags:

mercurial

In Mercurial changesets with a successor are marked obsolete.

Can this marker be (forcefully) removed somehow?

After using hg strip to remove the successor, the original changeset is still marked as obsolete and extinct). hg evolve refuses to re-create the successor.

like image 332
Peter Avatar asked Apr 09 '15 15:04

Peter


People also ask

How do I merge commits in Mercurial?

Once the commits are in draft, run the hg histedit rev-id command, specifying the earliest draft commit. This will open the history edit function in your terminal, allowing you to fold the commit messages into one. Select a commit to use as the one into which the others will be squashed.

What is mercurial changeset?

A changeset (sometimes abbreviated "cset") is an atomic collection of changes to files in a repository. It contains all recorded local modification that lead to a new revision of the repository. A changeset is identified uniquely by a changeset ID. In a single repository, you can identify it using a revision number.


2 Answers

You can't unmark a change as obsolete, but you can bring it back to life using "hg touch <rev> --hidden", where touch is a new command that is part of the evolve extension.

FWIW. It's also possible to rebase the obsolete change, but you'll probably get fewer complications if you use touch.

like image 62
John Jefferies Avatar answered Sep 23 '22 14:09

John Jefferies


Yes! you can remove obsolescence markers now. Perhaps it wasn't possible in 2015, when the question was asked.

The solution is in the Apr 18, 2018 answer from user377178: hg --hidden debugobsolete --delete <revindex>

Note that you do not use a changeset ID. You must use an index number (at least, with Mercurial 4.1.3). Run hg --hidden debugobsolete --index to get a list of changesets with obsolescence markers. Find the index of the changeset that you want to become non-obsolete, then run hg --hidden debugobsolete --delete <revindex> with the index substituted for revindex. Then your obsolete changeset is no longer obsolete. (It might be in the list multiple times--I have not thoroughly investigated.)

The debugobsolete command is currently not listed in the evolve user guide, even in the section on recovering obsolete changesets. However, it is listed in the Evolve How To guide.

Many thanks to user377178.

like image 34
DouglasK Avatar answered Sep 22 '22 14:09

DouglasK