linear history two bookmarks only fast forward, but not in git

Uwe Brauer oub at mat.ucm.es
Thu Nov 14 10:59:50 UTC 2019


Hi 

This is a bit absurd.
Consider the following script 

hg init
echo "First" > test.org
hg add test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "First"
hg book master
echo "Second" >> test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Second"
echo "Third" >> test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Third"
hg book feature
echo "Forth" >> test.org
hg commit  -m "Fourth"
echo "Fifth" >> test.org
hg commit  -m "Fifth"
echo "Six" >> test.org
hg commit  -m "Six"
hg log -G

The graph looks like 

@  changeset:   5:0a994b5c1f24
|  bookmark:    feature
|  tag:         tip
|  user:        Uwe Brauer <oub at mat.ucm.es>
|  date:        Thu Nov 14 11:51:45 2019 +0100
|  summary:     Six
|
o  changeset:   4:71ec83059439
|  user:        Uwe Brauer <oub at mat.ucm.es>
|  date:        Thu Nov 14 11:51:44 2019 +0100
|  summary:     Fifth
|
o  changeset:   3:32393bfa7ac2
|  user:        Uwe Brauer <oub at mat.ucm.es>
|  date:        Thu Nov 14 11:51:44 2019 +0100
|  summary:     Fourth
|
o  changeset:   2:c3b403573e29
|  bookmark:    master
|  user:        Bernhard Riemann <bernhard.riemann at gmail.com>
|  date:        Thu Nov 14 11:51:44 2019 +0100
|  summary:     Third

I cannot merge the feature branch into a master, I can only do a fast
forward.

  hg up master
  hg merge feature 

returns:

abort: nothing to merge


Well there is only ONE head, nor surprise.


Now I push this repository (using hg-git) to an empty git repository

And run in that pushed git repository

  git merge --no-ff feature

Then I change back into the mercurial repository and run

  hg pull -u

And voila the branches are merged.

@    changeset:   6:3f6e10ac3dd1
|\   bookmark:    feature
| |  bookmark:    master
| |  tag:         default/master
| |  tag:         tip
| |  parent:      2:bafb2e37c7f8
| |  parent:      5:e3c7d0ba27c0
| |  user:        Uwe Brauer <oub at mat.ucm.es>
| |  date:        Thu Nov 14 11:58:42 2019 +0100
| |  summary:     Merge branch 'feature'
| |
| o  changeset:   5:e3c7d0ba27c0
| |  tag:         default/feature
| |  user:        Uwe Brauer <oub at mat.ucm.es>
| |  date:        Thu Nov 14 11:57:35 2019 +0100
| |  summary:     Six
| |
| o  changeset:   4:606afa729cef
| |  user:        Uwe Brauer <oub at mat.ucm.es>
| |  date:        Thu Nov 14 11:57:34 2019 +0100
| |  summary:     Fifth
| |
| o  changeset:   3:6f2b2870446d
|/   user:        Uwe Brauer <oub at mat.ucm.es>
|    date:        Thu Nov 14 11:57:34 2019 +0100
|    summary:     Fourth


The question is, could such a behavior me somehow implemented, maybe as
an extension?

Regards


Uwe Brauer 





More information about the Mercurial mailing list