Fossil SCM

Uppercase/lowercase issue on Windows

Closed

d6d16fe1aa586c3… · opened 11 years, 4 months ago

Type
Code_Defect
Priority
Severity
Minor
Resolution
Wont_Fix
Subsystem
Created
Dec. 8, 2014 10:25 p.m.

Prerequisite:
Usage of fossil under Microsoft Windows, where case sensitivity is disabled by default.

Problem description:
When the name of a directory is changed by just altering some characters from lowercase to uppercase (or vice versa), the outputs of the timeline and files listings look strange, showing a wild mix of files in a directory with the old name and in a directory with the new name. Both directory names may show up several times in an alternating manner which is not only confusing to the user but does not reflect the actual situation in the file system itself. This is valid even when looking at just a single check-in, e.g. trunk, not the "all" files link.

It appears that fossil is (at least partially) aware of both the old and the new names and differentiates them internally where it shouldn't do so (or where it should use just the new name), leading to the mangled output. Assumption(!): the actual files are simply listed alphabetically, but as some of them "belong" to the previous directory name, and others are linked to the new name, both names are unnecessarily inserted as hierarchy elements on each switch between both.

More information:
* The issue was originally discussed here: message on mailing list * A "minimum example" repository which demonstrates the problem is available here: demo repository

Problem recreation:
The following code (save as a batch file under Windows, with ".cmd" file extension) creates the repository linked above.


@echo off
rem The following script was provided by Ross Berteig. Thanks!

rem Run this in an empty folder where it is safe to create and use a
rem fossil repository.
fossil new abc.fossil
fossil open abc.fossil
mkdir A
cd A
echo a >a.txt
echo c >c.txt
echo e >e.txt
echo g >g.txt
echo i >i.txt
fossil add *
fossil ci --no-warnings -m "Uppercase A" --tag "UPPERCASE"
cd ..

rem Rename "A" to "a" via an intermediate name since batch files
rem apparently can't do that in one step.
move A b
move b a

rem Attempt to simply tell fossil about the name change. This fails.
fossil rename A a

cd a
echo b >b.txt
echo d >d.txt
echo f >f.txt
echo h >h.txt
echo i >i.txt

fossil add *
fossil ci --no-warnings -m "Lowercase A" --tag "lowercase"
cd ..

echo Note that both "A" and "a" are present
fossil ls

echo Now look at the Timeline and Files pages
fossil ui
pause

Comments (2)

nobody 11 years, 4 months ago

Prerequisite:
Usage of fossil under Microsoft Windows, where case sensitivity is disabled by default.

Problem description:
When the name of a directory is changed by just altering some characters from lowercase to uppercase (or vice versa), the outputs of the timeline and files listings look strange, showing a wild mix of files in a directory with the old name and in a directory with the new name. Both directory names may show up several times in an alternating manner which is not only confusing to the user but does not reflect the actual situation in the file system itself. This is valid even when looking at just a single check-in, e.g. trunk, not the "all" files link.

It appears that fossil is (at least partially) aware of both the old and the new names and differentiates them internally where it shouldn't do so (or where it should use just the new name), leading to the mangled output. Assumption(!): the actual files are simply listed alphabetically, but as some of them "belong" to the previous directory name, and others are linked to the new name, both names are unnecessarily inserted as hierarchy elements on each switch between both.

More information:
* The issue was originally discussed here: message on mailing list * A "minimum example" repository which demonstrates the problem is available here: demo repository

Problem recreation:
The following code (save as a batch file under Windows, with ".cmd" file extension) creates the repository linked above.


@echo off
rem The following script was provided by Ross Berteig. Thanks!

rem Run this in an empty folder where it is safe to create and use a
rem fossil repository.
fossil new abc.fossil
fossil open abc.fossil
mkdir A
cd A
echo a >a.txt
echo c >c.txt
echo e >e.txt
echo g >g.txt
echo i >i.txt
fossil add *
fossil ci --no-warnings -m "Uppercase A" --tag "UPPERCASE"
cd ..

rem Rename "A" to "a" via an intermediate name since batch files
rem apparently can't do that in one step.
move A b
move b a

rem Attempt to simply tell fossil about the name change. This fails.
fossil rename A a

cd a
echo b >b.txt
echo d >d.txt
echo f >f.txt
echo h >h.txt
echo i >i.txt

fossil add *
fossil ci --no-warnings -m "Lowercase A" --tag "lowercase"
cd ..

echo Note that both "A" and "a" are present
fossil ls

echo Now look at the Timeline and Files pages
fossil ui
pause

drh 11 years, 4 months ago

I don't have any idea how to fix this on Windows without simultaneously breaking it on Unix. My advice: always use the same capitalization on Windows.

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button