[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Merging code developed in a feature branch
From: |
Mike Miller |
Subject: |
Re: Merging code developed in a feature branch |
Date: |
Fri, 2 Dec 2016 10:38:46 -0800 |
User-agent: |
NeoMutt/20161104 (1.7.1) |
On Fri, Dec 02, 2016 at 11:23:58 +0000, Carlo De Falco wrote:
> Hi,
>
> I already asked this in an other thread, but I am here focusing on mercurial
> usage alone and CC-ing my favourite mercurial expert ;)
>
> I have been keeping up to date the code developed by two of the GSOC
> students by pushing it on two branches here:
>
> https://bitbucket.org/cdf1/octave/branch/dorigo
> https://bitbucket.org/cdf1/octave/branch/ode15i
>
> Assuming that I want to push this to savannah (possibly without
> creating to extra branches there), what would be the best approach?
> Would it work if I merge the two feature branches [*] into default
> on bitbucket then do
>
> hg push -b default
>
> to savannah? Or should I create patches via
>
> hg diff -r ode15i:default
>
> and
>
> hg diff -r ode15i:dorigo
>
> and import them then push?
> Or should I just merge and push thus creating two new branches (but no new
> head)?
>
> Of course I know I should have been using bookmarks rather than branches, but
> I haven't ...
If you want to keep the original history as it is, but just remove the
fact that they were developed on a named branch, I think you could use
the `hg graft` [1] command.
I think you could choose to graft the series onto either the current
default branch head (like a rebase, but giving up the original feature
branch name), or onto the previous revision where the work started
(converting the branch into a new head/bookmark on default) and merge
that into the head.
[1]: https://www.mercurial-scm.org/repo/hg/help/graft
--
mike