1. Augie Fackler
  2. hg-git
  3. Issues
Issue #54 invalid

with option branch_bookmark_suffix set, pulling back from git doesn't move bookmarks along

Alexander Dahl
created an issue

I set

[git]
branch_bookmark_suffix=_bookmark

in .hg/hgrc and created some bookmarks with this naming convention on my named branches. Pushing to an empty Git repository works and creates the desired branches. After cloning the git repo with git, and pushing some changes I tried pulling from the first git repo on the Mercurial repository. Changes come in on branch »default« as expected and with the correct parent/child relations. However the bookmarks (with the suffixes) are not moved along, as they are if the option mentioned above is not set.

Comments (6)

  1. David M. Carr

    I've attached a test to attempt to demonstrate this behavior. I don't think I was able to reproduce what Alexander was seeing, though. When I run this test, I see the changes coming in on branch default, with both the correct parent/child relations and updating the bookmarks.

  2. André Felipe Dias

    I couldn't attach the file. So, I'm going to paste the diff here:

    --- /tmp/hg-git/tests/test-branch-bookmark-suffix.t
    +++ /tmp/hg-git/tests/test-branch-bookmark-suffix.t.err
    @@ -59,11 +59,13 @@
          user:        test
          date:        Mon Jan 01 00:00:10 2007 +0000
          summary:     add f1
    +  
    
       $ hg push ../gitrepo1
       pushing to ../gitrepo1
    -  exporting hg objects to git
       searching for changes
    +  adding objects
    +  added 2 commits with 2 trees and 2 blobs
       $ cd ..
    
       $ cd gitrepo1
    @@ -89,6 +91,20 @@
       $ git add f2
       $ commit -m "append f2"
       $ git push origin
    +  warning: push.default is unset; its implicit value is changing in
    +  Git 2.0 from 'matching' to 'simple'. To squelch this message
    +  and maintain the current behavior after the default changes, use:
    +  
    +    git config --global push.default matching
    +  
    +  To squelch this message and adopt the new behavior now, use:
    +  
    +    git config --global push.default simple
    +  
    +  See 'git help config' and search for 'push.default' for further information.
    +  (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
    +  'current' instead of 'simple' if you sometimes use older versions of Git)
    +  
       To $TESTTMP/gitrepo1
          bbfe79a..d8aef79  branch1 -> branch1
          288e92b..f8f8de5  branch2 -> branch2
    @@ -98,10 +114,10 @@
       $ hg pull ../gitrepo1
       pulling from ../gitrepo1
       importing git objects into hg
    +  creating bookmarks failed, do you have bookmarks enabled?
       (run 'hg heads' to see heads)
       $ hg log --graph
       o  changeset:   3:0a696ec0f478
    -  |  bookmark:    branch2_bookmark
       |  tag:         default/branch2
       |  tag:         tip
       |  parent:      1:600de9b6d498
    @@ -110,7 +126,6 @@
       |  summary:     append f2
       |
       | o  changeset:   2:49db35e15e81
    -  | |  bookmark:    branch1_bookmark
       | |  tag:         default/branch1
       | |  parent:      0:40a840c1f8ae
       | |  user:        test <test@example.org>
    @@ -119,14 +134,17 @@
       | |
       @ |  changeset:   1:600de9b6d498
       |/   branch:      branch2
    +  |    bookmark:    branch2_bookmark
       |    user:        test
       |    date:        Mon Jan 01 00:00:11 2007 +0000
       |    summary:     add f2
       |
       o  changeset:   0:40a840c1f8ae
          branch:      branch1
    +     bookmark:    branch1_bookmark
          user:        test
          date:        Mon Jan 01 00:00:10 2007 +0000
          summary:     add f1
    +  
    
  3. Log in to comment