[Bug 4001] New: rebase discards graft information

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Jul 25 09:38:28 CDT 2013


          Priority: normal
            Bug ID: 4001
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: rebase discards graft information
          Severity: bug
    Classification: Unclassified
                OS: Windows
          Reporter: jahn at mentzdv.de
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.6.3
         Component: rebase
           Product: Mercurial

Created attachment 1735
  --> http://bz.selenic.com/attachment.cgi?id=1735&action=edit
Effect of a rebase operation on a grafted changeset.

When grafting a changeset (e.g. from a named branch to another), the new
changeset knows which changeset it was grafted from.

Unfortunately this information is lost if the new changeset is rebased.

How to reproduce (after enabling the rebase extension):

  cd %TEMP%
  mkdir test
  cd test
  hg init
  echo text1 > somefile
  hg add somefile
  hg commit -m "test file" somefile
  hg branch somebranch
  hg commit -m "new branch"
  echo text2 >> somefile
  hg commit -m "change in some branch" somefile
  hg update default
  hg graft 2
  hg log --rev tip --debug

This shows something similar to this (some fields omitted):

  changeset:   3:e100db7a7f25234bfeb8e78edc571b7437694c79
  parent:      0:8a3c90ce971b3318317f24cc115f5733a04f522c
  files:       somefile
  extra:       branch=default
  extra:       source=5051d1927bce4629c9a7fea4110ec8cc61a27d8c
  description: change in some branch

Now continue and finally rebase the grafted changeset:

  hg update 0
  echo text3 >> otherfile
  hg add otherfile
  hg commit -m "foreign change" otherfile
  hg rebase --source 3 --dest 4
  hg log --rev tip --debug

This shows something similar to this (some fields omitted):

  changeset:   4:8ee60d2748a790be9780b55793990fff7b77c095
  parent:      3:82a50dd41605c13550eac2c93d25857b98854fd4
  files:       somefile
  extra:       branch=default
  extra:       rebase_source=944cf8d6673af965cadb6a851e589097921e06be
  description: change in some branch

The information from which original changeset the grafted was created from is
lost. This makes it difficult at a later time to understand if a specific
changeset was already grafted or not.

I have attached a screenshot from TortoiseHg that shows the revision graph
before and after the rebase operation. The dotted line in the upper graph
indicates a graft relationship which is lost during a rebase operation.

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

More information about the Mercurial-devel mailing list