eol

CVS to Mercurial conversion: end of line problem

ぐ巨炮叔叔 提交于 2019-12-01 05:50:07
I recently converted a CVS repository to Mercurial. From the looks of it, everything went perfect. Except that every end-of-line character is in Unix style and I want them in Windows style. I know the hg convert command can be used to "convert" a Mercurial repository to a Mercurial repository. Can I use it to do nothing on the repos but fix the line endings? Ry4an Brase How they're stored in the repo isn't terribly important since you do your actual work with the checked out working directory, whose line endings you can control at update time using either of these extensions:

Fixing the line-endings in a Git repository using the `.gitattributes` file

我的未来我决定 提交于 2019-12-01 05:29:08
问题 What needs fixing: I have a repository containing a single .md file, which contains an essay I am writing. I edit the file from a few different computers, one running Linux and a couple running Windows. Looking at a git diff in Windows now where I have made some changes, I can see my essay showing as nicely separated lines of text ... all about to be removed and replaced by one long line where what were paragraphs are separated by ^M s. I'm aware that ^M refers to Windows' CLRF line endings.

CVS to Mercurial conversion: end of line problem

拟墨画扇 提交于 2019-12-01 04:01:07
问题 I recently converted a CVS repository to Mercurial. From the looks of it, everything went perfect. Except that every end-of-line character is in Unix style and I want them in Windows style. I know the hg convert command can be used to "convert" a Mercurial repository to a Mercurial repository. Can I use it to do nothing on the repos but fix the line endings? 回答1: How they're stored in the repo isn't terribly important since you do your actual work with the checked out working directory, whose

How can I convert all line endings to CRLF, LF, or CR during SVN operations

被刻印的时光 ゝ 提交于 2019-11-29 16:52:46
问题 So, you are all ready to do a big SVN Commit and it bombs because you have inconsistent line endings in some of your files. Fun part is, you're looking at 1,000s of files spanning dozens of folders of different depths. What do you do? 回答1: I don't think the pre-commit hook can actually change the data that is being committed - it can disallow a commit, but I don't think it can do the conversion for you. It sounds like you want the property 'svn:eol-style' set to 'native' - this will

Python file.write creating extra carriage return

落花浮王杯 提交于 2019-11-29 03:38:38
I'm writing a series of SQL statements to a file using python. The template string looks like: store_insert = '\tinsert stores (storenum, ...) values (\'%s\', ...)' I'm writing to the file like so: for line in source: line = line.rstrip() fields = line.split('\t') script.write(store_insert % tuple(fields)) script.write(os.linesep) However, in the resulting output, I see \r\r\n at the end of each line, rather than \r\n as I would expect. Why? \n is converted to os.linesep for files opened in text-mode. So when you write os.linesep to a text-mode file on Windows, you write \r\n , and the \n gets

How do I use System.getProperty(“line.separator”).toString()?

本秂侑毒 提交于 2019-11-29 02:36:59
问题 I have a Tab-delimited String (representing a table) that is passed to my method. When I print it to the command line, it appears like a table with rows: http://i.stack.imgur.com/2fAyq.gif The command window is correctly buffered. My thinking is that there is definitely a new line character before or after each row. My problem is that I want to split up the incoming string into individual strings representing the rows of the table. So far I have: private static final String newLine = System

Carriage Return\\Line feed in Java

一个人想着一个人 提交于 2019-11-28 16:39:01
I have created a text file in Unix environment using Java code. For writing the text file I am using java.io.FileWriter and BufferedWriter . And for newline after each row I am using bw.newLine() method (where bw is object of BufferedWriter ). And I'm sending that text file by attaching in mail from Unix environment itself (automated that using Unix commands). My issue is, after I download the text file from mail in a Windows system, if I opened that text file the data is not properly aligned. newline() character is not working, I think so. I want same text file alignment as it is in Unix

Windows CRLF to Unix LF Issues in Vagrant

痴心易碎 提交于 2019-11-27 13:46:59
问题 I'm working on provisioning a few VMs using Vagrant . Here's the situation: Host : Windows 7 (64-bit) Guest : Ubuntu 14.04 (64-bit) I am having an issue getting the CRLF line endings to convert to LFs. This is causing the bash scripts in the shared folder to fail within the guest machine (see below). vagrant@vagrant-host:/vagrant/bin$ sudo bash build-ubuntu-14.04.1-c make.sh build-ubuntu-14.04.1-cmake.sh: line 5: $'\r': command not found build-ubuntu-14.04.1-cmake.sh: line 19: $'\r': command

Regular Expression to match cross platform newline characters

那年仲夏 提交于 2019-11-27 11:38:41
My program can accept data that has newline characters of \n, \r\n or \r (eg Unix, PC or Mac styles) What is the best way to construct a regular expression that will match whatever the encoding is? Alternatively, I could use universal_newline support on input, but now I'm interested to see what the regex would be. The regex I use when I want to be precise is "\r\n?|\n" . When I'm not concerned about consistency or empty lines, I use "[\r\n]+" , I imagine it makes my programs somewhere in the order of 0.2% faster. The pattern can be simplified to \r?\n for a little performance gain, as you

Carriage Return\Line feed in Java

試著忘記壹切 提交于 2019-11-27 10:01:31
问题 I have created a text file in Unix environment using Java code. For writing the text file I am using java.io.FileWriter and BufferedWriter . And for newline after each row I am using bw.newLine() method (where bw is object of BufferedWriter ). And I'm sending that text file by attaching in mail from Unix environment itself (automated that using Unix commands). My issue is, after I download the text file from mail in a Windows system, if I opened that text file the data is not properly aligned