2020-01-31 05:40:49 +03:00
|
|
|
#require py2
|
2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2018-01-23 23:09:16 +03:00
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable rebase
|
|
|
|
$ setconfig phases.publish=false
|
|
|
|
$ echo "[merge]" >> $HGRCPATH
|
2017-10-06 16:48:43 +03:00
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ echo a > a
|
|
|
|
$ echo b > b
|
|
|
|
$ hg commit -qAm ab
|
|
|
|
$ echo c >> a
|
|
|
|
$ echo c >> b
|
|
|
|
$ hg commit -qAm c
|
|
|
|
$ hg up -q ".^"
|
|
|
|
$ echo d >> a
|
|
|
|
$ echo d >> b
|
|
|
|
$ hg commit -qAm d
|
|
|
|
|
|
|
|
Testing on-failure=continue
|
|
|
|
$ echo on-failure=continue >> $HGRCPATH
|
|
|
|
$ hg rebase -s 1 -d 2 --tool false
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
merging a failed!
|
|
|
|
merging b failed!
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
U a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
|
|
|
Testing on-failure=halt
|
|
|
|
$ echo on-failure=halt >> $HGRCPATH
|
|
|
|
$ hg rebase -s 1 -d 2 --tool false
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
merging a failed!
|
2017-10-06 16:48:43 +03:00
|
|
|
merge halted after failed merge (see hg resolve)
|
2017-10-06 16:48:43 +03:00
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
U a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
|
|
|
Testing on-failure=prompt
|
2017-10-06 16:48:43 +03:00
|
|
|
$ cat <<EOS >> $HGRCPATH
|
|
|
|
> [merge]
|
|
|
|
> on-failure=prompt
|
|
|
|
> [ui]
|
|
|
|
> interactive=1
|
|
|
|
> EOS
|
|
|
|
$ cat <<EOS | hg rebase -s 1 -d 2 --tool false
|
2017-10-06 16:48:43 +03:00
|
|
|
> y
|
|
|
|
> n
|
|
|
|
> EOS
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
merging a failed!
|
2018-09-03 13:02:00 +03:00
|
|
|
continue merge operation [(y)es/(n)o/(a)lways]? y
|
2017-10-06 16:48:43 +03:00
|
|
|
merging b failed!
|
2018-09-03 13:02:00 +03:00
|
|
|
continue merge operation [(y)es/(n)o/(a)lways]? n
|
2017-10-06 16:48:43 +03:00
|
|
|
merge halted after failed merge (see hg resolve)
|
2017-10-06 16:48:43 +03:00
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
U a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
2018-09-03 13:02:00 +03:00
|
|
|
$ cat <<EOS | hg rebase -s 1 -d 2 --tool false
|
|
|
|
> a
|
|
|
|
> EOS
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2018-09-03 13:02:00 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
merging a failed!
|
|
|
|
continue merge operation [(y)es/(n)o/(a)lways]? a
|
|
|
|
merging b failed!
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
U a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
2017-10-06 16:48:43 +03:00
|
|
|
Check that successful tool with failed post-check halts the merge
|
|
|
|
$ cat <<EOS >> $HGRCPATH
|
|
|
|
> [merge-tools]
|
|
|
|
> true.check=changed
|
|
|
|
> EOS
|
|
|
|
$ cat <<EOS | hg rebase -s 1 -d 2 --tool true
|
|
|
|
> y
|
|
|
|
> n
|
|
|
|
> n
|
|
|
|
> EOS
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
output file a appears unchanged
|
|
|
|
was merge successful (yn)? y
|
|
|
|
output file b appears unchanged
|
|
|
|
was merge successful (yn)? n
|
|
|
|
merging b failed!
|
2018-09-03 13:02:00 +03:00
|
|
|
continue merge operation [(y)es/(n)o/(a)lways]? n
|
2017-10-06 16:48:43 +03:00
|
|
|
merge halted after failed merge (see hg resolve)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
R a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
|
|
|
Check that conflicts with conflict check also halts the merge
|
|
|
|
$ cat <<EOS >> $HGRCPATH
|
|
|
|
> [merge-tools]
|
|
|
|
> true.check=conflicts
|
|
|
|
> true.premerge=keep
|
|
|
|
> [merge]
|
|
|
|
> on-failure=halt
|
|
|
|
> EOS
|
|
|
|
$ hg rebase -s 1 -d 2 --tool true
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
merging a failed!
|
|
|
|
merge halted after failed merge (see hg resolve)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
U a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
|
|
|
Check that always-prompt also can halt the merge
|
|
|
|
$ cat <<EOS | hg rebase -s 1 -d 2 --tool true --config merge-tools.true.check=prompt
|
|
|
|
> y
|
|
|
|
> n
|
|
|
|
> EOS
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
was merge of 'a' successful (yn)? y
|
|
|
|
was merge of 'b' successful (yn)? n
|
|
|
|
merging b failed!
|
|
|
|
merge halted after failed merge (see hg resolve)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg resolve --list
|
|
|
|
R a
|
|
|
|
U b
|
|
|
|
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
|
|
|
|
Check that successful tool otherwise allows the merge to continue
|
|
|
|
$ hg rebase -s 1 -d 2 --tool echo --keep --config merge-tools.echo.premerge=keep
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 1f28a51c3c9b "c"
|
2017-10-06 16:48:43 +03:00
|
|
|
merging a
|
|
|
|
merging b
|
|
|
|
$TESTTMP/repo/a *a~base* *a~other* (glob)
|
|
|
|
$TESTTMP/repo/b *b~base* *b~other* (glob)
|