I just wanted to share my experience with the mercurial checkout. I cloned http://code.python.org/hg/branches/py3k to continue work on http://bugs.python.org/issue1578269 but I found that when I click on PC/VS8.0/pcbuild.sln, nothing happens. This appears to be due to a bug/limitation in vslauncher in that it doesn't recognize LF as a line separator. vslauncher is the default association for sln files and its purpose is to parse out the .sln file and launch it with the appropriate Visual Studio version based on the header. What makes matters worse is if vslauncher fails to recognize the format, it does nothing, so it just appears as if the file fails to launch anything. It seems that within the hg repository, everything has been converted to LF for line endings. I suspect this is because HG provides no integrated support for line-ending conversions and because the hg to svn bridge is probably running on a Unix OS. So converting the pcbuild.sln file to CRLF line endings resolved the problem and the file would launch normally. Also, without conversion, it was possible to open the .sln file in Visual Studio explicitly. I wanted to share this with the community in case anyone else runs into this issue. Also, if there's a recommended procedure for addressing this issue (and others that might arise due to non-native line endings), I'd be interested to hear it. Regards, Jason
On Thu, Jun 04, 2009 at 09:02:53AM -0400, Jason R. Coombs wrote:
It seems that within the hg repository, everything has been converted to LF for line endings. I suspect this is because HG provides no integrated support for line-ending conversions and because the hg to svn bridge is probably running on a Unix OS.
http://www.selenic.com/mercurial/wiki/FAQ#FAQ.2BAC8-TechnicalDetails.What_ab... Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
On Thu, 4 Jun 2009 at 17:30, Oleg Broytmann wrote:
On Thu, Jun 04, 2009 at 09:02:53AM -0400, Jason R. Coombs wrote:
It seems that within the hg repository, everything has been converted to LF for line endings. I suspect this is because HG provides no integrated support for line-ending conversions and because the hg to svn bridge is probably running on a Unix OS.
http://www.selenic.com/mercurial/wiki/FAQ#FAQ.2BAC8-TechnicalDetails.What_ab...
Linked from that is: http://www.selenic.com/mercurial/wiki/Win32TextExtension which says: "The filter specification can however not be managed by the repository..." (I'm not clear what is being filtered on, but it looks like it might be the _content_ of the files.) The above statement seems like a really odd design choice, with the potential for causing considerable developer coordination headaches. Any Mercurial boffins want to talk about how this works in practice? --David
On Thu, Jun 4, 2009 at 3:49 PM, R. David Murray <rdmurray@bitdance.com> wrote:
The above statement seems like a really odd design choice, with the potential for causing considerable developer coordination headaches.
Any Mercurial boffins want to talk about how this works in practice?
I'm guessing that's just because it uses Mercurial's built-in configuration file chain (.hg/hgrc, ~/.hgrc and /etc/mercurial/hgrc). Those aren't transmitted with repositories because they can contain potentially security-sensitive information (like triggers for executing interesting hooks and information on what users to trust). It would certainly be possible to write a modified win32text-like extension that takes its cues from a versioned file (like the .hgtags and .hgsigs files currently supported). I'm not sure why the original author didn't go that way, though. Cheers, Dirkjan
On Thu, Jun 4, 2009 at 3:02 PM, Jason R. Coombs <jaraco@jaraco.com> wrote:
I wanted to share this with the community in case anyone else runs into this issue. Also, if there's a recommended procedure for addressing this issue (and others that might arise due to non-native line endings), I'd be interested to hear it.
Mercurial comes with a win32text extension that helps resolve issues like these. It allows you to specify in the .hg/hgrc that .sln files should always be expanded to CRLF. Cheers, Dirkjan
2009/6/4 Dirkjan Ochtman <dirkjan@ochtman.nl>:
On Thu, Jun 4, 2009 at 3:02 PM, Jason R. Coombs <jaraco@jaraco.com> wrote:
I wanted to share this with the community in case anyone else runs into this issue. Also, if there's a recommended procedure for addressing this issue (and others that might arise due to non-native line endings), I'd be interested to hear it.
Mercurial comes with a win32text extension that helps resolve issues like these. It allows you to specify in the .hg/hgrc that .sln files should always be expanded to CRLF.
Silly question, but given that Mercurial itself does *no* conversion, and CRLF is the only valid form for that file, why shouldn't the file be checked into the repository with CRLF endings, and that's the end of it (apart from misconfigured win32text setups on the client)? Ideally, the history should be imported with CRLF throughout, which is a task for the migration process. If that's too hard because of limitations in the available conversion tools, then maybe the limitation has to be accepted that pre-conversion copies of the file have incorrect line endings and a manual fiox is committed right after the switchover. Doesn't help the current Mercurial mirrors, of course, but at least this report alerts us to a consideration for the final switchover. Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all... Paul.
On Thu, Jun 04, 2009 at 03:20:56PM +0100, Paul Moore wrote:
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all...
Subversion has a built-in notion of eol-conversion (don't know if it was used for this particular file). Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
On Thu, Jun 4, 2009 at 4:20 PM, Paul Moore <p.f.moore@gmail.com> wrote:
Silly question, but given that Mercurial itself does *no* conversion, and CRLF is the only valid form for that file, why shouldn't the file be checked into the repository with CRLF endings, and that's the end of it (apart from misconfigured win32text setups on the client)?
That's certainly a valid setup, and I wasn't suggesting otherwise. I have no experience with .sln files, and I haven't really used win32text either; I was just commenting on the general facilities of Mercurial wrt these kinds of issues.
Ideally, the history should be imported with CRLF throughout, which is a task for the migration process. If that's too hard because of limitations in the available conversion tools, then maybe the limitation has to be accepted that pre-conversion copies of the file have incorrect line endings and a manual fiox is committed right after the switchover.
Importing it with CRLF throughout would certainly be possible. I'll add a section to my draft PEP.
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all...
Yes, it certainly seems that way. Cheers, Dirkjan
Dirkjan Ochtman wrote:
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all...
Yes, it certainly seems that way.
Except it isn't a binary file - it's a text file with CRLF line endings. Why would we throw away the chance to get meaningful diffs when Subversion can easily get the line endings correct? Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------
2009/6/5 Nick Coghlan <ncoghlan@gmail.com>:
Dirkjan Ochtman wrote:
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all...
Yes, it certainly seems that way.
Except it isn't a binary file - it's a text file with CRLF line endings. Why would we throw away the chance to get meaningful diffs when Subversion can easily get the line endings correct?
Fair point - I hadn't thought of it in that context. I wonder if Mercurial can treat it as a specialised form of binary file with custom diff/merge behaviour (which just happens to be "treat as text")? Of course, if that also requires client-side configuration, it's no better solution than win32text. I've a feeling I've seen discussions of versioned metadata (things like file properties) in Mercurial at some point in the past, but my Google skills are failing me at the moment... Paul.
Paul Moore wrote:
2009/6/5 Nick Coghlan <ncoghlan@gmail.com>:
Dirkjan Ochtman wrote:
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all... Yes, it certainly seems that way. Except it isn't a binary file - it's a text file with CRLF line endings. Why would we throw away the chance to get meaningful diffs when Subversion can easily get the line endings correct?
Fair point - I hadn't thought of it in that context. I wonder if Mercurial can treat it as a specialised form of binary file with custom diff/merge behaviour (which just happens to be "treat as text")? Of course, if that also requires client-side configuration, it's no better solution than win32text.
I've a feeling I've seen discussions of versioned metadata (things like file properties) in Mercurial at some point in the past, but my Google skills are failing me at the moment...
I've looked into this recently. IIUC: * There has been some limited support expressed for having win32text look in a normal versioned file for hints about the current repo. * Once concern here was the fact that such config files are somewhat 'untrusted', but the hg config parsing code has recently been reimplemented to support the concept of 'trusted' versus 'untrusted' options. I'm not sure what this means in practice though. * There isn't currently much activity on win32text. None of the core hg devs seem to use Windows, so while they are receptive to Windows patches, it might be necessary to be quite noisy to get attention. I recently submitted some changes to the filtering for Windows which were accepted without any angst, and the ability to use a versioned file for per-repo rules is something I'd like too. I believe that if a few Windows users got together and agreed on both semantics and implementation we could get such an enhancement landed in the core of hg... Cheers, Mark
2009/6/6 Mark Hammond <skippy.hammond@gmail.com>:
Paul Moore wrote:
2009/6/5 Nick Coghlan <ncoghlan@gmail.com>:
Dirkjan Ochtman wrote:
Essentially, pcbuild.sln is a binary file, and should be treated as such. Maybe it's an error in the Subversion setup that it's treated as text at all...
Yes, it certainly seems that way.
Except it isn't a binary file - it's a text file with CRLF line endings. Why would we throw away the chance to get meaningful diffs when Subversion can easily get the line endings correct?
Fair point - I hadn't thought of it in that context. I wonder if Mercurial can treat it as a specialised form of binary file with custom diff/merge behaviour (which just happens to be "treat as text")? Of course, if that also requires client-side configuration, it's no better solution than win32text.
I've a feeling I've seen discussions of versioned metadata (things like file properties) in Mercurial at some point in the past, but my Google skills are failing me at the moment...
I've looked into this recently. IIUC:
* There has been some limited support expressed for having win32text look in a normal versioned file for hints about the current repo.
* Once concern here was the fact that such config files are somewhat 'untrusted', but the hg config parsing code has recently been reimplemented to support the concept of 'trusted' versus 'untrusted' options. I'm not sure what this means in practice though.
* There isn't currently much activity on win32text. None of the core hg devs seem to use Windows, so while they are receptive to Windows patches, it might be necessary to be quite noisy to get attention.
I recently submitted some changes to the filtering for Windows which were accepted without any angst, and the ability to use a versioned file for per-repo rules is something I'd like too. I believe that if a few Windows users got together and agreed on both semantics and implementation we could get such an enhancement landed in the core of hg...
I'm willing to help on this, but I don't personally use win32text (my approach is to have all files always in Unix line-ending format, which every tool I use handles fine). So take any design suggestions I might make with a pinch of salt :-) Paul.
participants (7)
-
Dirkjan Ochtman
-
Jason R. Coombs
-
Mark Hammond
-
Nick Coghlan
-
Oleg Broytmann
-
Paul Moore
-
R. David Murray