octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adapting changesets without starting over


From: Jordi Gutiérrez Hermoso
Subject: Re: adapting changesets without starting over
Date: Sat, 27 Aug 2011 11:17:02 -0500

On 27 August 2011 10:49, Ben Abbott <address@hidden> wrote:
> On Aug 27, 2011, at 4:58 AM, Carlo de Falco wrote:
>
>> I had prepared the following patches before the policy for
>> changelogs was modified
>>
>> https://savannah.gnu.org/patch/?7482
>> https://savannah.gnu.org/patch/?7483
>> https://savannah.gnu.org/patch/?7484
>>
>> can someone suggest the correct procedure to adapt them to the new
>> system without starting over with the changes and keeping each as a
>> single changeset?

> I edited the first changeset to remove the diff for the Changelog
> and moved its comments in to the commit log. The top 23 lines are
> below. The resulting changeset imported without error.

This is probably ok, although it won't import if you do "hg import
--exact", because the hashes are wrong (older versions of hg did
--exact by default). I like to always do exact imports, because they
attach the changeset at the revision the originator intended them to
go at. However, in this case, it probably makes more sense to rebase
the patches and edit them slightly.

The usual way to rebase and edit patches in hg is with the Mercurial
queues extension, for which I recommend this chapter in the hg book:

    http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html

Note that there is also a rebase extension that automates this a
little, although I personally still prefer to use mq. Also, BE
CAREFUL. The mq extension is disabled by default according to hg
philosophy because it's potentially dangerous, because it can edit
history and patches, and therefore can destroy data in some
situations. Don't run any mq command without understanding what it
does, and if you're not sure, work in a clone where you've backed up
you work.

After trying to scare you,[1] I recommend this, with a recent clone
from Savannah:

    hg qimport *.changeset  ##Puts Carlo's patches under mq control

    hg qpush                ## Oops, patch doesn't apply because of
                            ## the Changelog.

    hg qrefresh -e          ## $EDITOR opens for the commit message,
                            ## put in the commit message whatever was
                            ## in the Changelog; save and quit.

    hg qpush                ## Next patch in series also doesn't
                            ## apply.

    hg qrefresh -e          ## Fix it again.

    hg qpush || hg qrefresh -e  ##And one more time.

    hg qfinish -a           ## Turn all applied patches into ordinary
                            ## csets.

    hg outgoing             ## Verify what patches will get pushed to
                            ## Savannah.

    hg push                 ## Push the patches.

Notice that each time the patch fails to apply, you will get little
.rej files so you can inspect which hunks of the diff didn't apply. In
this case, they were all about ChangeLogs.

HTH,
- Jordi G. H.

[1] ;-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]