Help, how did Mozilla do this?

Martin Geisler martin at geisler.net
Wed Apr 10 23:07:05 UTC 2013


Johnny P <jpywtora at gmail.com> writes:

> Ref: http://hg.mozilla.org/integration/gaia/graph
>
> In the picture below I found Mozilla's mercurial repository graph with a
> situation that I thought was not possible. They have two commits that have
> the same parent where one is a merge. I have wanted to do this, but cannot
> find an answer on how to, can anyone help?
>
>     @ merge pull request from foo polish text
>     |\
>     | o bug 1 - add text ...
>     |/
>     o merge pull request from bar bug 2
>
> How did they get this to occur? Usually when you pull changes in that
> add onto the head, if you attempt to merge you get "nothing to merge".

If you really want, you can create such a merge with 'hg
debugsetparents':

  $ hg init repo
  $ cd repo
  $ echo a > a.txt
  $ hg add
  adding a.txt
  $ hg commit -m a
  $ echo b > a.txt
  $ hg commit -m b
  $ hg debugsetparents 0 1
  $ hg commit -m '"nothing to merge"-merge'
  $ hg glog
  @    changeset:   2:7981d4a1e426
  |\   tag:         tip
  | |  parent:      0:8529b0cd30c2
  | |  parent:      1:415b9c5f4a2c
  | |  user:        Martin Geisler <martin at geisler.net>
  | |  date:        Thu Apr 11 01:03:57 2013 +0200
  | |  summary:     "nothing to merge"-merge
  | |
  | o  changeset:   1:415b9c5f4a2c
  |/   user:        Martin Geisler <martin at geisler.net>
  |    date:        Thu Apr 11 01:03:31 2013 +0200
  |    summary:     b
  |
  o  changeset:   0:8529b0cd30c2
     user:        Martin Geisler <martin at geisler.net>
     date:        Thu Apr 11 01:03:24 2013 +0200
     summary:     a

This corresponds to 'git merge --no-ff', which is sometimes used when
people want to ensure that changes on a feature branch remain "grouped"
after a merge.

-- 
Martin Geisler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20130411/ae198ad3/attachment.asc>


More information about the Mercurial mailing list