2014-08-06 20:43:59 +04:00
|
|
|
#require icasefs
|
2011-12-16 16:21:27 +04:00
|
|
|
|
|
|
|
################################
|
|
|
|
test for branch merging
|
|
|
|
################################
|
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
test for rename awareness of case-folding collision check:
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
(1) colliding file is one renamed from collided file:
|
|
|
|
this is also case for issue3370.
|
2011-12-16 16:21:27 +04:00
|
|
|
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
$ hg init branch_merge_renaming
|
|
|
|
$ cd branch_merge_renaming
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
2013-04-30 00:01:32 +04:00
|
|
|
$ echo b > b
|
|
|
|
$ hg add b
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg commit -m '#0'
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
$ hg tag -l A
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg rename a tmp
|
|
|
|
$ hg rename tmp A
|
|
|
|
$ hg commit -m '#1'
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
$ hg tag -l B
|
2013-04-30 00:01:32 +04:00
|
|
|
$ hg update -q 0
|
|
|
|
$ touch x
|
|
|
|
$ hg add x
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg commit -m '#2'
|
|
|
|
created new head
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
$ hg tag -l C
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2013-04-30 00:01:32 +04:00
|
|
|
$ hg merge -q
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg status -A
|
|
|
|
M A
|
|
|
|
R a
|
2013-04-30 00:01:32 +04:00
|
|
|
C b
|
2013-04-30 00:01:32 +04:00
|
|
|
C x
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2013-04-30 00:01:32 +04:00
|
|
|
$ hg update -q --clean 1
|
|
|
|
$ hg merge -q
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg status -A
|
2013-04-30 00:01:32 +04:00
|
|
|
M x
|
|
|
|
C A
|
2013-04-30 00:01:32 +04:00
|
|
|
C b
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
$ hg commit -m '(D)'
|
|
|
|
$ hg tag -l D
|
|
|
|
|
|
|
|
additional test for issue3452:
|
|
|
|
|
|
|
|
| this assumes the history below.
|
|
|
|
|
|
|
|
|
| (A) -- (C) -- (E) -------
|
|
|
|
| \ \ \
|
|
|
|
| \ \ \
|
|
|
|
| (B) -- (D) -- (F) -- (G)
|
|
|
|
|
|
|
|
|
| A: add file 'a'
|
|
|
|
| B: rename from 'a' to 'A'
|
|
|
|
| C: add 'x' (or operation other than modification of 'a')
|
|
|
|
| D: merge C into B
|
|
|
|
| E: modify 'a'
|
|
|
|
| F: modify 'A'
|
|
|
|
| G: merge E into F
|
|
|
|
|
|
|
|
|
| issue3452 occurs when (B) is recorded before (C)
|
|
|
|
|
|
|
|
$ hg update -q --clean C
|
|
|
|
$ echo "modify 'a' at (E)" > a
|
2013-04-30 00:01:32 +04:00
|
|
|
$ echo "modify 'b' at (E)" > b
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
$ hg commit -m '(E)'
|
|
|
|
created new head
|
|
|
|
$ hg tag -l E
|
|
|
|
|
|
|
|
$ hg update -q --clean D
|
|
|
|
$ echo "modify 'A' at (F)" > A
|
|
|
|
$ hg commit -m '(F)'
|
|
|
|
$ hg tag -l F
|
|
|
|
|
|
|
|
$ hg merge -q --tool internal:other E
|
|
|
|
$ hg status -A
|
|
|
|
M A
|
|
|
|
a
|
2013-04-30 00:01:32 +04:00
|
|
|
M b
|
icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.
For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.
This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".
New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.
Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.
This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".
This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 00:01:32 +04:00
|
|
|
C x
|
|
|
|
$ cat A
|
|
|
|
modify 'a' at (E)
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2013-04-30 00:01:32 +04:00
|
|
|
test also the case that (B) is recorded after (C), to prevent
|
|
|
|
regression by changes in the future.
|
|
|
|
|
|
|
|
to avoid unexpected (successful) behavior by filelog unification,
|
|
|
|
target file is not 'a'/'A' but 'b'/'B' in this case.
|
|
|
|
|
|
|
|
$ hg update -q --clean A
|
|
|
|
$ hg rename b tmp
|
|
|
|
$ hg rename tmp B
|
|
|
|
$ hg commit -m '(B1)'
|
|
|
|
created new head
|
|
|
|
$ hg tag -l B1
|
|
|
|
|
|
|
|
$ hg merge -q C
|
|
|
|
$ hg status -A
|
|
|
|
M x
|
|
|
|
C B
|
|
|
|
C a
|
|
|
|
$ hg commit -m '(D1)'
|
|
|
|
$ hg tag -l D1
|
|
|
|
|
|
|
|
$ echo "modify 'B' at (F1)" > B
|
|
|
|
$ hg commit -m '(F1)'
|
|
|
|
$ hg tag -l F1
|
|
|
|
|
|
|
|
$ hg merge -q --tool internal:other E
|
|
|
|
$ hg status -A
|
|
|
|
M B
|
|
|
|
b
|
|
|
|
M a
|
|
|
|
C x
|
|
|
|
$ cat B
|
|
|
|
modify 'b' at (E)
|
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
$ cd ..
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
(2) colliding file is not related to collided file
|
|
|
|
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
$ hg init branch_merge_collding
|
|
|
|
$ cd branch_merge_collding
|
2012-04-15 20:11:29 +04:00
|
|
|
|
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m '#0'
|
|
|
|
$ hg remove a
|
|
|
|
$ hg commit -m '#1'
|
|
|
|
$ echo A > A
|
|
|
|
$ hg add A
|
|
|
|
$ hg commit -m '#2'
|
|
|
|
$ hg update --clean 0
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
$ echo x > x
|
|
|
|
$ hg add x
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg commit -m '#3'
|
|
|
|
created new head
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
$ echo 'modified at #4' > a
|
|
|
|
$ hg commit -m '#4'
|
2011-12-16 16:21:27 +04:00
|
|
|
|
|
|
|
$ hg merge
|
2017-08-23 21:30:25 +03:00
|
|
|
abort: case-folding collision between [aA] and [Aa] (re)
|
2011-12-16 16:21:27 +04:00
|
|
|
[255]
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg parents --template '{rev}\n'
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
4
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg status -A
|
|
|
|
C a
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
C x
|
2012-04-15 20:11:29 +04:00
|
|
|
$ cat a
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
modified at #4
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg update --clean 2
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg merge
|
2017-08-23 21:30:25 +03:00
|
|
|
abort: case-folding collision between [aA] and [Aa] (re)
|
2012-04-15 20:11:29 +04:00
|
|
|
[255]
|
2011-12-16 16:21:27 +04:00
|
|
|
$ hg parents --template '{rev}\n'
|
|
|
|
2
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg status -A
|
|
|
|
C A
|
|
|
|
$ cat A
|
|
|
|
A
|
|
|
|
|
icasefs: make case-folding collision detection as deletion aware (issue3648)
Before this patch, case-folding collision is checked simply between
manifests of each merged revisions.
So, files may be considered as colliding each other, even though one
of them is already deleted on one of merged branches: in such case,
merge causes deleting it, so case-folding collision doesn't occur.
This patch checks whether both of files colliding each other still
remain after merge or not, and ignores collision if at least one of
them is deleted by merge.
In the case that one of colliding files is deleted on one of merged
branches and changed on another, file is considered to still remain
after merge, even though it may be deleted by merge, if "deleting" of
it is chosen in "manifestmerge()".
This avoids fail to merge by case-folding collisions after choices
from "changing" and "deleting" of files.
This patch adds only tests for "removed remotely" code paths in
"_remains()", because other ones are tested by existing tests in
"test-casecollision-merge.t".
2012-10-31 11:50:22 +04:00
|
|
|
test for deletion awareness of case-folding collision check (issue3648):
|
|
|
|
revision '#3' doesn't change 'a', so 'a' should be recognized as
|
|
|
|
safely removed in merging between #2 and #3.
|
|
|
|
|
|
|
|
$ hg update --clean 3
|
|
|
|
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg merge 2
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg status -A
|
|
|
|
M A
|
|
|
|
R a
|
|
|
|
C x
|
|
|
|
|
|
|
|
$ hg update --clean 2
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg merge 3
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg status -A
|
|
|
|
M x
|
|
|
|
C A
|
|
|
|
|
2011-12-16 16:21:27 +04:00
|
|
|
$ cd ..
|
|
|
|
|
2015-10-13 01:16:25 +03:00
|
|
|
Prepare for tests of directory case-folding collisions
|
|
|
|
|
|
|
|
$ hg init directory-casing
|
|
|
|
$ cd directory-casing
|
|
|
|
$ touch 0 # test: file without directory
|
|
|
|
$ mkdir 0a
|
|
|
|
$ touch 0a/f
|
|
|
|
$ mkdir aA
|
|
|
|
$ touch aA/a
|
|
|
|
$ hg ci -Aqm0
|
|
|
|
|
|
|
|
Directory/file case-folding collision:
|
|
|
|
|
|
|
|
$ hg up -q null
|
|
|
|
$ touch 00 # test: starts as '0'
|
|
|
|
$ mkdir 000 # test: starts as '0'
|
|
|
|
$ touch 000/f
|
|
|
|
$ touch Aa # test: collision with 'aA/a'
|
|
|
|
$ hg ci -Aqm1
|
|
|
|
|
|
|
|
$ hg merge 0
|
2015-10-13 01:16:25 +03:00
|
|
|
abort: case-folding collision between Aa and directory of aA/a
|
2015-10-13 01:16:25 +03:00
|
|
|
[255]
|
|
|
|
(note: no collision between 0 and 00 or 000/f)
|
|
|
|
|
|
|
|
Directory case-folding collision:
|
|
|
|
|
|
|
|
$ hg up -qC null
|
|
|
|
$ hg --config extensions.purge= purge
|
|
|
|
$ mkdir 0A0
|
|
|
|
$ touch 0A0/f # test: starts as '0a'
|
|
|
|
$ mkdir Aa
|
|
|
|
$ touch Aa/b # test: collision with 'aA/a'
|
|
|
|
$ hg ci -Aqm2
|
|
|
|
|
|
|
|
$ hg merge 0
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
|
|
|
|
$ cd ..
|
2012-04-15 20:11:29 +04:00
|
|
|
|
2011-12-16 16:21:27 +04:00
|
|
|
################################
|
|
|
|
test for linear updates
|
|
|
|
################################
|
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
test for rename awareness of case-folding collision check:
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
(1) colliding file is one renamed from collided file
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg init linearupdate_renameaware_1
|
|
|
|
$ cd linearupdate_renameaware_1
|
2011-12-16 16:21:27 +04:00
|
|
|
|
2012-04-15 20:11:29 +04:00
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m '#0'
|
|
|
|
$ hg rename a tmp
|
|
|
|
$ hg rename tmp A
|
|
|
|
$ hg commit -m '#1'
|
|
|
|
|
|
|
|
$ hg update 0
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ echo 'this is added line' >> a
|
2011-12-16 16:21:27 +04:00
|
|
|
$ hg update 1
|
|
|
|
merging a and A to A
|
|
|
|
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -A
|
|
|
|
M A
|
|
|
|
$ cat A
|
2012-04-15 20:11:29 +04:00
|
|
|
a
|
2011-12-16 16:21:27 +04:00
|
|
|
this is added line
|
2012-04-15 20:11:29 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
(2) colliding file is not related to collided file
|
|
|
|
|
|
|
|
$ hg init linearupdate_renameaware_2
|
|
|
|
$ cd linearupdate_renameaware_2
|
|
|
|
|
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m '#0'
|
|
|
|
$ hg remove a
|
|
|
|
$ hg commit -m '#1'
|
|
|
|
$ echo A > A
|
|
|
|
$ hg add A
|
|
|
|
$ hg commit -m '#2'
|
|
|
|
|
|
|
|
$ hg update 0
|
2012-04-23 16:32:59 +04:00
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg parents --template '{rev}\n'
|
2012-04-23 16:32:59 +04:00
|
|
|
0
|
2012-04-15 20:11:29 +04:00
|
|
|
$ hg status -A
|
2012-04-23 16:32:59 +04:00
|
|
|
C a
|
2012-04-15 20:11:29 +04:00
|
|
|
$ cat A
|
2012-04-23 16:32:59 +04:00
|
|
|
a
|
|
|
|
$ hg up -qC 2
|
2012-04-15 20:11:29 +04:00
|
|
|
|
|
|
|
$ hg update --check 0
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg parents --template '{rev}\n'
|
|
|
|
0
|
|
|
|
$ hg status -A
|
|
|
|
C a
|
|
|
|
$ cat a
|
|
|
|
a
|
|
|
|
|
|
|
|
$ hg update --clean 2
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg parents --template '{rev}\n'
|
|
|
|
2
|
|
|
|
$ hg status -A
|
|
|
|
C A
|
|
|
|
$ cat A
|
|
|
|
A
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
(3) colliding file is not related to collided file: added in working dir
|
|
|
|
|
|
|
|
$ hg init linearupdate_renameaware_3
|
|
|
|
$ cd linearupdate_renameaware_3
|
|
|
|
|
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m '#0'
|
|
|
|
$ hg rename a b
|
|
|
|
$ hg commit -m '#1'
|
|
|
|
$ hg update 0
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ echo B > B
|
|
|
|
$ hg add B
|
|
|
|
$ hg status
|
|
|
|
A B
|
|
|
|
$ hg update
|
2017-08-23 21:30:25 +03:00
|
|
|
abort: case-folding collision between [bB] and [Bb] (re)
|
2012-04-15 20:11:29 +04:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg update --check
|
2013-09-24 07:33:02 +04:00
|
|
|
abort: uncommitted changes
|
2012-04-15 20:11:29 +04:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg update --clean
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg parents --template '{rev}\n'
|
|
|
|
1
|
|
|
|
$ hg status -A
|
|
|
|
C b
|
|
|
|
$ cat b
|
|
|
|
a
|
|
|
|
|
|
|
|
$ cd ..
|