Search code examples
tortoisehg

Commit a file rename change in tortoise hg


I have a file materialCategory.php which I want to rename to MaterialCategory.php and commit that but tortoise doesn't notice a change when I rename the file to the same wording just with the first letter as uppercase instead of lowercase. I tried deleting the file, committing, adding the file again with the new name and committing that again but that also didn't work.

Is there a way to do that?


Solution

  • I'm assuming you are on Windows, because as far as I know this wouldn't happen on e.g. Linux. TortoiseHg honours the naming policy of the host OS, and as Windows treats materialCategory.php and MaterialCategory.php as being the same, so does Tortoise.

    Note that newer Windows versions are "Case preserving, but insensitive" so permit the distinction between the two, and allow the rename, but under the hood they map to the same filename, so you couldn't have both for example.

    The only way to achieve what you want is to rename the file to something else entirely, commit, then rename to what you want and commit again. Or move to Linux ;-)