I'm working with a project I inherited from a Windows guy. It's under Hg version control. It got some inconsistent filename convention which I'm trying to fix so I renamed a file named jquery.fullpage.js
to jquery.fullPage.js
(just uppercased "P") to adhere to the original author of that jQuery library.
However, Hg doesn't detect the lowercase-uppercase change as a rename or even as deleted/created file. As a result, I can't commit that change and push it live. It works locally but on the remote staging server where I pushed, it gives 404 errors. Apparently, the files on the remote weren't renamed to the uppercase P.
I know I can fix this by deleting the file, commit, restore the file and rename, commit again but that seems to be a crude way of fixing it.
How do I fix this?
Renaming a file doesn't change when it was modified.
This is a case folding problem. Try to rename the file through Mercurial: hg rename jquery.fullpage.js jquery.fullPage.js
.
If you're renaming a file you are good to go with hg rename
as already said.
However (at least on Windows), if you're renaming a folder then you can't rename it directly. The common workaround is to use an intermediate:
hg rename Foo tmp
hg rename tmp foo
Another workaround is using intermediate delete. But this is discouraged because you would lose the file history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With