2010-10-01 18:10:06 +04:00
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> rebase=
|
|
|
|
>
|
2011-12-27 03:11:22 +04:00
|
|
|
> [phases]
|
|
|
|
> publish=False
|
|
|
|
>
|
2010-10-01 18:10:06 +04:00
|
|
|
> [alias]
|
2012-01-17 12:12:14 +04:00
|
|
|
> tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
|
2010-10-01 18:10:06 +04:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
|
|
|
|
$ hg init a
|
|
|
|
$ cd a
|
|
|
|
|
|
|
|
$ echo A > A
|
|
|
|
$ hg add A
|
|
|
|
$ hg ci -m A
|
|
|
|
|
|
|
|
$ echo 'B' > B
|
|
|
|
$ hg add B
|
|
|
|
$ hg ci -m B
|
|
|
|
|
|
|
|
$ echo C >> A
|
|
|
|
$ hg ci -m C
|
|
|
|
|
|
|
|
$ hg up -q -C 0
|
|
|
|
|
|
|
|
$ echo D >> A
|
|
|
|
$ hg ci -m D
|
|
|
|
created new head
|
|
|
|
|
|
|
|
$ echo E > E
|
|
|
|
$ hg add E
|
|
|
|
$ hg ci -m E
|
|
|
|
|
|
|
|
$ hg up -q -C 0
|
|
|
|
|
|
|
|
$ hg branch 'notdefault'
|
|
|
|
marked working directory as branch notdefault
|
2011-12-09 00:32:44 +04:00
|
|
|
(branches are permanent and global, did you want a bookmark?)
|
2010-10-01 18:10:06 +04:00
|
|
|
$ echo F >> A
|
|
|
|
$ hg ci -m F
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
Rebasing B onto E - check keep: and phases
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg clone -q -u . a a1
|
|
|
|
$ cd a1
|
2012-01-17 12:12:14 +04:00
|
|
|
$ hg phase --force --secret 2
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg tglog
|
2012-01-17 12:12:14 +04:00
|
|
|
@ 5:draft 'F' notdefault
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 4:draft 'E'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 3:draft 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 2:secret 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 1:draft 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
o 0:draft 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg rebase -s 1 -d 4 --keep
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 1:27547f69f254 "B"
|
|
|
|
rebasing 2:965c486023db "C"
|
2010-10-01 18:10:06 +04:00
|
|
|
merging A
|
2015-10-09 23:54:52 +03:00
|
|
|
warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
|
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]
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
Solve the conflict and go on:
|
|
|
|
|
|
|
|
$ echo 'conflict solved' > A
|
|
|
|
$ rm A.orig
|
|
|
|
$ hg resolve -m A
|
2014-07-26 05:32:49 +04:00
|
|
|
(no more unresolved files)
|
2015-12-24 23:41:40 +03:00
|
|
|
continue: hg rebase --continue
|
2010-10-01 18:10:06 +04:00
|
|
|
$ hg rebase --continue
|
2014-12-09 05:45:26 +03:00
|
|
|
already rebased 1:27547f69f254 "B" as 45396c49d53b
|
|
|
|
rebasing 2:965c486023db "C"
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg tglog
|
2013-10-14 18:12:29 +04:00
|
|
|
o 7:secret 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
o 6:draft 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2013-10-14 18:12:29 +04:00
|
|
|
| @ 5:draft 'F' notdefault
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
o | 4:draft 'E'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
o | 3:draft 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 2:secret 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 1:draft 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
o 0:draft 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
Rebase F onto E - check keepbranches:
|
|
|
|
|
|
|
|
$ hg clone -q -u . a a2
|
|
|
|
$ cd a2
|
2012-01-17 12:12:14 +04:00
|
|
|
$ hg phase --force --secret 2
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg tglog
|
2012-01-17 12:12:14 +04:00
|
|
|
@ 5:draft 'F' notdefault
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 4:draft 'E'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 3:draft 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 2:secret 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 1:draft 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
o 0:draft 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg rebase -s 5 -d 4 --keepbranches
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 5:01e6ebbd8272 "F" (tip)
|
2010-10-01 18:10:06 +04:00
|
|
|
merging A
|
2015-10-09 23:54:52 +03:00
|
|
|
warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
|
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]
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
Solve the conflict and go on:
|
|
|
|
|
|
|
|
$ echo 'conflict solved' > A
|
|
|
|
$ rm A.orig
|
|
|
|
$ hg resolve -m A
|
2014-07-26 05:32:49 +04:00
|
|
|
(no more unresolved files)
|
2015-12-24 23:41:40 +03:00
|
|
|
continue: hg rebase --continue
|
2010-10-01 18:10:06 +04:00
|
|
|
$ hg rebase --continue
|
2014-12-09 05:45:26 +03:00
|
|
|
rebasing 5:01e6ebbd8272 "F" (tip)
|
2017-07-08 04:51:46 +03:00
|
|
|
saved backup bundle to $TESTTMP/a2/.hg/strip-backup/01e6ebbd8272-6fd3a015-rebase.hg (glob)
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
|
|
$ hg tglog
|
2012-01-17 12:12:14 +04:00
|
|
|
@ 5:draft 'F' notdefault
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
o 4:draft 'E'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
o 3:draft 'D'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 2:secret 'C'
|
2010-10-01 18:10:06 +04:00
|
|
|
| |
|
2012-01-17 12:12:14 +04:00
|
|
|
| o 1:draft 'B'
|
2010-10-01 18:10:06 +04:00
|
|
|
|/
|
2012-01-17 12:12:14 +04:00
|
|
|
o 0:draft 'A'
|
2010-10-01 18:10:06 +04:00
|
|
|
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|