[Bug 5898] New: 'hg rebase -k' messes with bookmarks

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Sat May 26 21:59:46 UTC 2018


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

            Bug ID: 5898
           Summary: 'hg rebase -k' messes with bookmarks
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Other
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: jeffpc at josefsipek.net
                CC: mercurial-devel at mercurial-scm.org

Rebasing with the -k flags to keep the original commits moves any bookmarks
pointing to source commits to the new commits.  This seems counter-intuitive.

Actual use-case to justify -k not changing bookmarks:

I have a repo with hggit, and there are two bookmarks - master & core-2.2. I
want to backport a fix from master to 2.2, as far as I can tell, the best way
to "cherry-pick" the commits is to 'hg rebase -k'.

And here's an example to illustrate the current behavior, suppose I have a repo
with two bookmarks: foo and bar.  Neither bookmark is active.  I think that foo
should stay at b5 and not move to 77:

$ hg log -G
@  commit b5acb86dbff5771fc04e1dbc7ca7b24369bc637c tip foo
|  Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
|  Date:   Fri May 25 09:41:08 2018 -0400
|
|      ghi
|
o  commit b1235d09915ceadcd499b263b64008edd9913dac
|  Parent: 0:2a82efe1a42e
|  Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
|  Date:   Fri May 25 09:40:50 2018 -0400
|
|      def
|
| o  commit 74672a98bde0726a231bc35f0cece01117ef395a bar
|/   Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
|    Date:   Fri May 25 09:40:33 2018 -0400
|
|        abc
|
o  commit 2a82efe1a42e5666cfb5d95b4bb08deb1e0aaaa9
   Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
   Date:   Fri May 25 09:40:18 2018 -0400

       initial

$ hg rebase -k -s . -d 74
rebasing 3:b5acb86dbff5 "ghi" (foo tip)
$ hg log -G   
@  commit 772bbc7c4534e985bbece8a3ecdcf6d527e560d7 tip foo
|  Parent: 1:74672a98bde0
|  Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
|  Date:   Fri May 25 09:41:08 2018 -0400
|
|      ghi
|
| o  commit b5acb86dbff5771fc04e1dbc7ca7b24369bc637c
| |  Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
| |  Date:   Fri May 25 09:41:08 2018 -0400
| |
| |      ghi
| |
| o  commit b1235d09915ceadcd499b263b64008edd9913dac
| |  Parent: 0:2a82efe1a42e
| |  Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
| |  Date:   Fri May 25 09:40:50 2018 -0400
| |
| |      def
| |
o |  commit 74672a98bde0726a231bc35f0cece01117ef395a bar
|/   Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
|    Date:   Fri May 25 09:40:33 2018 -0400
|
|        abc
|
o  commit 2a82efe1a42e5666cfb5d95b4bb08deb1e0aaaa9
   Author: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
   Date:   Fri May 25 09:40:18 2018 -0400

       initial

$ hg version -v
Mercurial Distributed SCM (version 4.5.2+1462-0a1fb171dc1d)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2018 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Enabled extensions:

  hgk        internal  
  graphlog   internal  
  purge      internal  
  gpg        internal  
  churn      internal  
  pager      internal  
  shelve     internal  
  histedit   internal  
  rebase     internal  
  patchbomb  internal  
  githelp    internal  
  evolve     external  8.0.0.dev
  topic      external  0.9.0.dev

On IRC, pulkit pointed out that this seems to be documented behavior:

https://www.mercurial-scm.org/repo/hg-committed/file/tip/hgext/rebase.py#l1683

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


More information about the Mercurial-devel mailing list