#
# old_revision [386bd5fab3b55635765c1f0bc3beddbe970afc8d]
#
# add_dir "tests/calculation_of_unidiffs_start_of_file"
#
# add_file "tests/calculation_of_unidiffs_start_of_file/__driver__.lua"
# content [a675e225e338ba2da4d3af809cbca8b9934739d1]
#
# add_file "tests/calculation_of_unidiffs_start_of_file/firstfile"
# content [b556393474ffd1133a0d72c549e5ef4b0346d05f]
#
# add_file "tests/calculation_of_unidiffs_start_of_file/secondfile"
# content [43fbdbec8b75ae97def329110b462353419ad3e2]
#
# patch "diff_patch.cc"
# from [5437f74550a59622f0aca36b00dd43f104b7692a]
# to [827f8dbf2c922582e983b2207f7cf2abd45e7d4b]
#
============================================================
--- tests/calculation_of_unidiffs_start_of_file/__driver__.lua a675e225e338ba2da4d3af809cbca8b9934739d1
+++ tests/calculation_of_unidiffs_start_of_file/__driver__.lua a675e225e338ba2da4d3af809cbca8b9934739d1
@@ -0,0 +1,26 @@
+
+skip_if(not existsonpath("patch"))
+
+mtn_setup()
+
+-- get first file and commit to db
+check(get("firstfile", "testfile"))
+check(mtn("add", "testfile"), 0, false, false)
+commit()
+rename("testfile", "firstfile")
+
+-- get second file
+check(get("secondfile", "testfile"))
+
+-- calculate diff to second file using monotone
+check(mtn("diff"), 0, true)
+canonicalize("stdout")
+rename("stdout", "monodiff")
+rename("testfile", "secondfile")
+
+-- see if patch likes that
+rename("monodiff", "stdin")
+check({"patch", "firstfile"}, 0, false, false, true)
+
+-- see if the resulting file has been properly patched
+check(samefile("firstfile", "secondfile"))
============================================================
--- tests/calculation_of_unidiffs_start_of_file/firstfile b556393474ffd1133a0d72c549e5ef4b0346d05f
+++ tests/calculation_of_unidiffs_start_of_file/firstfile b556393474ffd1133a0d72c549e5ef4b0346d05f
@@ -0,0 +1,112 @@
+#ifndef __APP_STATE_HH__
+#define __APP_STATE_HH__
+
+// Copyright (C) 2002 Graydon Hoare
+//
+// This program is made available under the GNU GPL version 2.0 or
+// greater. See the accompanying file COPYING for details.
+//
+// This program is distributed WITHOUT ANY WARRANTY; without even the
+// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE.
+
+class app_state;
+class lua_hooks;
+
+#include