# # patch "ChangeLog" # from [4aea07e5f341da91edb8232687892b0804919170] # to [373c1ed8cd034c3e9374e578141d6335b5fb33b8] # # patch "diff_patch.cc" # from [bc9388bcdf8df0fac37f52aa7a8e0b8b8f94d247] # to [209e60efcca30474071383769840ae18d3d1aeef] # # patch "testsuite.at" # from [780ed963e99a738ebbce9079486ac69c032ed5f5] # to [15e56f34d9bce816e570f1c0ed566d1b9b248eea] # # patch "transforms.cc" # from [6ea138ac776c8d19aaf274a8a93f370a60de3e05] # to [a84ed105809f55ba4097a4559ecc53ec21f9ab17] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,15 @@ 2005-05-13 Joel Reed + * diff_patch.cc, transforms.cc, testsuite.at: Patch from + address@hidden, who writes: "The attached patch should fix bug + 13072. I have no idea why the code in transform.cc insists on + adding an empty line in case the file is empty. Removing the code + didn't cause any regressions in the test suite and the + diff_patch.cc change corrects the output format. A new test case + is included as well." + +2005-05-13 Joel Reed + * automate.cc: add automate attributes command * commands.cc: add attributes subcommand helptext * contrib/monotone.zsh_completion: use automate attributes --- diff_patch.cc +++ diff_patch.cc @@ -833,13 +833,23 @@ } // write hunk to stream - ost << "@@ -" << a_begin+1; - if (a_len > 1) - ost << "," << a_len; + if (a_len == 0) + ost << "@@ -0,0"; + else + { + ost << "@@ -" << a_begin+1; + if (a_len > 1) + ost << "," << a_len; + } - ost << " +" << b_begin+1; - if (b_len > 1) - ost << "," << b_len; + if (b_len == 0) + ost << " +0,0"; + else + { + ost << " +" << b_begin+1; + if (b_len > 1) + ost << "," << b_len; + } ost << " @@" << endl; copy(hunk.begin(), hunk.end(), ostream_iterator(ost, "\n")); --- testsuite.at +++ testsuite.at @@ -642,3 +642,4 @@ m4_include(tests/t_cvsimport3.at) m4_include(tests/t_commit_message_file.at) m4_include(tests/t_automate_attributes.at) +m4_include(tests/t_unidiff3.at) --- transforms.cc +++ transforms.cc @@ -395,8 +395,6 @@ { out.push_back(in); } - if (out.size() == 0) - out.push_back(""); }