Bug 2167 - -R can confuse Mercurial on case-insensitive systems
Summary: -R can confuse Mercurial on case-insensitive systems
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 17:52 UTC by Phi
Modified: 2012-09-30 16:19 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phi 2010-04-29 17:52 UTC
1: hg -R c:\ws\codeplex\visualhg st C:\ws\codeplex\visualhg
 returns 'abort: C:\ws\codeplex\visualhg not under root'

2: hg -R c:\ws\codeplex\visualhg st c:\ws\codeplex\visualhg
 returns good results

hg works when the drive letter case match. 

I tested on Windows 7 with hg 1.5.1, and on Windows 2003 with hg 1.4.3
Comment 1 Phi 2010-04-29 18:07 UTC
My current working directory is not c:\ws\codeplex\visualhg when I do these
tests.

more tests: 
hg -R c:\ws\codeplex\visualhg st C:\ws\codeplex\visualhg\Solution\Readme.txt
abort: C:\ws\codeplex\visualhg\Solution\Readme.txt not under root

hg -R C:\ws\codeplex\visualhg st -A C:\ws\codeplex\visualhg\Solution\Readme.txt
C ..\..\ws\codeplex\visualhg\Solution\Readme.txt

hg -R c:\ws\codeplex\visualhg st -A c:\ws\codeplex\visualhg\Solution\Readme.txt
C c:\ws\codeplex\visualhg\Solution\Readme.txt
Comment 2 Matt Mackall 2012-01-31 19:16 UTC
Presumed fixed.
Comment 3 Phi 2012-01-31 19:44 UTC
Still an issue with Mercurial 2.0.2 on Windows 7
Comment 4 Matt Mackall 2012-02-01 00:04 UTC
Confirmed. This turns out to be a more general problem, expanding title.

Both canonpath and pathto do naive case-sensitive comparisons between paths,
including the user-supplied repository root, getcwd(), and user-supplied
file paths. Differences in case can result in strange behavior.

Fixing this turns out to be quite difficult, especially in util.pathto,
which isn't aware of whether casefolding is in effect.
Comment 5 FUJIWARA Katsunori 2012-02-01 00:32 UTC
I think issue3146 also comes from same reason of this issue.

In addition to canonpath()/pathto(), "path.startswith(root)" invocations
in many places to check whether path is ROOTED or not seems to be also
one of reasons for this kind problems.
Comment 6 FUJIWARA Katsunori 2012-02-02 08:30 UTC
issue2285 is also duplicate of this issue, is not ?
Comment 7 Matt Mackall 2012-02-02 12:03 UTC
Adding nosy from 2285
Comment 8 Bugzilla 2012-05-12 09:08 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:08 EDT  ---

This bug was previously known as _bug_ 2167 at http://mercurial.selenic.com/bts/issue2167
Comment 9 Adrian Buehlmann 2012-06-08 09:37 UTC
The testsuite on Windows as of 2255950e1f76 triggers this bug here in a massive way, as documented on

   http://bz.selenic.com/show_bug.cgi?id=3490

For the testsuite, I have submitted a workaround patch.
Comment 10 Matt Mackall 2012-07-29 15:05 UTC
Possibly fixed in stable by:

21e18c608b68 scmutil: change canonpath to use util.samefile
Comment 11 Matt Mackall 2012-09-30 16:19 UTC
Mass close old bugs in testing.