Windows & Mercurial change cases of class names
I have inherited a Java project which includes a number of classes that are not named according to the UpperCamelCase naming convention.
This is particularly the case with abbreviations (e.g. HTMLButton rather than HtmlButton). Whilst I know there are some differences of opinion on the use of CamelCase with abbreviations, we would like to switch to only using a capital letter for the first letter of the abbreviation. (Currently, there appear to be several simultaneous naming conventions.)
I'd like to tidy this up. We're using Mercurial as our source code repository and working on Windows machines (including XP, Vista, 7). However, if I change a class name from HTMLButton to HtmlButton, Mercurial recognises this as a class name change, but not as a file name change. (And subsequently any pulls from Mercurial don't pick up the file name change.)
I know that Windows works on a case-insenstive file system, and I understand that Mercurial picks up on this feature when accepting pushes from a Windows box...
So...: - Is there a setting I can change to get Mercurial to use case-sensitive file names? - Is there a setting I can change to get Windows to use case-sensitive file names? (These are separate questions. My priority is to get Mercurial to accept file name changes, if necessary, we can th开发者_开发问答en manually force file renames in our IDE. However, a straight-through solution would be preferred!)
(If all else fails, I might try renaming HTMLButton to HtmlButtonA, commit and push, and rename HtmlButtonA to HtmlButton, and do another commit and push... However, I'm not certain what impact this would have on Windows file names if someone else only did a pull after the second push...)
If you do:
hg rename foo bar
hg rename bar Foo
You don't need to actually commit and push until the end. In other words, your repository won't be aware of this Windows-specific workaround.
Another option is to rename the file in Windows, then invoke:
hg rename foo Foo --after
to notify Mercurial of the change.
Source: http://hgbook.red-bean.com/read/mercurial-in-daily-use.html#id364064
精彩评论