Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

shellext: Overlays: convert all incoming paths to lowercase

closes #867

Changeset 782189b23886

Parent 4ffd4faae331

by Adrian Buehlmann

Changes to 3 files · Browse files at 782189b23886 Showing diff from parent 4ffd4faae331 Diff from another changeset...

 
36
37
38
39
 
 
 
 
 
 
 
 
40
41
42
 
36
37
38
 
39
40
41
42
43
44
45
46
47
48
49
@@ -36,7 +36,14 @@
  if (GetRegistryConfig("EnableOverlays", cval) != 0 && cval == "0")   return S_FALSE;   - std::string path = WideToMultibyte(pwszPath); + // This overlay handler processes all filenames in lowercase, so that a path + // "C:\FOO\BAR\Baz.TXT" will be considered equal to "C:\foo\bar\baz.txt" + // (note that mercurial preserves the case of filenames in .hg/dirstate) + + std::wstring lowerpath(pwszPath); + ::CharLowerW(const_cast<wchar_t*>(lowerpath.c_str())); + + std::string path = WideToMultibyte(lowerpath.c_str());     if (GetRegistryConfig("LocalDisksOnly", cval) != 0 && cval != "0"   && PathIsNetworkPath(path.c_str()))
 
116
117
118
 
119
120
121
 
116
117
118
119
120
121
122
@@ -116,6 +116,7 @@
  if (line.size() > 1)   {   path = line.c_str() + 1; + ::CharLower(const_cast<char*>(path.c_str()));   }   path.push_back('/');  
 
42
43
44
 
 
45
46
47
 
42
43
44
45
46
47
48
49
@@ -42,6 +42,8 @@
  fread(&relpath[0], sizeof(char), length, f);   relpath[length] = 0;   + ::CharLowerBuff(&relpath[0], length); +   return 1;  }