[Bug 4199 - Warn on case-changing rename on Windows]
Matt Harbison
mharbison72 at gmail.com
Wed Dec 2 03:08:55 UTC 2015
On Thu, 19 Nov 2015 08:09:04 -0500, Piotr Listkiewicz
<piotr.listkiewicz at gmail.com> wrote:
> Hi,
> i would like to work on this issue but i don't get what is valid
> solution to this problem from discussion. Should hg warn
> when user want to add file with same name without removing
> file that only differs in case?
Based on comment #5 in the bug, I think it does this already.
> What about
> 'hg rename NAME.XYZ name.xyz' - should it warn or not?
I'd say no, because only one or the other exists at any given time. The
reporter apparently got into trouble by using rename (OK), but then
explicitly committing only the new file (bad). That effectively turns the
rename into a copy I guess. I'm not sure how valid that transformation
is- maybe commit can check if only part of a rename is being committed,
and abort? (Maybe with a (BC) flag? Get other's opinions before spending
time on that. At least this would avoid case collision checking on
commit.)
Note that comment #5 mentions `hg copy` not giving a warning- that you can
probably fix separately.
> Another
> option is aborting the commit which would cause case-folding name
> collision. And lastly how can i check if hg is running in case-sensitive
> system or not?
See util.checkcase().
It looks like the ui.portablefilenames setting changes behaviors for
different scenarios, including case collisions, so you'll want to keep
that in mind too. See how cmdutil.add() uses
scmutil.checkportabilityalert() and scmutil.casecollisionauditor().
More information about the Mercurial-devel
mailing list