MQ: strip - auto-search for branch head

Greg Ward greg-hg at gerg.ca
Tue Aug 4 09:10:18 CDT 2009


On Mon, Aug 3, 2009 at 8:09 PM, Guido Ostkamp<hg at ostkamp.fastmail.fm> wrote:
> On Mon, 3 Aug 2009, Greg Ward wrote:
>> Careful: as I understand it, "hg strip" is rather more destructive than
>> "git branch -D".
>
> Well, in both cases you can go back for a while. What's the difference then?

Yeah, on reflection you are correct: "hg strip" and "git branch -D"
are implemented very differently, but the level of danger and
recoverability is similar.

> You can already do it with 'hg strip <changeset>'. It is only very
> inconvenient as you need to lookup <changeset> by yourself.

I hadn't thought of this feature, but I have occasionally wished for a
"strip outgoing" feature.  That is, find the set of outgoing
changesets, find their common ancestors that are not ancestors of any
non-outgoing changesets, and strip 'em.  Use case: I commit a patch
and email it upstream.  It's accepted, but with a different changeset
ID (e.g. rebased, or tweaked upstream).  When I pull, I have two
copies of the changeset, only one of which is canonical.  So I want to
strip my original changeset.

I wonder if both of our wishes can be satisfied with one feature.  I think so.

Greg


More information about the Mercurial mailing list