monotone

monotone Commit Details

Date:2010-11-27 09:16:44 (8 years 6 months ago)
Author:Richard Levitte
Branch:net.venge.monotone
Commit:77d61233ea3d61f0f97a8b6a0116c0c0d86c9ee6
Parents: f5726828ba2b388ea64db1e59f7319b79e98b75f
Message:When removing a binary file, diff should report that said filename is

binary, not that /dev/null is.

For now, this is done by checking if filename2 is the magic marker '/dev/null'.
Changes:
Atests/filenames_in_diff_after_removal
Atests/filenames_in_diff_after_removal/__driver__.lua (full)
Atests/filenames_in_diff_after_removal/binary
Mdiff_output.cc (1 diff)

File differences

diff_output.cc
475475
476476
477477
478
478
479
480
481
482
483
479484
480485
481486
{
if (guess_binary(data1()) || guess_binary(data2()))
{
ost << "# " << filename2 << " is binary\n";
// If a file has been removed, filename2 will be "/dev/null".
// It doesn't make sense to output that.
if (filename2 == "/dev/null")
ost << "# " << filename1 << " is binary\n";
else
ost << "# " << filename2 << " is binary\n";
return;
}
tests/filenames_in_diff_after_removal/__driver__.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mtn_setup()
-- If a binary file is removed, then 'mtn diff' should display:
-- # binaryfilename is binary
-- not:
-- # /dev/null is binary
check(get("binary"))
check(mtn("add", "binary"), 0, false, false)
commit()
check(mtn("drop", "binary"), 0, false, false)
check(not exists("binary"))
check(mtn("diff"), 0, true, false)
check(qgrep("# binary is binary", "stdout"))

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status