Changing the tip
Romain Pelisse
belaran at gmail.com
Thu Oct 22 16:46:55 UTC 2009
Hi,
Most of yours solutions will work perfectly "locally" but what will happen
when I push to the remote (and shared) server that has the extra 5 commits
that I want to "leave behind" (i do not require to actually delete from the
repository thoses commits, i just need them to become part of a "dead head"
- and switch tip to another head.
By 'tip', what I am aiming at is that afterward any people clone/pull from
this remote repositories will get all the commits, but their working
directory will contain my new head, not the "dead one".
(I hope I still make sense here).
2009/10/22 Adrian Buehlmann <adrian at cadifra.com>
> On 22.10.2009 17:40, Isaac Jurado wrote:
> > Replying Romain Pelisse:
> >> I want simply to go back the commit (N-5) and start from there,
> >> forgetting that the commit between N-4 and N include has ever
> >> existed...
> >
> > If I understand correctly, you are looking for the obvious:
> >
> > hg clone -r N-5 source_repo new_clean_repo
> >
> > Of course, you need to know what the N-5 revision is (by using "hg log"
> > for example).
> >
> > I don't really know why this hasn't been mentioned at all. Maybe I'm
> > wrong.
> >
>
> You are right, provided there are no other heads in the
> repo, which would be omitted when using -r, unless you
> specify each head you want to keep with a separate -r.
>
> hg clone -r keep1 -r keep2 -r keep3 oldrepo newrepo
>
> And provided the unwanted revisions have not yet been
> published (i.e. pushed) anywhere ("the ship has not sailed
> yet").
>
> Side note:
>
> I'm wondering if we should add a -P/--prune option to clone
> (analogous to the one in 'hg log') for completeness sake.
>
> This could be used as
>
> hg clone --prune first-unwanted-revision oldrepo newrepo
>
> This would somewhat correspond to
>
> hg strip first-unwanted-revision
>
> from the mq extension
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
--
Romain PELISSE,
"The trouble with having an open mind, of course, is that people will insist
on coming along and trying to put things in it" -- Terry Pratchett
http://belaran.eu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20091022/412dfaab/attachment-0001.html>
More information about the Mercurial
mailing list