##// END OF EJS Templates
share: make it possible to control the working copy format variant...
share: make it possible to control the working copy format variant A share will use the same format as its source for the store, but there are no reason to not lets it control the working copy variant at creation time. So we make it so. Differential Revision: https://phab.mercurial-scm.org/D11892

File last commit:

r49256:38941a28 default
r49297:bf2738e0 default
Show More
test-resolve.t
758 lines | 21.8 KiB | text/troff | Tads3Lexer
Nicolas Dumazet
tests: unify test-resolve
r12117 test that a commit clears the merge state.
$ hg init repo
$ cd repo
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 $ echo foo > file1
$ echo foo > file2
$ hg commit -Am 'add files'
adding file1
adding file2
Nicolas Dumazet
tests: unify test-resolve
r12117
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 $ echo bar >> file1
$ echo bar >> file2
$ hg commit -Am 'append bar to files'
Nicolas Dumazet
tests: unify test-resolve
r12117
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 create a second head with conflicting edits
Nicolas Dumazet
tests: unify test-resolve
r12117
$ hg up -C 0
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo baz >> file1
$ echo baz >> file2
$ hg commit -Am 'append baz to files'
Nicolas Dumazet
tests: unify test-resolve
r12117 created new head
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 create a third head with no conflicting edits
$ hg up -qC 0
$ echo foo > file3
$ hg commit -Am 'add non-conflicting file'
adding file3
created new head
Nicolas Dumazet
tests: unify test-resolve
r12117 failing merge
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 $ hg up -qC 2
$ hg merge --tool=internal:fail 1
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Nicolas Dumazet
tests: unify test-resolve
r12117
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 resolve -l should contain unresolved entries
Gregory Szorc
resolve: split test...
r21263
$ hg resolve -l
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 U file1
U file2
Gregory Szorc
resolve: split test...
r21263
Yuya Nishihara
resolve: port to generic templater...
r24127 $ hg resolve -l --no-status
file1
file2
Yuya Nishihara
resolve: silence warning of unknown pats for -l/--list (BC)...
r24125 resolving an unknown path should emit a warning, but not for -l
Martin von Zweigbergk
test-resolve: clarify test descriptions and consistently use "should"
r23020
Gregory Szorc
resolve: print warning when no work performed (issue4208)...
r21265 $ hg resolve -m does-not-exist
Matt Mackall
resolve: fix grammar of no matching files message
r21721 arguments do not match paths that need resolving
Yuya Nishihara
resolve: silence warning of unknown pats for -l/--list (BC)...
r24125 $ hg resolve -l does-not-exist
Gregory Szorc
resolve: print warning when no work performed (issue4208)...
r21265
timeless
resolve: when pats do not match, hint about path:...
r28402 tell users how they could have used resolve
$ mkdir nested
$ cd nested
$ hg resolve -m file1
arguments do not match paths that need resolving
(try: hg resolve -m path:file1)
$ hg resolve -m file1 filez
arguments do not match paths that need resolving
(try: hg resolve -m path:file1 path:filez)
$ hg resolve -m path:file1 path:filez
$ hg resolve -l
R file1
U file2
Martin von Zweigbergk
resolve: respect ui.relative-paths...
r41652 $ hg resolve -l --config ui.relative-paths=yes
R ../file1
U ../file2
Valentin Gatien-Baron
resolve: test that we suggest a valid hg command...
r39437 $ hg resolve --re-merge filez file2
arguments do not match paths that need resolving
(try: hg resolve --re-merge path:filez path:file2)
timeless
resolve: when pats do not match, hint about path:...
r28402 $ hg resolve -m filez file2
arguments do not match paths that need resolving
(try: hg resolve -m path:filez path:file2)
$ hg resolve -m path:filez path:file2
(no more unresolved files)
$ hg resolve -l
R file1
R file2
cleanup
$ hg resolve -u
$ cd ..
$ rmdir nested
Gregory Szorc
resolve: split test...
r21263 resolve the failure
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 $ echo resolved > file1
$ hg resolve -m file1
resolve -l should show resolved file as resolved
$ hg resolve -l
R file1
U file2
Yuya Nishihara
resolve: port to generic templater...
r24127 $ hg resolve -l -Tjson
[
{
Yuya Nishihara
resolve: rename {status} to {mergestatus} to not shadow change status (BC)...
r39964 "mergestatus": "R",
"path": "file1"
Yuya Nishihara
resolve: port to generic templater...
r24127 },
{
Yuya Nishihara
resolve: rename {status} to {mergestatus} to not shadow change status (BC)...
r39964 "mergestatus": "U",
"path": "file2"
Yuya Nishihara
resolve: port to generic templater...
r24127 }
]
Yuya Nishihara
resolve: rename {status} to {mergestatus} to not shadow change status (BC)...
r39964 $ hg resolve -l -T '{path} {mergestatus} {status} {p1rev} {p2rev}\n'
file1 R M 2 1
file2 U M 2 1
Yuya Nishihara
resolve: add support for log-like template keywords and functions...
r38562
Martin von Zweigbergk
test-resolve: add test resolving one of two files...
r23021 resolve -m without paths should mark all resolved
$ hg resolve -m
Pierre-Yves David
resolve: add parenthesis around "no more unresolved files" message...
r21947 (no more unresolved files)
Nicolas Dumazet
tests: unify test-resolve
r12117 $ hg commit -m 'resolved'
Martin von Zweigbergk
test-resolve: clarify test descriptions and consistently use "should"
r23020 resolve -l should be empty after commit
Nicolas Dumazet
tests: unify test-resolve
r12117
$ hg resolve -l
Siddharth Agarwal
resolve: don't abort resolve -l even when no merge is in progress...
r21541
Yuya Nishihara
resolve: port to generic templater...
r24127 $ hg resolve -l -Tjson
[
]
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 resolve --all should abort when no merge in progress
$ hg resolve --all
abort: resolve command not applicable when not merging
Martin von Zweigbergk
errors: introduce StateError and use it from commands and cmdutil...
r46444 [20]
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022
Martin von Zweigbergk
test-resolve: clarify test descriptions and consistently use "should"
r23020 resolve -m should abort when no merge in progress
Siddharth Agarwal
resolve: don't abort resolve -l even when no merge is in progress...
r21541 $ hg resolve -m
Gregory Szorc
resolve: abort when not applicable (BC)...
r21264 abort: resolve command not applicable when not merging
Martin von Zweigbergk
errors: introduce StateError and use it from commands and cmdutil...
r46444 [20]
Nicolas Dumazet
tests: unify test-resolve
r12117
Martin von Zweigbergk
merge: refuse update/merge if there are unresolved conflicts (BC)...
r27316 can not update or merge when there are unresolved conflicts
$ hg up -qC 0
$ echo quux >> file1
$ hg up 1
merging file1
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
1 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges
[1]
$ hg up 0
abort: outstanding merge conflicts
Martin von Zweigbergk
merge: hint about using `hg resolve` for resolving conflicts...
r43072 (use 'hg resolve' to resolve)
Martin von Zweigbergk
errors: use StateError more in merge module...
r47146 [20]
Martin von Zweigbergk
merge: refuse update/merge if there are unresolved conflicts (BC)...
r27316 $ hg merge 2
abort: outstanding merge conflicts
Martin von Zweigbergk
merge: hint about using `hg resolve` for resolving conflicts...
r43072 (use 'hg resolve' to resolve)
Martin von Zweigbergk
errors: use StateError more in merge module...
r47146 [20]
Martin von Zweigbergk
merge: refuse update/merge if there are unresolved conflicts (BC)...
r27316 $ hg merge --force 2
abort: outstanding merge conflicts
Martin von Zweigbergk
merge: hint about using `hg resolve` for resolving conflicts...
r43072 (use 'hg resolve' to resolve)
Martin von Zweigbergk
errors: use StateError more in merge module...
r47146 [20]
Martin von Zweigbergk
merge: refuse update/merge if there are unresolved conflicts (BC)...
r27316
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 set up conflict-free merge
$ hg up -qC 3
$ hg merge 1
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
Martin von Zweigbergk
resolve: run happily after conflict-free merge
r23024 resolve --all should do nothing in merge without conflicts
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022 $ hg resolve --all
Martin von Zweigbergk
resolve: run happily after conflict-free merge
r23024 (no more unresolved files)
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022
Martin von Zweigbergk
resolve: run happily after conflict-free merge
r23024 resolve -m should do nothing in merge without conflicts
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022
$ hg resolve -m
Martin von Zweigbergk
resolve: run happily after conflict-free merge
r23024 (no more unresolved files)
Martin von Zweigbergk
test-resolve: add more tests for in conflict-free states...
r23022
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023 get back to conflicting state
$ hg up -qC 2
$ hg merge --tool=internal:fail 1
0 files updated, 0 files merged, 0 files removed, 2 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023 [1]
resolve without arguments should suggest --all
$ hg resolve
abort: no files or directories specified
timeless@mozdev.org
resolve: consistently describe re-merge + unresolved
r26352 (use --all to re-merge all unresolved files)
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023
resolve --all should re-merge all unresolved files
Siddharth Agarwal
test-resolve.t: add some output to show order of operations...
r26619 $ hg resolve --all
merging file1
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
Siddharth Agarwal
resolve: perform all premerges before performing any file merges (BC)...
r26621 merging file2
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023 [1]
Siddharth Agarwal
test-resolve.t: add some tests for .orig file contents...
r26620 $ cat file1.orig
foo
baz
$ cat file2.orig
foo
baz
Christian Delahousse
resolve: choose where .orig file locations are kept...
r26939
.orig files should exists where specified
$ hg resolve --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
merging file1
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 creating directory: $TESTTMP/repo/.hg/origbackups
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
Christian Delahousse
resolve: choose where .orig file locations are kept...
r26939 merging file2
warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
[1]
$ ls .hg/origbackups
Mark Thomas
scmutil: don't append .orig to backups in origbackuppath (BC)...
r34145 file1
file2
Augie Fackler
test-resolve.t: use redirection to /dev/null instead of grep -q
r23025 $ grep '<<<' file1 > /dev/null
$ grep '<<<' file2 > /dev/null
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023
resolve <file> should re-merge file
$ echo resolved > file1
$ hg resolve -q file1
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023 [1]
Augie Fackler
test-resolve.t: use redirection to /dev/null instead of grep -q
r23025 $ grep '<<<' file1 > /dev/null
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023
Siddharth Agarwal
resolve: restore .orig only after merge is fully complete (issue4952)...
r26959 test .orig behavior with resolve
Matt Harbison
test-resolve: fix '--tool f' invocation for Windows...
r27067 $ hg resolve -q file1 --tool "sh -c 'f --dump \"$TESTTMP/repo/file1.orig\"'"
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 $TESTTMP/repo/file1.orig:
Siddharth Agarwal
resolve: restore .orig only after merge is fully complete (issue4952)...
r26959 >>>
foo
baz
<<<
Martin von Zweigbergk
test-resolve: add tests for re-merge
r23023 resolve <file> should do nothing if 'file' was marked resolved
$ echo resolved > file1
$ hg resolve -m file1
$ hg resolve -q file1
$ cat file1
resolved
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 insert unsupported advisory merge record
$ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
$ hg debugmergestate
Martin von Zweigbergk
debugmergestate: make templated...
r44880 local (working copy): 57653b9f834a4493f7240b0681efcb9ae7cab745
other (merge rev): dc77451844e37f03f5c559e3b8529b2b48d381d1
file: file1 (state "r")
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 ancestor path: file1 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
other path: file1 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
Martin von Zweigbergk
debugmergestate: make templated...
r44880 extra: ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac
Pulkit Goyal
commit: get info from mergestate whether a file was merged or not...
r47567 extra: merged = yes
Martin von Zweigbergk
debugmergestate: make templated...
r44880 file: file2 (state "u")
local path: file2 (hash cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523, flags "")
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 ancestor path: file2 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
other path: file2 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
Martin von Zweigbergk
debugmergestate: make templated...
r44880 extra: ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac
Pulkit Goyal
commit: get info from mergestate whether a file was merged or not...
r47567 extra: merged = yes
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 $ hg resolve -l
R file1
U file2
Martin von Zweigbergk
debugmergestate: make templated...
r44880 test json output
$ hg debugmergestate -T json
[
{
"commits": [{"label": "working copy", "name": "local", "node": "57653b9f834a4493f7240b0681efcb9ae7cab745"}, {"label": "merge rev", "name": "other", "node": "dc77451844e37f03f5c559e3b8529b2b48d381d1"}],
Pulkit Goyal
debugmergestate: show extras for files which are not in mergestate...
r46016 "extras": [],
Pulkit Goyal
commit: get info from mergestate whether a file was merged or not...
r47567 "files": [{"ancestor_node": "2ed2a3912a0b24502043eae84ee4b279c18b90dd", "ancestor_path": "file1", "extras": [{"key": "ancestorlinknode", "value": "99726c03216e233810a2564cbc0adfe395007eac"}, {"key": "merged", "value": "yes"}], "local_flags": "", "local_key": "60b27f004e454aca81b0480209cce5081ec52390", "local_path": "file1", "other_node": "6f4310b00b9a147241b071a60c28a650827fb03d", "other_path": "file1", "path": "file1", "state": "r"}, {"ancestor_node": "2ed2a3912a0b24502043eae84ee4b279c18b90dd", "ancestor_path": "file2", "extras": [{"key": "ancestorlinknode", "value": "99726c03216e233810a2564cbc0adfe395007eac"}, {"key": "merged", "value": "yes"}], "local_flags": "", "local_key": "cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523", "local_path": "file2", "other_node": "6f4310b00b9a147241b071a60c28a650827fb03d", "other_path": "file2", "path": "file2", "state": "u"}]
Martin von Zweigbergk
debugmergestate: make templated...
r44880 }
]
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 insert unsupported mandatory merge record
$ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
$ hg debugmergestate
Martin von Zweigbergk
debugmergestate: make templated...
r44880 abort: unsupported merge state records: X
(see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
[255]
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 $ hg resolve -l
abort: unsupported merge state records: X
(see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
[255]
$ hg resolve -ma
abort: unsupported merge state records: X
(see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
[255]
$ hg summary
timeless
summary: move mergemod before parents to give access to ms
r28641 warning: merge state has unsupported record types: X
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 parent: 2:57653b9f834a
append baz to files
parent: 1:dc77451844e3
append bar to files
branch: default
commit: 2 modified, 2 unknown (merge)
update: 2 new changesets (update)
phases: 5 draft
update --clean shouldn't abort on unsupported records
$ hg up -qC 1
$ hg debugmergestate
no merge state found
Nicolas Dumazet
tests: unify test-resolve
r12117 test crashed merge with empty mergestate
$ mkdir .hg/merge
$ touch .hg/merge/state
Martin von Zweigbergk
test-resolve: clarify test descriptions and consistently use "should"
r23020 resolve -l should be empty
Nicolas Dumazet
tests: unify test-resolve
r12117
$ hg resolve -l
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 resolve -m can be configured to look for remaining conflict markers
$ hg up -qC 2
$ hg merge -q --tool=internal:merge 1
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
[1]
$ hg resolve -l
U file1
U file2
$ echo 'remove markers' > file1
Kyle Lippincott
resolve: graduate resolve.mark-check from experimental, add docs...
r38893 $ hg --config commands.resolve.mark-check=abort resolve -m
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 warning: the following files still have conflict markers:
file2
abort: conflict markers detected
(use --all to mark anyway)
Martin von Zweigbergk
errors: introduce StateError and use it from commands and cmdutil...
r46444 [20]
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 $ hg resolve -l
U file1
U file2
Try with --all from the hint
Kyle Lippincott
resolve: graduate resolve.mark-check from experimental, add docs...
r38893 $ hg --config commands.resolve.mark-check=abort resolve -m --all
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 warning: the following files still have conflict markers:
file2
(no more unresolved files)
$ hg resolve -l
R file1
R file2
Martin von Zweigbergk
resolve: also detect new :mergediff conflict markers...
r47065 Test with :mergediff conflict markers
$ hg resolve --unmark
$ hg resolve --re-merge -t :mergediff file2
merging file2
warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
[1]
$ hg resolve -l
U file1
U file2
$ hg --config commands.resolve.mark-check=abort resolve -m
warning: the following files still have conflict markers:
file2
abort: conflict markers detected
(use --all to mark anyway)
[20]
$ hg resolve -l
U file1
U file2
Kyle Lippincott
resolve: correct behavior of mark-check=none to match docs...
r38909 Test option value 'warn'
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 $ hg resolve --unmark
$ hg resolve -l
U file1
U file2
Kyle Lippincott
resolve: graduate resolve.mark-check from experimental, add docs...
r38893 $ hg --config commands.resolve.mark-check=warn resolve -m
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 warning: the following files still have conflict markers:
file2
(no more unresolved files)
$ hg resolve -l
R file1
R file2
If the file is already marked as resolved, we don't warn about it
$ hg resolve --unmark file1
$ hg resolve -l
U file1
R file2
Kyle Lippincott
resolve: graduate resolve.mark-check from experimental, add docs...
r38893 $ hg --config commands.resolve.mark-check=warn resolve -m
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829 (no more unresolved files)
$ hg resolve -l
R file1
R file2
Kyle Lippincott
resolve: correct behavior of mark-check=none to match docs...
r38909 If the user passes an invalid value, we treat it as 'none'.
$ hg resolve --unmark
$ hg resolve -l
U file1
U file2
$ hg --config commands.resolve.mark-check=nope resolve -m
(no more unresolved files)
$ hg resolve -l
R file1
R file2
Kyle Lippincott
tests: fix a couple typos in test-resolve.t comments and add a comment...
r40600 Test explicitly setting the option to 'none'
Kyle Lippincott
resolve: correct behavior of mark-check=none to match docs...
r38909 $ hg resolve --unmark
$ hg resolve -l
U file1
U file2
$ hg --config commands.resolve.mark-check=none resolve -m
(no more unresolved files)
$ hg resolve -l
R file1
R file2
Kyle Lippincott
resolve: when resolve.mark-check=abort, downgrade to warning if pats specified...
r40520 Test with marking an explicit file as resolved, this should not abort (since
there's no --force flag, we have no way of combining --all with a filename)
$ hg resolve --unmark
$ hg resolve -l
U file1
U file2
(This downgrades to a warning since an explicit file was specified).
$ hg --config commands.resolve.mark-check=abort resolve -m file2
warning: the following files still have conflict markers:
file2
$ hg resolve -l
U file1
R file2
Valentin Gatien-Baron
resolve: add a flag for the default behavior of re-merging...
r39429 Testing the --re-merge flag
$ hg resolve --unmark file1
$ hg resolve -l
U file1
R file2
$ hg resolve --mark --re-merge
Valentin Gatien-Baron
resolve: add config to make hg resolve not re-merge by default...
r39430 abort: too many actions specified
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Valentin Gatien-Baron
resolve: add a flag for the default behavior of re-merging...
r39429 $ hg resolve --re-merge --all
merging file1
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
[1]
Valentin Gatien-Baron
resolve: add config to make hg resolve not re-merge by default...
r39430 Explicit re-merge
$ hg resolve --unmark file1
$ hg resolve --config commands.resolve.explicit-re-merge=1 --all
abort: no action specified
(use --mark, --unmark, --list or --re-merge)
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Valentin Gatien-Baron
resolve: add config to make hg resolve not re-merge by default...
r39430 $ hg resolve --config commands.resolve.explicit-re-merge=1 --re-merge --all
merging file1
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
[1]
Kyle Lippincott
resolve: add option to warn/abort on -m with unresolved conflict markers...
r38829
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..
Sushil khanchi
resolve: add confirm config option...
r38858
======================================================
Test 'hg resolve' confirm config option functionality |
======================================================
$ cat >> $HGRCPATH << EOF
> [extensions]
> rebase=
> EOF
$ hg init repo2
$ cd repo2
$ echo boss > boss
$ hg ci -Am "add boss"
adding boss
$ for emp in emp1 emp2 emp3; do echo work > $emp; done;
$ hg ci -Aqm "added emp1 emp2 emp3"
$ hg up 0
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ for emp in emp1 emp2 emp3; do echo nowork > $emp; done;
$ hg ci -Aqm "added lazy emp1 emp2 emp3"
$ hg log -GT "{rev} {node|short} {firstline(desc)}\n"
@ 2 0acfd4a49af0 added lazy emp1 emp2 emp3
|
| o 1 f30f98a8181f added emp1 emp2 emp3
|/
o 0 88660038d466 add boss
$ hg rebase -s 1 -d 2
rebasing 1:f30f98a8181f "added emp1 emp2 emp3"
merging emp1
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp1! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp2
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp2! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp3
warning: conflicts while merging emp3! (edit, then use 'hg resolve --mark')
Daniel Ploch
error: unify the error message formats for 'rebase' and 'unshelve'...
r45710 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
Martin von Zweigbergk
errors: add config that lets user get more detailed exit codes...
r46430 [240]
Sushil khanchi
resolve: add confirm config option...
r38858
Test when commands.resolve.confirm config option is not set:
===========================================================
$ hg resolve --all
merging emp1
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp1! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp2
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp2! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp3
warning: conflicts while merging emp3! (edit, then use 'hg resolve --mark')
[1]
Test when config option is set:
==============================
Kyle Lippincott
tests: make the commands.resolve.confirm tests not pollute the test-wide hgrc...
r40601 $ cat >> .hg/hgrc << EOF
Sushil khanchi
resolve: add confirm config option...
r38858 > [ui]
> interactive = True
> [commands]
> resolve.confirm = True
> EOF
$ hg resolve
abort: no files or directories specified
(use --all to re-merge all unresolved files)
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Sushil khanchi
resolve: add confirm config option...
r38858 $ hg resolve --all << EOF
> n
> EOF
re-merge all unresolved files (yn)? n
abort: user quit
Martin von Zweigbergk
errors: introduce CanceledError and use it in a few places...
r46489 [250]
Sushil khanchi
resolve: add confirm config option...
r38858
$ hg resolve --all << EOF
> y
> EOF
re-merge all unresolved files (yn)? y
merging emp1
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp1! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp2
Martin von Zweigbergk
mergestate: merge `preresolve()` into `resolve()`...
r49256 warning: conflicts while merging emp2! (edit, then use 'hg resolve --mark')
Sushil khanchi
resolve: add confirm config option...
r38858 merging emp3
warning: conflicts while merging emp3! (edit, then use 'hg resolve --mark')
[1]
Sushil khanchi
resolve: support commands.resolve.confirm option with --mark flag...
r38895 Test that commands.resolve.confirm respect --mark option (only when no patterns args are given):
===============================================================================================
$ hg resolve -m emp1
$ hg resolve -l
R emp1
U emp2
U emp3
$ hg resolve -m << EOF
> n
> EOF
mark all unresolved files as resolved (yn)? n
abort: user quit
Martin von Zweigbergk
errors: introduce CanceledError and use it in a few places...
r46489 [250]
Sushil khanchi
resolve: support commands.resolve.confirm option with --mark flag...
r38895
$ hg resolve -m << EOF
> y
> EOF
mark all unresolved files as resolved (yn)? y
(no more unresolved files)
continue: hg rebase --continue
$ hg resolve -l
R emp1
R emp2
R emp3
Sushil khanchi
resolve: support confirm config option with --unmark flag...
r38910 Test that commands.resolve.confirm respect --unmark option (only when no patterns args are given):
Kyle Lippincott
tests: fix a couple typos in test-resolve.t comments and add a comment...
r40600 =================================================================================================
Sushil khanchi
resolve: support confirm config option with --unmark flag...
r38910
$ hg resolve -u emp1
$ hg resolve -l
U emp1
R emp2
R emp3
$ hg resolve -u << EOF
> n
> EOF
mark all resolved files as unresolved (yn)? n
abort: user quit
Martin von Zweigbergk
errors: introduce CanceledError and use it in a few places...
r46489 [250]
Sushil khanchi
resolve: support confirm config option with --unmark flag...
r38910
$ hg resolve -m << EOF
> y
> EOF
mark all unresolved files as resolved (yn)? y
(no more unresolved files)
continue: hg rebase --continue
$ hg resolve -l
R emp1
R emp2
R emp3
Sushil khanchi
resolve: add confirm config option...
r38858 $ hg rebase --abort
rebase aborted
Kyle Lippincott
tests: fix a couple typos in test-resolve.t comments and add a comment...
r40600
Done with commands.resolve.confirm tests:
Sushil khanchi
resolve: add confirm config option...
r38858 $ cd ..
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317
Test that commands.resolve.mark-check works even if there are deleted files:
$ hg init resolve-deleted
$ cd resolve-deleted
$ echo r0 > file1
$ hg ci -qAm r0
$ echo r1 > file1
$ hg ci -qm r1
$ hg co -qr 0
$ hg rm file1
$ hg ci -qm "r2 (delete file1)"
(At this point we have r0 creating file1, and sibling commits r1 and r2, which
modify and delete file1, respectively)
$ hg merge -r 1
file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
$ hg resolve --list
U file1
Because we left it as 'unresolved' the file should still exist.
$ [ -f file1 ] || echo "File does not exist?"
BC behavior: `hg resolve --mark` accepts that the file is still there, and
doesn't have a problem with this situation.
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --list
R file1
The file is still there:
$ [ -f file1 ] || echo "File does not exist?"
Let's check mark-check=warn:
$ hg resolve --unmark file1
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
$ hg resolve --list
R file1
The file is still there:
$ [ -f file1 ] || echo "File does not exist?"
Let's resolve the issue by deleting the file via `hg resolve`
$ hg resolve --unmark file1
$ echo 'd' | hg resolve file1 --config ui.interactive=1
file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do? d
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 (no more unresolved files)
$ hg resolve --list
R file1
The file is deleted:
$ [ -f file1 ] && echo "File still exists?" || true
Doing `hg resolve --mark` doesn't break now that the file is missing:
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
Resurrect the file, and delete it outside of hg:
$ hg resolve --unmark file1
$ hg resolve file1
file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 [1]
$ [ -f file1 ] || echo "File does not exist?"
$ hg resolve --list
U file1
$ rm file1
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --list
R file1
$ hg resolve --unmark file1
$ hg resolve file1
file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 [1]
$ [ -f file1 ] || echo "File does not exist?"
$ hg resolve --list
U file1
$ rm file1
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
$ hg resolve --list
R file1
For completeness, let's try that in the opposite direction (merging r2 into r1,
instead of r1 into r2):
$ hg update -qCr 1
$ hg merge -r 2
file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
$ hg resolve --list
U file1
Because we left it as 'unresolved' the file should still exist.
$ [ -f file1 ] || echo "File does not exist?"
BC behavior: `hg resolve --mark` accepts that the file is still there, and
doesn't have a problem with this situation.
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --list
R file1
The file is still there:
$ [ -f file1 ] || echo "File does not exist?"
Let's check mark-check=warn:
$ hg resolve --unmark file1
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
$ hg resolve --list
R file1
The file is still there:
$ [ -f file1 ] || echo "File does not exist?"
Let's resolve the issue by deleting the file via `hg resolve`
$ hg resolve --unmark file1
$ echo 'd' | hg resolve file1 --config ui.interactive=1
file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do? d
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 (no more unresolved files)
$ hg resolve --list
R file1
The file is deleted:
$ [ -f file1 ] && echo "File still exists?" || true
Doing `hg resolve --mark` doesn't break now that the file is missing:
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
Resurrect the file, and delete it outside of hg:
$ hg resolve --unmark file1
$ hg resolve file1
file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 [1]
$ [ -f file1 ] || echo "File does not exist?"
$ hg resolve --list
U file1
$ rm file1
$ hg resolve --mark --config commands.resolve.mark-check=abort
(no more unresolved files)
$ hg resolve --list
R file1
$ hg resolve --unmark file1
$ hg resolve file1
file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
Kyle Lippincott
filemerge: make last line of prompts <40 english chars (issue6158)...
r42765 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do? u
Kyle Lippincott
resolve: fix mark-check when a file was deleted on one side (issue6020)...
r41317 [1]
$ [ -f file1 ] || echo "File does not exist?"
$ hg resolve --list
U file1
$ rm file1
$ hg resolve --mark --config commands.resolve.mark-check=warn
(no more unresolved files)
$ hg resolve --list
R file1
$ cd ..