Mercurial > hg
comparison tests/test-graft.t @ 24643:a8e6897dffbe
graft: allow creating sibling grafts
Previously it was impossible to graft a commit onto it's own parent (i.e. create
a copy of the commit). This is useful when wanting to create a backup of the
commit before continuing to amend it. This patch enables that behavior.
The change to the histedit test is because histedit uses graft to apply commits.
The test in question moves a commit backwards onto an ancestor. Since the graft
logic now more explicitly supports this, it knows to simply accept the incoming
changes (since they are more recent), instead of prompting.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sun, 05 Apr 2015 11:55:38 -0700 |
parents | a43fdf33a6be |
children | 51930a7180bd |
comparison
equal
deleted
inserted
replaced
24642:54e5c239c2d9 | 24643:a8e6897dffbe |
---|---|
728 $ hg tag -f something | 728 $ hg tag -f something |
729 $ hg graft -qr 27 | 729 $ hg graft -qr 27 |
730 $ hg graft -f 27 | 730 $ hg graft -f 27 |
731 grafting 27:3d35c4c79e5a "28" | 731 grafting 27:3d35c4c79e5a "28" |
732 note: graft of 27:3d35c4c79e5a created no changes to commit | 732 note: graft of 27:3d35c4c79e5a created no changes to commit |
733 | |
734 $ cd .. | |
735 | |
736 Graft to duplicate a commit | |
737 | |
738 $ hg init graftsibling | |
739 $ cd graftsibling | |
740 $ touch a | |
741 $ hg commit -qAm a | |
742 $ touch b | |
743 $ hg commit -qAm b | |
744 $ hg log -G -T '{rev}\n' | |
745 @ 1 | |
746 | | |
747 o 0 | |
748 | |
749 $ hg up -q 0 | |
750 $ hg graft -r 1 | |
751 grafting 1:0e067c57feba "b" (tip) | |
752 $ hg log -G -T '{rev}\n' | |
753 @ 2 | |
754 | | |
755 | o 1 | |
756 |/ | |
757 o 0 | |
758 |