Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

Commit 147c5a63 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

update: properly overwrite `check` config with `--no-` variants

Before this change `--merge` override `commands.update.check=abort/noconflict`,
and `--check` "override" `commands.update.check=none/linear`. However the
`--no-merge` and `--no-check` version where not doing anything.

The `--no-` two flags now behave properly.

Differential Revision: https://phab.mercurial-scm.org/D11851
parent 51f521900473
......@@ -7832,9 +7832,9 @@ def update(ui, repo, node=None, **opts):
raise error.InputError(_(b"you can't specify a revision and a date"))
updatecheck = None
if check:
if check or merge is not None and not merge:
updatecheck = b'abort'
elif merge:
elif merge or check is not None and not check:
updatecheck = b'none'
with repo.wlock():
......
......@@ -11,6 +11,7 @@ Mercurial XXX.
== Bug Fixes ==
The `--no-check` and `--no-merge` now properly overwrite the behavior from `commands.update.check`.
== Backwards Compatibility Changes ==
......
......@@ -226,6 +226,11 @@ Cases are run as shown in that table, row by row.
parent=2
M foo
$ revtest '--merge none dirty linear' dirty 1 2 --no-check
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
parent=2
M foo
$ revtest 'none dirty linear' dirty 1 2 --clean
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
parent=2
......@@ -247,6 +252,11 @@ Cases are run as shown in that table, row by row.
parent=1
M foo
$ revtest 'none dirty linear' dirty 1 2 --no-merge
abort: uncommitted changes
parent=1
M foo
$ revtest 'none dirty linear' dirty 1 2 --clean
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
parent=2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment