How to edit the first changeset in a repository that includes merges?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to edit the first changeset in a repository that includes merges?

Mario Castelán Castro
Hello.

I have an unpublished project that will eventually be published with a
free (as in freedom) license. When I started the project I did not have
any intention to publish it and thus I did not add a license.

I want to modify the first changeset (all others are descendant of this
one) so that the license is added here, instead of in a later changeset,
that way it will be clear that the license is valid starting from the
very first version. The repository contains one named branch and one merge.

I tried to do this with: “hg histedit 1”, but I get this message:

$ hg histedit 1
abort: can only histedit a changeset together with all its descendants

Maybe it is because I have 1 merge (and 1 named branch). How can I edit
the first changeset then?

Thanks.

--
Do not eat animals; respect them as you respect people.
https://duckduckgo.com/?q=how+to+(become+OR+eat)+vegan


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to edit the first changeset in a repository that includes merges?

Boris Feld
Hello,

you can use the Evolve extension for this purpose.
https://www.mercurial-scm.org/doc/evolution/

The way I would do it is to amend the first changeset with evolve amend
command. https://www.mercurial-scm.org/doc/evolution/user-guide.html#ex
ample-3-amend-a-changeset-with-evolve

Don't forget to add your License file first!

That will create a new "version" of the first changetset with the
License.

You will have a message that says that you have now X oprhan
changesets. Don't worry, Evolve can stabilize your history for you
with:

hg evolve --all

The documentation for this part is here: https://www.mercurial-scm.org/
doc/evolution/user-guide.html#example-7-amend-an-older-changeset

As you only add a new file, you shouldn't have any merge conflict.
After this command has runned, you should have the wanted history.

Cheers,
Boris

On Mon, 2017-09-11 at 18:40 -0500, Mario Castelán Castro wrote:

> Hello.
>
> I have an unpublished project that will eventually be published with
> a
> free (as in freedom) license. When I started the project I did not
> have
> any intention to publish it and thus I did not add a license.
>
> I want to modify the first changeset (all others are descendant of
> this
> one) so that the license is added here, instead of in a later
> changeset,
> that way it will be clear that the license is valid starting from the
> very first version. The repository contains one named branch and one
> merge.
>
> I tried to do this with: “hg histedit 1”, but I get this message:
>
> $ hg histedit 1
> abort: can only histedit a changeset together with all its
> descendants
>
> Maybe it is because I have 1 merge (and 1 named branch). How can I
> edit
> the first changeset then?
>
> Thanks.
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: How to edit the first changeset in a repository that includes merges?

Mario Castelán Castro
On 14/09/17 07:05, Boris Feld wrote:
> Hello,
>
> you can use the Evolve extension for this purpose.
> https://www.mercurial-scm.org/doc/evolution/
>
> […]

Thanks you very much.

I had arrived at the same solution in the meantime (I assumed that
nobody would reply). Evolve works fine for this case. ☺

--
Do not eat animals; respect them as you respect people.
https://duckduckgo.com/?q=how+to+(become+OR+eat)+vegan


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

signature.asc (235 bytes) Download Attachment