Deletion of Named branches

View: New views
4 Messages — Rating Filter:   Alert me  

Deletion of Named branches

by Sean Kelley-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do you delete an obsolete named branch?

Repo A:  (two heads and two branches)

trunk
idea-2.x

I now want to get rid of idea-2.x.  How do I do that?  In scanning the
wiki and this mailing list I have seen the following suggestions:

(delete a branch and remove a head)

$ hg update -C tip # jump to one head
$ hg merge otherhead # merge in the other head
$ hg revert -a -r tip # undo all the changes from the merge
$ hg commit -m "eliminate other head" # create new tip identical to the old

(inactivate a branch and remove a head)

$ hg update -C activebranch
$ HGMERGE=true hg merge oldbranch
$ hg revert -a -r activebranch
$ hg commit -m 'Discard oldbranch'

(clone the trunk and in so doing lose the other branch)

hg clone -r branch old new


Any thoughts on how this is best handled?  It seems more complicated than GIT.

Sean
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Deletion of Named branches

by Dustin Sallings :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 6, 2008, at 12:38, Sean Kelley wrote:

> Any thoughts on how this is best handled?  It seems more complicated  
> than GIT.


        strip (part of mq) will remove the branch if you give it the  
changeset ID of the first changeset of the branch.

        If you could give it a branch name, it'd basically do what you want  
without having to think about it.  It doesn't take a branch name now,  
so you'd have to manually track down the first branched changeset.

        Do keep in mind, though, that any ancestry will be killed off.  If  
you merged that branch in, strip will remove that merge, and any  
children of that merge.  It will definitely remove any evidence that  
you've done that work.

--
Dustin Sallings



_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Deletion of Named branches

by Pazu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dustin Sallings <dustin <at> spy.net> writes:

> strip (part of mq) will remove the branch if you give it the  
> changeset ID of the first changeset of the branch.
>
> If you could give it a branch name, it'd basically do what you want  
> without having to think about it.  It doesn't take a branch name now,  
> so you'd have to manually track down the first branched changeset.
>
> Do keep in mind, though, that any ancestry will be killed off.  If  
> you merged that branch in, strip will remove that merge, and any  
> children of that merge.  It will definitely remove any evidence that  
> you've done that work.

Reviving an old thread: what if I don't want to lose any ancestry, or really
delete any commits -- I just want to get rid of the _name_. This way I can work
on multiple (potentially short lived) named branches without polluting the
namespace on a long term.

I know the standard answer for this is "use multiple repositories", but I was
wondering if I could somehow accomodate this in a single repository. Setting up
a new remote repository every couple days isn't my idea of fun, considering the
work that goes into it (compared to named branches, anyway).

-- Pazu

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Deletion of Named branches

by Martin Geisler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pazu <pazu@...> writes:

> Reviving an old thread: what if I don't want to lose any ancestry, or
> really delete any commits -- I just want to get rid of the _name_.
> This way I can work on multiple (potentially short lived) named
> branches without polluting the namespace on a long term.
>
> I know the standard answer for this is "use multiple repositories",
> but I was wondering if I could somehow accomodate this in a single
> repository. Setting up a new remote repository every couple days isn't
> my idea of fun, considering the work that goes into it (compared to
> named branches, anyway).
I have only tried it very briefly, but the LocalBranches extension (if
it still works with Mercurial 1.0) might be what you are looking for. It
allows you to work with branches that exist in your repository only.

  http://www.selenic.com/mercurial/wiki/index.cgi/LocalbranchExtension

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.


_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

attachment0 (194 bytes) Download Attachment