1.0 approaches

Jesse Glick jesse.glick at sun.com
Fri Feb 8 11:56:41 CST 2008


Peter Arrenbrecht wrote:
> you cannot simply drop failed experiments [in named branches] without
> having to rewrite history, as you can with true clones.

As I understand it, there is no need to rewrite history - assuming you 
never merged the failed branch - you just need to discard the changesets 
in the branch (leading up to the branch's head).

If the branch was only ever used in a local repo, then you can just use 
hg strip.

If it has been pushed to others, then you could "cap" the branch by 
doing a fake merge to default, removing it as an active head; though 
this does not remove the branch's changesets and in fact makes it 
impossible to remove them later.

There was a discussion some time ago about hypothetical enhancements to 
Hg to allow propagation of stripping of changesets to other repositories 
automatically, which would be useful here: you could somehow mark a 
branch's changesets as "to be discarded" and they would be deleted from 
anyone pulling from you unless they had configured their local repo to 
work in "archival" mode.

Or you could allow some "junk" branches to accumulate for a few years, 
then make a fresh repo using clone -r that includes only the default 
branch (plus any branches that were ever merged into default), and ask 
people to switch to using clones of that repo.



More information about the Mercurial mailing list