Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGdc00324e80f4: errors: use StateError more in merge module
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
pulkit |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/merge.py (16 lines) | |||
M | tests/test-audit-subrepo.t (6 lines) | |||
M | tests/test-largefiles.t (2 lines) | |||
M | tests/test-merge-remove.t (2 lines) | |||
M | tests/test-merge1.t (16 lines) | |||
M | tests/test-pathconflicts-basic.t (2 lines) | |||
M | tests/test-pathconflicts-update.t (8 lines) | |||
M | tests/test-remotefilelog-prefetch.t (2 lines) | |||
M | tests/test-rename-dir-merge.t (2 lines) | |||
M | tests/test-resolve.t (6 lines) | |||
M | tests/test-up-local-change.t (4 lines) | |||
M | tests/test-update-branches.t (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
a625e24721ff | c6924b3a2f8f | Martin von Zweigbergk | Jan 29 2021, 6:56 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
if f in pathconflicts: | if f in pathconflicts: | ||||
if repo.wvfs.isfileorlink(f): | if repo.wvfs.isfileorlink(f): | ||||
warn(_(b"%s: untracked file conflicts with directory\n") % f) | warn(_(b"%s: untracked file conflicts with directory\n") % f) | ||||
else: | else: | ||||
warn(_(b"%s: untracked directory conflicts with file\n") % f) | warn(_(b"%s: untracked directory conflicts with file\n") % f) | ||||
else: | else: | ||||
warn(_(b"%s: untracked file differs\n") % f) | warn(_(b"%s: untracked file differs\n") % f) | ||||
if abortconflicts: | if abortconflicts: | ||||
raise error.Abort( | raise error.StateError( | ||||
_( | _( | ||||
b"untracked files in working directory " | b"untracked files in working directory " | ||||
b"differ from files in requested revision" | b"differ from files in requested revision" | ||||
) | ) | ||||
) | ) | ||||
for f in sorted(warnconflicts): | for f in sorted(warnconflicts): | ||||
if repo.wvfs.isfileorlink(f): | if repo.wvfs.isfileorlink(f): | ||||
pmmf.discard(f1) | pmmf.discard(f1) | ||||
pmmf.add(f) | pmmf.add(f) | ||||
# check case-folding collision in provisional merged manifest | # check case-folding collision in provisional merged manifest | ||||
foldmap = {} | foldmap = {} | ||||
for f in pmmf: | for f in pmmf: | ||||
fold = util.normcase(f) | fold = util.normcase(f) | ||||
if fold in foldmap: | if fold in foldmap: | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b"case-folding collision between %s and %s") | _(b"case-folding collision between %s and %s") | ||||
% (f, foldmap[fold]) | % (f, foldmap[fold]) | ||||
) | ) | ||||
foldmap[fold] = f | foldmap[fold] = f | ||||
# check case-folding of directories | # check case-folding of directories | ||||
foldprefix = unfoldprefix = lastfull = b'' | foldprefix = unfoldprefix = lastfull = b'' | ||||
for fold, f in sorted(foldmap.items()): | for fold, f in sorted(foldmap.items()): | ||||
if fold.startswith(foldprefix) and not f.startswith(unfoldprefix): | if fold.startswith(foldprefix) and not f.startswith(unfoldprefix): | ||||
# the folded prefix matches but actual casing is different | # the folded prefix matches but actual casing is different | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b"case-folding collision between %s and directory of %s") | _(b"case-folding collision between %s and directory of %s") | ||||
% (lastfull, f) | % (lastfull, f) | ||||
) | ) | ||||
foldprefix = fold + b'/' | foldprefix = fold + b'/' | ||||
unfoldprefix = f + b'/' | unfoldprefix = f + b'/' | ||||
lastfull = f | lastfull = f | ||||
b'path conflict', | b'path conflict', | ||||
) | ) | ||||
remoteconflicts.remove(p) | remoteconflicts.remove(p) | ||||
break | break | ||||
if invalidconflicts: | if invalidconflicts: | ||||
for p in invalidconflicts: | for p in invalidconflicts: | ||||
repo.ui.warn(_(b"%s: is both a file and a directory\n") % p) | repo.ui.warn(_(b"%s: is both a file and a directory\n") % p) | ||||
raise error.Abort(_(b"destination manifest contains path conflicts")) | raise error.StateError( | ||||
_(b"destination manifest contains path conflicts") | |||||
) | |||||
def _filternarrowactions(narrowmatch, branchmerge, mresult): | def _filternarrowactions(narrowmatch, branchmerge, mresult): | ||||
""" | """ | ||||
Filters out actions that can ignored because the repo is narrowed. | Filters out actions that can ignored because the repo is narrowed. | ||||
Raise an exception if the merge cannot be completed because the repo is | Raise an exception if the merge cannot be completed because the repo is | ||||
narrowed. | narrowed. | ||||
pas = [p1.ancestor(p2, warn=branchmerge)] | pas = [p1.ancestor(p2, warn=branchmerge)] | ||||
fp1, fp2, xp1, xp2 = p1.node(), p2.node(), bytes(p1), bytes(p2) | fp1, fp2, xp1, xp2 = p1.node(), p2.node(), bytes(p1), bytes(p2) | ||||
overwrite = force and not branchmerge | overwrite = force and not branchmerge | ||||
### check phase | ### check phase | ||||
if not overwrite: | if not overwrite: | ||||
if len(pl) > 1: | if len(pl) > 1: | ||||
raise error.Abort(_(b"outstanding uncommitted merge")) | raise error.StateError(_(b"outstanding uncommitted merge")) | ||||
ms = wc.mergestate() | ms = wc.mergestate() | ||||
if ms.unresolvedcount(): | if ms.unresolvedcount(): | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b"outstanding merge conflicts"), | _(b"outstanding merge conflicts"), | ||||
hint=_(b"use 'hg resolve' to resolve"), | hint=_(b"use 'hg resolve' to resolve"), | ||||
) | ) | ||||
if branchmerge: | if branchmerge: | ||||
if pas == [p2]: | if pas == [p2]: | ||||
raise error.Abort( | raise error.Abort( | ||||
_( | _( | ||||
b"merging with a working directory ancestor" | b"merging with a working directory ancestor" | ||||
matcher=matcher, | matcher=matcher, | ||||
mergeforce=mergeforce, | mergeforce=mergeforce, | ||||
) | ) | ||||
if updatecheck == UPDATECHECK_NO_CONFLICT: | if updatecheck == UPDATECHECK_NO_CONFLICT: | ||||
if mresult.hasconflicts(): | if mresult.hasconflicts(): | ||||
msg = _(b"conflicting changes") | msg = _(b"conflicting changes") | ||||
hint = _(b"commit or update --clean to discard changes") | hint = _(b"commit or update --clean to discard changes") | ||||
raise error.Abort(msg, hint=hint) | raise error.StateError(msg, hint=hint) | ||||
# Prompt and create actions. Most of this is in the resolve phase | # Prompt and create actions. Most of this is in the resolve phase | ||||
# already, but we can't handle .hgsubstate in filemerge or | # already, but we can't handle .hgsubstate in filemerge or | ||||
# subrepoutil.submerge yet so we have to keep prompting for it. | # subrepoutil.submerge yet so we have to keep prompting for it. | ||||
vals = mresult.getfile(b'.hgsubstate') | vals = mresult.getfile(b'.hgsubstate') | ||||
if vals: | if vals: | ||||
f = b'.hgsubstate' | f = b'.hgsubstate' | ||||
m, args, msg = vals | m, args, msg = vals |
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
added 1 changesets with 1 changes to 1 files | added 1 changesets with 1 changes to 1 files | ||||
new changesets 7a2f0e59146f | new changesets 7a2f0e59146f | ||||
.hgsubstate: untracked file differs | .hgsubstate: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ cat main5/.hg/hgrc | grep pwned | $ cat main5/.hg/hgrc | grep pwned | ||||
[1] | [1] | ||||
on clone (and update) into .hg, which at least fails: | on clone (and update) into .hg, which at least fails: | ||||
$ SUB=.hg hg clone -q main main6 | $ SUB=.hg hg clone -q main main6 | ||||
abort: subrepo path contains illegal component: $SUB | abort: subrepo path contains illegal component: $SUB | ||||
[255] | [255] | ||||
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
added 1 changesets with 1 changes to 1 files | added 1 changesets with 1 changes to 1 files | ||||
new changesets * (glob) | new changesets * (glob) | ||||
.hgsubstate: untracked file differs | .hgsubstate: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ ls "$FAKEHOME" | $ ls "$FAKEHOME" | ||||
a | a | ||||
$ test -d "$FAKEHOME/.hg" | $ test -d "$FAKEHOME/.hg" | ||||
[1] | [1] | ||||
on clone empty subrepo with hg-managed fakehome directory, | on clone empty subrepo with hg-managed fakehome directory, | ||||
then pull (and update): | then pull (and update): | ||||
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
added 1 changesets with 1 changes to 1 files | added 1 changesets with 1 changes to 1 files | ||||
new changesets * (glob) | new changesets * (glob) | ||||
.hgsubstate: untracked file differs | .hgsubstate: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ ls -A "$FAKEHOME" | $ ls -A "$FAKEHOME" | ||||
.hg | .hg | ||||
a | a | ||||
on clone only symlink with hg-managed fakehome directory, | on clone only symlink with hg-managed fakehome directory, | ||||
then pull (and update): | then pull (and update): | ||||
$ rm -fR "$FAKEHOME" | $ rm -fR "$FAKEHOME" |
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg status | $ hg status | ||||
M large | M large | ||||
- make sure update of merge with removed largefiles fails as expected | - make sure update of merge with removed largefiles fails as expected | ||||
$ hg rm sub2/large6 | $ hg rm sub2/large6 | ||||
$ hg up -r. | $ hg up -r. | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
[255] | [20] | ||||
- revert should be able to revert files introduced in a pending merge | - revert should be able to revert files introduced in a pending merge | ||||
$ hg revert --all -r . | $ hg revert --all -r . | ||||
removing .hglf/large | removing .hglf/large | ||||
undeleting .hglf/sub2/large6 | undeleting .hglf/sub2/large6 | ||||
Test that a normal file and a largefile with the same name and path cannot | Test that a normal file and a largefile with the same name and path cannot | ||||
coexist. | coexist. |
$ rm * | $ rm * | ||||
$ hg up -qC | $ hg up -qC | ||||
$ hg rm bar | $ hg rm bar | ||||
$ hg ci -m 'remove bar' | $ hg ci -m 'remove bar' | ||||
$ echo 'memories of buried pirate treasure' > bar | $ echo 'memories of buried pirate treasure' > bar | ||||
$ hg merge | $ hg merge | ||||
bar: untracked file differs | bar: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ cat bar | $ cat bar | ||||
memories of buried pirate treasure | memories of buried pirate treasure | ||||
Those who use force will lose | Those who use force will lose | ||||
$ hg merge -f | $ hg merge -f | ||||
file 'bar' was deleted in local [working copy] but was modified in other [merge rev]. | file 'bar' was deleted in local [working copy] but was modified in other [merge rev]. | ||||
You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
$ hg add c | $ hg add c | ||||
$ hg commit -m "commit #2" | $ hg commit -m "commit #2" | ||||
created new head | created new head | ||||
$ echo This is file b2 > b | $ echo This is file b2 > b | ||||
merge should fail | merge should fail | ||||
$ hg merge 1 | $ hg merge 1 | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
#if symlink | #if symlink | ||||
symlinks to directories should be treated as regular files (issue5027) | symlinks to directories should be treated as regular files (issue5027) | ||||
$ rm b | $ rm b | ||||
$ ln -s 'This is file b2' b | $ ln -s 'This is file b2' b | ||||
$ hg merge 1 | $ hg merge 1 | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
symlinks shouldn't be followed | symlinks shouldn't be followed | ||||
$ rm b | $ rm b | ||||
$ echo This is file b1 > .hg/b | $ echo This is file b1 > .hg/b | ||||
$ ln -s .hg/b b | $ ln -s .hg/b b | ||||
$ hg merge 1 | $ hg merge 1 | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ rm b | $ rm b | ||||
$ echo This is file b2 > b | $ echo This is file b2 > b | ||||
#endif | #endif | ||||
bad config | bad config | ||||
$ hg merge 1 --config merge.checkunknown=x | $ hg merge 1 --config merge.checkunknown=x | ||||
config error: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn') | config error: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn') | ||||
[30] | [30] | ||||
this merge should fail | this merge should fail | ||||
$ hg merge 1 --config merge.checkunknown=abort | $ hg merge 1 --config merge.checkunknown=abort | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
this merge should warn | this merge should warn | ||||
$ hg merge 1 --config merge.checkunknown=warn | $ hg merge 1 --config merge.checkunknown=warn | ||||
b: replacing untracked file | b: replacing untracked file | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ cat b.orig | $ cat b.orig | ||||
This is file b2 | This is file b2 | ||||
$ hg add .hgignore | $ hg add .hgignore | ||||
$ hg commit -m "commit #4" | $ hg commit -m "commit #4" | ||||
remote .hgignore shouldn't be used for determining whether a file is ignored | remote .hgignore shouldn't be used for determining whether a file is ignored | ||||
$ echo This is file remoteignored4 > remoteignored | $ echo This is file remoteignored4 > remoteignored | ||||
$ hg merge 3 --config merge.checkignored=ignore --config merge.checkunknown=abort | $ hg merge 3 --config merge.checkignored=ignore --config merge.checkunknown=abort | ||||
remoteignored: untracked file differs | remoteignored: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | ||||
merging .hgignore | merging .hgignore | ||||
merging for .hgignore | merging for .hgignore | ||||
3 files updated, 1 files merged, 0 files removed, 0 files unresolved | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ cat remoteignored | $ cat remoteignored | ||||
This is file remoteignored3 | This is file remoteignored3 | ||||
$ cat remoteignored.orig | $ cat remoteignored.orig | ||||
This is file remoteignored4 | This is file remoteignored4 | ||||
$ rm remoteignored.orig | $ rm remoteignored.orig | ||||
local .hgignore should be used for that | local .hgignore should be used for that | ||||
$ hg up --clean 4 | $ hg up --clean 4 | ||||
1 files updated, 0 files merged, 3 files removed, 0 files unresolved | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved | ||||
$ echo This is file localignored4 > localignored | $ echo This is file localignored4 > localignored | ||||
also test other conflicting files to see we output the full set of warnings | also test other conflicting files to see we output the full set of warnings | ||||
$ echo This is file b2 > b | $ echo This is file b2 > b | ||||
$ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=abort | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=abort | ||||
b: untracked file differs | b: untracked file differs | ||||
localignored: untracked file differs | localignored: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | ||||
localignored: untracked file differs | localignored: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=abort | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=abort | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=warn | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=warn | ||||
b: replacing untracked file | b: replacing untracked file | ||||
localignored: replacing untracked file | localignored: replacing untracked file | ||||
merging .hgignore | merging .hgignore | ||||
merging for .hgignore | merging for .hgignore | ||||
3 files updated, 1 files merged, 0 files removed, 0 files unresolved | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ cat localignored | $ cat localignored |
Basic update - local directory conflicts with remote file | Basic update - local directory conflicts with remote file | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ mkdir a | $ mkdir a | ||||
$ echo 3 > a/b | $ echo 3 > a/b | ||||
$ hg up file | $ hg up file | ||||
a: untracked directory conflicts with file | a: untracked directory conflicts with file | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg up --clean file | $ hg up --clean file | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark file) | (activating bookmark file) | ||||
Repo state is ok | Repo state is ok | ||||
$ hg sum | $ hg sum | ||||
parent: 1:853701544ac3 | parent: 1:853701544ac3 |
Update - local file conflicts with remote directory: | Update - local file conflicts with remote directory: | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ mkdir a | $ mkdir a | ||||
$ echo 9 > a/b | $ echo 9 > a/b | ||||
$ hg up dir | $ hg up dir | ||||
a/b: untracked file conflicts with directory | a/b: untracked file conflicts with directory | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg up dir --config merge.checkunknown=warn | $ hg up dir --config merge.checkunknown=warn | ||||
a/b: replacing untracked file | a/b: replacing untracked file | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark dir) | (activating bookmark dir) | ||||
$ cat a/b.orig | $ cat a/b.orig | ||||
9 | 9 | ||||
$ rm a/b.orig | $ rm a/b.orig | ||||
Update - local symlink conflicts with remote directory: | Update - local symlink conflicts with remote directory: | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ mkdir a | $ mkdir a | ||||
#if symlink | #if symlink | ||||
$ ln -s x a/b | $ ln -s x a/b | ||||
#else | #else | ||||
$ touch a/b | $ touch a/b | ||||
#endif | #endif | ||||
$ hg up dir | $ hg up dir | ||||
a/b: untracked file conflicts with directory | a/b: untracked file conflicts with directory | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg up dir --config merge.checkunknown=warn | $ hg up dir --config merge.checkunknown=warn | ||||
a/b: replacing untracked file | a/b: replacing untracked file | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark dir) | (activating bookmark dir) | ||||
#if symlink | #if symlink | ||||
$ readlink.py a/b.orig | $ readlink.py a/b.orig | ||||
a/b.orig -> x | a/b.orig -> x | ||||
#endif | #endif | ||||
$ rm a/b.orig | $ rm a/b.orig | ||||
Update - local directory conflicts with remote file | Update - local directory conflicts with remote file | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ mkdir -p a/b/c | $ mkdir -p a/b/c | ||||
$ echo 9 > a/b/c/d | $ echo 9 > a/b/c/d | ||||
$ hg up file | $ hg up file | ||||
a/b: untracked directory conflicts with file | a/b: untracked directory conflicts with file | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg up file --config merge.checkunknown=warn | $ hg up file --config merge.checkunknown=warn | ||||
a/b: replacing untracked files in directory | a/b: replacing untracked files in directory | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark file) | (activating bookmark file) | ||||
$ cat a/b | $ cat a/b | ||||
1 | 1 | ||||
$ test -d a/b.orig | $ test -d a/b.orig | ||||
$ rm -rf a/b.orig | $ rm -rf a/b.orig | ||||
Update - local directory conflicts with remote symlink | Update - local directory conflicts with remote symlink | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ mkdir -p a/b/c | $ mkdir -p a/b/c | ||||
$ echo 9 > a/b/c/d | $ echo 9 > a/b/c/d | ||||
$ hg up link | $ hg up link | ||||
a/b: untracked directory conflicts with file | a/b: untracked directory conflicts with file | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg up link --config merge.checkunknown=warn | $ hg up link --config merge.checkunknown=warn | ||||
a/b: replacing untracked files in directory | a/b: replacing untracked files in directory | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark link) | (activating bookmark link) | ||||
#if symlink | #if symlink | ||||
$ readlink.py a/b | $ readlink.py a/b | ||||
a/b -> c | a/b -> c | ||||
#endif | #endif |
$ echo x > x | $ echo x > x | ||||
$ echo y > y | $ echo y > y | ||||
$ echo z > z | $ echo z > z | ||||
$ clearcache | $ clearcache | ||||
$ hg up tip | $ hg up tip | ||||
x: untracked file differs | x: untracked file differs | ||||
3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ hg revert --all | $ hg revert --all | ||||
# Test batch fetching of lookup files during hg status | # Test batch fetching of lookup files during hg status | ||||
$ hg up --clean tip | $ hg up --clean tip | ||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg debugrebuilddirstate | $ hg debugrebuilddirstate | ||||
$ clearcache | $ clearcache | ||||
$ hg status | $ hg status |
Local directory rename with conflicting file added in remote source directory | Local directory rename with conflicting file added in remote source directory | ||||
and untracked in local target directory. | and untracked in local target directory. | ||||
$ hg co -qC 1 | $ hg co -qC 1 | ||||
$ echo target > b/c | $ echo target > b/c | ||||
$ hg merge 2 | $ hg merge 2 | ||||
b/c: untracked file differs | b/c: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ cat b/c | $ cat b/c | ||||
target | target | ||||
but it should succeed if the content matches | but it should succeed if the content matches | ||||
$ hg cat -r 2 a/c > b/c | $ hg cat -r 2 a/c > b/c | ||||
$ hg merge 2 | $ hg merge 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg st -C | $ hg st -C |
merging file1 | merging file1 | ||||
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') | warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') | ||||
1 files updated, 0 files merged, 0 files removed, 1 files unresolved | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges | use 'hg resolve' to retry unresolved file merges | ||||
[1] | [1] | ||||
$ hg up 0 | $ hg up 0 | ||||
abort: outstanding merge conflicts | abort: outstanding merge conflicts | ||||
(use 'hg resolve' to resolve) | (use 'hg resolve' to resolve) | ||||
[255] | [20] | ||||
$ hg merge 2 | $ hg merge 2 | ||||
abort: outstanding merge conflicts | abort: outstanding merge conflicts | ||||
(use 'hg resolve' to resolve) | (use 'hg resolve' to resolve) | ||||
[255] | [20] | ||||
$ hg merge --force 2 | $ hg merge --force 2 | ||||
abort: outstanding merge conflicts | abort: outstanding merge conflicts | ||||
(use 'hg resolve' to resolve) | (use 'hg resolve' to resolve) | ||||
[255] | [20] | ||||
set up conflict-free merge | set up conflict-free merge | ||||
$ hg up -qC 3 | $ hg up -qC 3 | ||||
$ hg merge 1 | $ hg merge 1 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg up -qC 0 | $ hg up -qC 0 | ||||
$ echo untracked > b | $ echo untracked > b | ||||
$ hg st | $ hg st | ||||
? b | ? b | ||||
$ hg up 1 | $ hg up 1 | ||||
b: untracked file differs | b: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
$ rm b | $ rm b | ||||
test conflicting untracked ignored file | test conflicting untracked ignored file | ||||
$ hg up -qC 0 | $ hg up -qC 0 | ||||
$ echo ignored > .hgignore | $ echo ignored > .hgignore | ||||
$ hg add .hgignore | $ hg add .hgignore | ||||
$ hg ci -m 'add .hgignore' | $ hg ci -m 'add .hgignore' | ||||
created new head | created new head | ||||
$ echo ignored > ignored | $ echo ignored > ignored | ||||
$ hg add ignored | $ hg add ignored | ||||
$ hg ci -m 'add ignored file' | $ hg ci -m 'add ignored file' | ||||
$ hg up -q 'desc("add .hgignore")' | $ hg up -q 'desc("add .hgignore")' | ||||
$ echo untracked > ignored | $ echo untracked > ignored | ||||
$ hg st | $ hg st | ||||
$ hg up 'desc("add ignored file")' | $ hg up 'desc("add ignored file")' | ||||
ignored: untracked file differs | ignored: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | abort: untracked files in working directory differ from files in requested revision | ||||
[255] | [20] | ||||
test a local add | test a local add | ||||
$ cd .. | $ cd .. | ||||
$ hg init a | $ hg init a | ||||
$ hg init b | $ hg init b | ||||
$ echo a > a/a | $ echo a > a/a | ||||
$ echo a > b/a | $ echo a > b/a |
$ hg up -q 4 | $ hg up -q 4 | ||||
File conflict is not allowed | File conflict is not allowed | ||||
$ hg up -qC 3 | $ hg up -qC 3 | ||||
$ echo dirty >> a | $ echo dirty >> a | ||||
$ hg up -q 4 | $ hg up -q 4 | ||||
abort: conflicting changes | abort: conflicting changes | ||||
(commit or update --clean to discard changes) | (commit or update --clean to discard changes) | ||||
[255] | [20] | ||||
$ hg up -m 4 | $ hg up -m 4 | ||||
merging a | merging a | ||||
warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||||
0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges | use 'hg resolve' to retry unresolved file merges | ||||
[1] | [1] | ||||
$ rm a.orig | $ rm a.orig | ||||
$ hg status | $ hg status |