Re: `mtn cat` garbling Windows newlines

Stephen Leake <[email protected]>
Newsgroups gmane.comp.version-control.monotone.devel
Message-ID <[email protected]>
[email protected] writes:

> Hi all,
> I've just pushed 'nvm.cat-garbling-newlines' which contains a test for
> mtn cat` output. The test passes on Linux which matches usage from
> Java and a terminal. However, I'm unable to build or run the test on a
> Windows machine, where the original "problem" was found.

Please add your checkin comment to the issue (211), so the info is
preserved in a more accessible form.


> Could someone run "./run_func_tests cat_do" for me on a Windows build?

It fails; there is an extra CR in stdout:

stephe@takver$ dump numbers
numbers:
00000000  310d 0a32 0d0a                          1..2..
stephe@takver$ dump stdout
stdout:
00000000  310d 0d0a 320d 0d0a                     1...2...
stephe@takver$ dump expected
expected:
00000000  310d 0a32 0d0a                          1..2..

> Also, does anyone have any opinions on the matter?

Using automate is the prefered way for front-ends to access mtn. That
said, I agree 'mtn cat' should not add newlines.

The problem does seem to be cmd_files.cc dump_file. It needs to write a
file_data object to a std::ostream. What function would you recommend
instead of '<<'?

I tried:

  output.write (dat);

but that doesn't compile; ostream::write wants a char*, not a file_data.
I don't see how to convert a file_data to a char*; I can never figure
out these 'vocab' types.

-- 
-- Stephe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.