Felix Dombek
Felix Dombek

Reputation: 14372

Can I replace Unix line endings with Windows line endings on the commandline?

I'm fiddling around with the hg log command to store the mercurial messages in a file, such as this (lines broken for readability):

hg log --template "Rev. {rev} from {date|rfc822date}:
    \r\n--------------------------------------------
    \r\n\t{desc|strip|fill68|tabindent}\r\n\r\n\r\n" > hglog.txt

The problem is with the fill68 filter which breaks lines after 68 chars. In theory, that is, because those line breaks are Unix line breaks and are not displayed in Notepad.

Is there a way to replace \n with \r\n, by piping hg log's output through another command maybe?

I wish to run this command in an automated VS post-build script, so I can't do this manually.

Upvotes: 1

Views: 222

Answers (1)

neif
neif

Reputation: 510

From Windows you can invoke the MORE command as specified here:

hg log ... | more /p > hglog.txt

Upvotes: 1

Related Questions