[Bug 5172] New: hg pull -u or hg update without arguments may move bookmarks to the tip

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Sat Apr 2 09:50:01 UTC 2016


https://bz.mercurial-scm.org/show_bug.cgi?id=5172

            Bug ID: 5172
           Summary: hg pull -u or hg update without arguments may move
                    bookmarks to the tip
           Product: Mercurial
           Version: 3.7.3
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: bookmarks
          Assignee: bugzilla at selenic.com
          Reporter: demelier.david at gmail.com
                CC: mercurial-devel at selenic.com

Hi,

Your local repository has a bookmark (let say @) pointing on revision 1, it's
also the same in the other remote repository.

You pull from the remote repository which has 3 revisions with hg pull -u, the
bookmark @ get magically updated to the tip while it was also pointing to the
revision 1 on the remote.

I think this is counter intuitive as the remote @ bookmark was also on revision
1 and it get updated by hg update comment. I think hg pull -u or hg update with
no arguments should never move bookmarks.

Steps to reproduce:

markand at Melon /tmp $ hg init repo1
markand at Melon /tmp $ cd repo1
markand at Melon [hg repo1] (default) {} $ touch index ; hg add index
markand at Melon [hg repo1] (default) {} $ hg ci -m "added index"
markand at Melon [hg repo1] (default) {} $ hg book @
markand at Melon [hg repo1] (default) {@*} $ cd ..
markand at Melon /tmp $ hg clone repo1 repo2
updating to bookmark @
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
markand at Melon /tmp $ cd repo2
markand at Melon [hg repo2] (default) {@*} $ hg book some-feature
markand at Melon [hg repo2] (default) {some-feature*, @} $ echo "test" > index ;
hg ci -m "updated index"
markand at Melon [hg repo2] (default) {some-feature*} $ cd ../repo1
markand at Melon [hg repo1] (default) {@*} $ hg pull -u ../repo2
pulling from ../repo2
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
adding remote bookmark some-feature
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
updating bookmark @
markand at Melon [hg repo1] (default) {@*, some-feature} $ hg glog
@  changeset:   1:5f6f6face93e
|  bookmark:    @
|  bookmark:    some-feature
|  tag:         tip
|  user:        David Demelier <markand at malikania.fr>
|  date:        Sat Apr 02 11:46:06 2016 +0200
|  summary:     updated index
|
o  changeset:   0:745957b1a57c
   user:        David Demelier <markand at malikania.fr>
   date:        Sat Apr 02 11:45:39 2016 +0200
   summary:     added index

markand at Melon [hg repo1] (default) {@*, some-feature} $

And in the other repository :

markand at Melon [hg repo1] (default) {@*, some-feature} $ cd ../repo2
markand at Melon [hg repo2] (default) {some-feature*} $ hg glog 
@  changeset:   1:5f6f6face93e
|  bookmark:    some-feature
|  tag:         tip
|  user:        David Demelier <markand at malikania.fr>
|  date:        Sat Apr 02 11:46:06 2016 +0200
|  summary:     updated index
|
o  changeset:   0:745957b1a57c
   bookmark:    @
   user:        David Demelier <markand at malikania.fr>
   date:        Sat Apr 02 11:45:39 2016 +0200
   summary:     added index

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list