Fossil SCM

Under Windows, renamed file keeps getting "ADDED".

Closed

85017e9273ca812… · opened 13 years, 1 month ago

Type
Code_Defect
Priority
Severity
Minor
Resolution
Fixed
Subsystem
Created
April 12, 2013 2:26 p.m. UTC

fossil init test fossil open test echo. > a.Txt fossil add . fossil commit -m test

ren a.Txt a.txt

fossil add . => ADDED a.txt which is ok.

fossil add . => ADDED a.txt "a.txt" will be mentionned everytime from now on.

Comments (8)

nobody 13 years, 1 month ago

fossil init test fossil open test echo. > a.Txt fossil add . fossil commit -m test

ren a.Txt a.txt

fossil add . => ADDED a.txt which is ok.

fossil add . => ADDED a.txt "a.txt" will be mentionned everytime from now on.

nobody 13 years, 1 month ago

This occurs because file names are case sensitive. Execute this command:

fossil rename a.Txt a.txt

and you will see this problem disappear.

nobody 13 years, 1 month ago

Thanks for the info.

But under Linux, change the case of an existing file and it will only be added once. Which is ok.

Under Windows, it keeps getting added everytime. Which would make me think there is some case-related issue under Windows.

jan.nijtmans 13 years, 1 month ago

Even though it's a minor bug, I think I found the cause. See [d0764530d3] for the suggested fix.

The function vfile_scan() is documented to "Omit files named in VFILE", but this is not done case-insensitive on Windows. This also means that "fossil extras" and "fossil clean" need the --case-sensitive option, just like "fossil add" and "fossil addremove".

Please evaluate. Does this change have any side-effects I didn't think of?

nobody 13 years, 1 month ago

Thank you for the patch. I have made a few tests and it seems to work fine.

Sorry to ask, but is this ok in add_cmd() ?

if( caseSensitive ){ db_multi_exec( "CREATE INDEX IF NOT EXISTS vfile_pathname " " ON vfile(pathname COLLATE nocase)" );

}
jan.nijtmans 13 years, 1 month ago

Fixed on trunk now.

Sorry to ask, but is this ok in add_cmd() ?

Yes, I think it is: The index is only needed when case-sensitive is off. On Windows, "case-sensitive" should be always off, on Cygwin it should be switchable (which is done in [9359b41fd5]), but that's unrelated to this buglet.

jan.nijtmans 13 years, 1 month ago

Sorry to ask, but is this ok in add_cmd() ?

Oops, you are right: the if expression should be opposite! Thanks for catching this!

jan.nijtmans 13 years, 1 month ago

Fixed now

Keyboard Shortcuts

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