hg-git: push -d default seems not to work.

Benjamin Fritz fritzophrenic at gmail.com
Fri May 5 16:34:23 UTC 2017


On Fri, May 5, 2017 at 5:10 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
>
>
> What I am most interested is in the graph. That is I would like to have
> a graph like this (after a merge from a named branch into (default/master)
>
> @    changeset:   7058:b017880d8552
> |\   tag:         tip
> | |  parent:      7057:41a79851cd40
> | |  parent:      7056:a740234025f0
> | |  user:        Uwe Brauer <oub at mat.ucm.es>
> | |  date:        Fri May 05 10:07:23 2017 +0000
> | |  summary:     Add the select environment and related macros to exam
style.
> | |
> | o  changeset:   7057:41a79851cd40
> | |  bookmark:    master
> | |  parent:      7055:d40e9bf06c53
> | |  user:        Tassilo Horn <tsdh at gnu.org>
> | |  date:        Sun Apr 23 08:42:45 2017 +0200
> | |  summary:     Fix comment environment highlighting
> | |
> o |  changeset:   7056:a740234025f0
> |/   branch:      exam
> |    user:        Uwe Brauer <oub at mat.ucm.es>
> |    date:        Sat Apr 22 20:44:41 2017 +0000
> |    summary:     Add the select environment and related macros.
> |
> o  changeset:   7055:d40e9bf06c53
> |  user:        Ikumi Keita <ikumi at ikumi.que.jp>
> |  date:        Sat Apr 22 02:03:33 2017 +0900
> |  summary:     Add test for my last commit
>
> So I would like to push  changeset 7058:b017880d8552 without its
> ancestors. It seems that the mq extension can do that, but how would the
> corresponding graph look like? Most like the changesets on the named
> branch would not be shown? or simply there would be no named branch but
> the queue? How does a graph look in general if you use mq?
>


You CANNOT push a changeset without its ancestors. It's impossible no
matter which extension you are using. A commit's ID depends on the ID(s) of
its parent(s) so any parent(s) must be included when you push. You have a
few options:

1. Don't merge at all. You made a mistake by using a named branch instead
of a bookmark, to use this option. Normally (especially when working with
git repos) you'd just create a new head, or at most create a new bookmark,
instead of a using a named branch for small changes like this. Named
branches are *permanent*, and git doesn't have a similar concept unless it
was recently introduced.
2. Use "graft" instead of a merge (if you want to keep your branch locally
for some reason).
3. Use "rebase".

As a last resort you can use mq, but really "rebase" is all you need in
your scenario and mq is overkill.

All mq really does is undo/redo a set of commits, re-order commits, and/or
move them between branches. You can do that more easily without resorting
to mq as noted in the wiki text you quoted earlier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20170505/797787c5/attachment-0002.html>


More information about the Mercurial mailing list