2019-05-28 13:12:27 +03:00
|
|
|
$ setconfig extensions.treemanifest=!
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> rebase=
|
|
|
|
>
|
2011-12-27 03:11:22 +04:00
|
|
|
> [phases]
|
|
|
|
> publish=False
|
2018-10-27 04:52:14 +03:00
|
|
|
>
|
|
|
|
> [alias]
|
|
|
|
> tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
|
2010-10-01 18:10:06 +04:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
|
|
|
|
$ hg init a
|
|
|
|
$ cd a
|
2012-04-03 21:06:35 +04:00
|
|
|
$ hg unbundle "$TESTDIR/bundles/rebase.hg"
|
2011-04-30 19:38:06 +04:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 8 changesets with 7 changes to 7 files (+2 heads)
|
2017-10-12 10:39:50 +03:00
|
|
|
new changesets cd010b8cd998:02de42196ebe
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg up tip
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ echo I > I
|
|
|
|
$ hg ci -AmI
|
|
|
|
adding I
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2017-12-11 08:57:37 +03:00
|
|
|
@ 8: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
o 7: 02de42196ebe 'H'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 6: eea13746799a 'G'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/|
|
2017-12-11 08:57:37 +03:00
|
|
|
o | 5: 24b6387c8c8c 'F'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 4: 9520eea781bc 'E'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 3: 32af7686d403 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 2: 5fddd98957c8 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 1: 42ccdea3bb16 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
Version with only two heads (to allow default destination to work)
|
|
|
|
|
|
|
|
$ hg clone -q -u . a a2heads -r 3 -r 8
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
These fail:
|
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ hg clone -q -u . a a0
|
|
|
|
$ cd a0
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg rebase -s 8 -d 7
|
2011-10-15 21:07:51 +04:00
|
|
|
nothing to rebase
|
2011-04-30 19:38:06 +04:00
|
|
|
|
2010-10-01 18:10:06 +04:00
|
|
|
$ hg rebase --continue --abort
|
|
|
|
abort: cannot use both abort and continue
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg rebase --continue --collapse
|
|
|
|
abort: cannot use collapse with continue or abort
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg rebase --continue --dest 4
|
|
|
|
abort: abort and continue do not allow specifying revisions
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg rebase --base 5 --source 4
|
2011-10-15 22:12:32 +04:00
|
|
|
abort: cannot specify both a source and a base
|
2010-10-01 18:10:06 +04:00
|
|
|
[255]
|
|
|
|
|
2012-04-29 18:18:46 +04:00
|
|
|
$ hg rebase --rev 5 --source 4
|
|
|
|
abort: cannot specify both a revision and a source
|
|
|
|
[255]
|
|
|
|
$ hg rebase --base 5 --rev 4
|
|
|
|
abort: cannot specify both a revision and a base
|
|
|
|
[255]
|
|
|
|
|
2016-02-08 16:07:17 +03:00
|
|
|
$ hg rebase --base 6
|
|
|
|
abort: branch 'default' has 3 heads - please rebase to an explicit rev
|
|
|
|
(run 'hg heads .' to see heads)
|
|
|
|
[255]
|
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --rev '1 & !1' --dest 8
|
2014-04-23 15:51:35 +04:00
|
|
|
empty "rev" revision set - nothing to rebase
|
2013-11-17 00:46:29 +04:00
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --source '1 & !1' --dest 8
|
2014-05-01 18:47:50 +04:00
|
|
|
empty "source" revision set - nothing to rebase
|
2013-11-18 03:21:58 +04:00
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --base '1 & !1' --dest 8
|
2014-05-01 18:47:50 +04:00
|
|
|
empty "base" revision set - can't compute rebase set
|
2013-11-18 03:21:58 +04:00
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --dest 8
|
2013-11-18 03:21:58 +04:00
|
|
|
nothing to rebase - working directory parent is also destination
|
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase -b . --dest 8
|
2013-11-18 03:21:58 +04:00
|
|
|
nothing to rebase - e7ec4e813ba6 is both "base" and destination
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg up -q 7
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --dest 8 --traceback
|
2013-11-18 03:21:58 +04:00
|
|
|
nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6
|
|
|
|
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase --dest 8 -b.
|
2013-11-18 03:21:58 +04:00
|
|
|
nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2013-11-18 03:21:58 +04:00
|
|
|
$ hg rebase --dest '1 & !1'
|
|
|
|
abort: empty revision set
|
|
|
|
[255]
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
These work:
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Rebase with no arguments (from 3 onto 8):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ cd ..
|
|
|
|
$ hg clone -q -u . a2heads a1
|
|
|
|
$ cd a1
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg up -q -C 3
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg rebase
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 9: ed65089c18f8 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: 7621bf1a2f17 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 9430a62369c6 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 6: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 5: 02de42196ebe 'H'
|
2016-02-08 16:02:53 +03:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 4: 24b6387c8c8c 'F'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
Try to rollback after a rebase (fail):
|
|
|
|
|
|
|
|
$ hg rollback
|
|
|
|
no rollback information available
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Rebase with base == '.' => same as no arguments (from 3 onto 8):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ hg clone -q -u 3 a2heads a2
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cd a2
|
|
|
|
|
|
|
|
$ hg rebase --base .
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 9: ed65089c18f8 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: 7621bf1a2f17 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 9430a62369c6 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 6: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 5: 02de42196ebe 'H'
|
2016-02-08 16:02:53 +03:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 4: 24b6387c8c8c 'F'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2012-05-01 12:14:35 +04:00
|
|
|
Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg clone -q -u 3 a a3
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cd a3
|
|
|
|
|
2012-05-01 12:14:35 +04:00
|
|
|
$ hg rebase --dest 'branch(.)'
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 11: ed65089c18f8 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 10: 7621bf1a2f17 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 9: 9430a62369c6 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 02de42196ebe 'H'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 6: eea13746799a 'G'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/|
|
2018-10-27 04:52:14 +03:00
|
|
|
o | 5: 24b6387c8c8c 'F'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 4: 9520eea781bc 'E'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Specify only source (from 2 onto 8):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ hg clone -q -u . a2heads a4
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cd a4
|
|
|
|
|
2012-04-29 18:18:46 +04:00
|
|
|
$ hg rebase --source 'desc("C")'
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: 7726e9fd58f7 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 72c8333623d0 'C'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 6: e7ec4e813ba6 'I'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 5: 02de42196ebe 'H'
|
2016-02-08 16:02:53 +03:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 4: 24b6387c8c8c 'F'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 1: 42ccdea3bb16 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
Specify only dest (from 3 onto 6):
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg clone -q -u 3 a a5
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cd a5
|
|
|
|
|
|
|
|
$ hg rebase --dest 6
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 11: 8eeb3c33ad33 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 10: 2327fea05063 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 9: e4e5be0395b2 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 8: e7ec4e813ba6 'I'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 7: 02de42196ebe 'H'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
o | 6: eea13746799a 'G'
|
2011-04-30 19:38:06 +04:00
|
|
|
|\|
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 5: 24b6387c8c8c 'F'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
o | 4: 9520eea781bc 'E'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Specify only base (from 1 onto 8):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ hg clone -q -u . a2heads a6
|
2010-10-01 18:10:06 +04:00
|
|
|
$ cd a6
|
|
|
|
|
2012-04-29 18:18:46 +04:00
|
|
|
$ hg rebase --base 'desc("D")'
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
o 9: ed65089c18f8 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: 7621bf1a2f17 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 9430a62369c6 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 6: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 5: 02de42196ebe 'H'
|
2016-02-08 16:02:53 +03:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 4: 24b6387c8c8c 'F'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Specify source and dest (from 2 onto 7):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg clone -q -u . a a7
|
|
|
|
$ cd a7
|
|
|
|
|
2012-06-20 22:08:57 +04:00
|
|
|
$ hg rebase --source 2 --dest 7
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
o 10: 668acadedd30 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 9: 09eb682ba906 'C'
|
2011-04-30 19:38:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| @ 8: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 02de42196ebe 'H'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 6: eea13746799a 'G'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/|
|
2018-10-27 04:52:14 +03:00
|
|
|
o | 5: 24b6387c8c8c 'F'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 4: 9520eea781bc 'E'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 1: 42ccdea3bb16 'B'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
Specify base and dest (from 1 onto 7):
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg clone -q -u . a a8
|
|
|
|
$ cd a8
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg rebase --base 3 --dest 7
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:42ccdea3bb16 "B"
|
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
o 11: 287cc92ba5a4 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 10: 6824f610a250 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 9: 7c6027df6a99 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| @ 8: e7ec4e813ba6 'I'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 02de42196ebe 'H'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 6: eea13746799a 'G'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/|
|
2018-10-27 04:52:14 +03:00
|
|
|
o | 5: 24b6387c8c8c 'F'
|
2011-04-30 19:38:06 +04:00
|
|
|
| |
|
2018-10-27 04:52:14 +03:00
|
|
|
| o 4: 9520eea781bc 'E'
|
2011-04-30 19:38:06 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2012-04-29 18:18:46 +04:00
|
|
|
|
|
|
|
Specify only revs (from 2 onto 8)
|
|
|
|
|
2016-02-08 16:02:53 +03:00
|
|
|
$ hg clone -q -u . a2heads a9
|
2012-04-29 18:18:46 +04:00
|
|
|
$ cd a9
|
|
|
|
|
|
|
|
$ hg rebase --rev 'desc("C")::'
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:5fddd98957c8 "C"
|
|
|
|
rebasing 3:32af7686d403 "D"
|
2012-04-29 18:18:46 +04:00
|
|
|
|
2018-08-16 20:37:29 +03:00
|
|
|
$ tglog
|
2018-10-27 04:52:14 +03:00
|
|
|
o 8: 7726e9fd58f7 'D'
|
2012-04-29 18:18:46 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 7: 72c8333623d0 'C'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
@ 6: e7ec4e813ba6 'I'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 5: 02de42196ebe 'H'
|
2016-02-08 16:02:53 +03:00
|
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
o 4: 24b6387c8c8c 'F'
|
2012-06-20 22:08:57 +04:00
|
|
|
|
|
2017-12-11 08:57:37 +03:00
|
|
|
| o 1: 42ccdea3bb16 'B'
|
2012-04-29 18:18:46 +04:00
|
|
|
|/
|
2017-12-11 08:57:37 +03:00
|
|
|
o 0: cd010b8cd998 'A'
|
2012-04-29 18:18:46 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2016-02-01 18:41:43 +03:00
|
|
|
Rebasing both a single revision and a merge in one command
|
|
|
|
|
|
|
|
$ hg clone -q -u . a aX
|
|
|
|
$ cd aX
|
2016-02-08 16:03:45 +03:00
|
|
|
$ hg rebase -r 3 -r 6 --dest 8
|
2016-02-01 18:41:43 +03:00
|
|
|
rebasing 3:32af7686d403 "D"
|
|
|
|
rebasing 6:eea13746799a "G"
|
|
|
|
$ cd ..
|
|
|
|
|
2011-04-02 13:07:05 +04:00
|
|
|
Test --tool parameter:
|
|
|
|
|
|
|
|
$ hg init b
|
|
|
|
$ cd b
|
|
|
|
|
|
|
|
$ echo c1 > c1
|
|
|
|
$ hg ci -Am c1
|
|
|
|
adding c1
|
|
|
|
|
|
|
|
$ echo c2 > c2
|
|
|
|
$ hg ci -Am c2
|
|
|
|
adding c2
|
|
|
|
|
|
|
|
$ hg up -q 0
|
|
|
|
$ echo c2b > c2
|
|
|
|
$ hg ci -Am c2b
|
|
|
|
adding c2
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone -q -u . b b1
|
|
|
|
$ cd b1
|
|
|
|
|
|
|
|
$ hg rebase -s 2 -d 1 --tool internal:local
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:e4e3f3546619 "c2b" (tip)
|
2014-12-10 08:20:35 +03:00
|
|
|
note: rebase of 2:e4e3f3546619 created no changes to commit
|
2011-04-02 13:07:05 +04:00
|
|
|
|
|
|
|
$ hg cat c2
|
|
|
|
c2
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
$ hg clone -q -u . b b2
|
|
|
|
$ cd b2
|
|
|
|
|
|
|
|
$ hg rebase -s 2 -d 1 --tool internal:other
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:e4e3f3546619 "c2b" (tip)
|
2011-04-02 13:07:05 +04:00
|
|
|
|
|
|
|
$ hg cat c2
|
|
|
|
c2b
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
$ hg clone -q -u . b b3
|
|
|
|
$ cd b3
|
|
|
|
|
|
|
|
$ hg rebase -s 2 -d 1 --tool internal:fail
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:e4e3f3546619 "c2b" (tip)
|
2013-02-09 02:27:59 +04:00
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
2013-02-09 02:17:46 +04:00
|
|
|
[1]
|
2011-04-02 13:07:05 +04:00
|
|
|
|
2013-05-14 22:23:17 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 1:56daeba07f4b
|
|
|
|
c2
|
|
|
|
parent: 2:e4e3f3546619 tip
|
|
|
|
c2b
|
|
|
|
commit: 1 modified, 1 unresolved (merge)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2013-05-14 22:23:17 +04:00
|
|
|
rebase: 0 rebased, 1 remaining (rebase --continue)
|
2013-05-14 22:23:17 +04:00
|
|
|
|
2011-04-02 13:07:05 +04:00
|
|
|
$ hg resolve -l
|
|
|
|
U c2
|
|
|
|
|
|
|
|
$ hg resolve -m c2
|
2014-07-26 05:32:49 +04:00
|
|
|
(no more unresolved files)
|
2015-12-24 23:41:40 +03:00
|
|
|
continue: hg rebase --continue
|
2016-02-04 06:46:38 +03:00
|
|
|
$ hg graft --continue
|
|
|
|
abort: no graft in progress
|
|
|
|
(continue: hg rebase --continue)
|
|
|
|
[255]
|
2011-04-02 13:07:05 +04:00
|
|
|
$ hg rebase -c --tool internal:fail
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 2:e4e3f3546619 "c2b" (tip)
|
2014-12-10 08:20:35 +03:00
|
|
|
note: rebase of 2:e4e3f3546619 created no changes to commit
|
2011-04-02 13:07:05 +04:00
|
|
|
|
2014-09-01 13:48:55 +04:00
|
|
|
$ hg rebase -i
|
2015-10-06 22:07:00 +03:00
|
|
|
abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit")
|
2014-09-01 13:48:55 +04:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg rebase --interactive
|
2015-10-06 22:07:00 +03:00
|
|
|
abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit")
|
2014-09-01 13:48:55 +04:00
|
|
|
[255]
|
|
|
|
|
2012-06-11 03:40:51 +04:00
|
|
|
$ cd ..
|
2014-11-10 21:44:42 +03:00
|
|
|
|
|
|
|
No common ancestor
|
|
|
|
|
|
|
|
$ hg init separaterepo
|
|
|
|
$ cd separaterepo
|
|
|
|
$ touch a
|
|
|
|
$ hg commit -Aqm a
|
|
|
|
$ hg up -q null
|
|
|
|
$ touch b
|
|
|
|
$ hg commit -Aqm b
|
|
|
|
$ hg rebase -d 0
|
|
|
|
nothing to rebase from d7486e00c6f1 to 3903775176ed
|
|
|
|
$ cd ..
|