Commit Graph

11 Commits

Author SHA1 Message Date
Mads Kiilerich
b919454f81 merge: abort on file/directory case folding collisions (issue4892)
File/directory case folding collisions cannot be represented on case folding
systems and have to fail.

To detect this and abort early, utilize that for file/directory collisions, a
sorted list of case folded manifest names will have the colliding directory
right after the file.

(This could perhaps be optimized, but this way of doing it also has
directory/directory case folding in mind ... which however not is handled yet.)
2015-10-13 00:16:25 +02:00
Mads Kiilerich
ef284c9302 tests: test of case-folding merge collisions 2015-10-13 00:16:25 +02:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Siddharth Agarwal
663145e3f0 update: standardize error message for dirty update --check
This and following patches will standardize the error message for dirty working
directories to "uncommitted changes".
2013-09-23 20:33:02 -07:00
FUJIWARA Katsunori
693a1ef129 icasefs: enhance test to prevent regression by changes in the future
This patch adds steps to test case-folding collision detection on the
revision tree built up in the order different from the one reproducing
issue3452.

This may prevent regression by changes around "copy detection" and/or
"case-folding collision detection" logic in the future.
2013-04-30 05:01:32 +09:00
FUJIWARA Katsunori
baa57a476c 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 05:01:32 +09:00
FUJIWARA Katsunori
bc5d48aa84 icasefs: refactor "test-casecollision-merge.t" to reuse in succeeding fixes
This patch refactors "test-casecollision-merge.t" to increase
reusability in succeeding patches.

It is confirmed that changed test also can detect issue3370.
2013-04-30 05:01:32 +09:00
FUJIWARA Katsunori
2cf8855a64 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 16:50:22 +09:00
Patrick Mezard
d7a11b26ae update: fix case-collision with a clean wd and no --clean
a317664437ee introduced some logic to avoid case-collision detection between
source and destination revisions when it does not make sense: clean or to be
cleaned working directories. Unfortunately, part of it was flawed and the
related test was broken by another bug.

This patch disables cross revision case collision detection for updates without
option or with --check, if the working directory is clean.
2012-04-23 14:32:59 +02:00
FUJIWARA Katsunori
15d40e6d68 icasefs: make case-folding collision detection as rename aware (issue3370)
if the file in target context causes case-folding collision against
one in working context, current implementation aborts merging with it,
even thouhg collding one (in target) is the file renamed from collided
one (in working).

this patch uses file copy information to know whether colliding file
is renamed from collided one or not: if so, collision between them is
ignored.

this patch also avoids collision detection between current context and
target context, if working context is clean (with --check/-c) or will
be clean (with --clean/-C).
2012-04-16 01:11:29 +09:00
FUJIWARA Katsunori
1a00d3603f merge: check filename case collision between changesets for branch merging
this patch makes branch merging abort when merged changesets have same
file in different case on case insensitive filesystem.

this patch does not prevent linear update which merges between target
and working contexts, because 'branchmerge' is False in such case.
2011-12-16 21:21:27 +09:00