#
# patch "ChangeLog"
# from [77a7371aca626fa0a10cd19a27f76de459342ff7]
# to [7f843f5c4ff6f9adb675e1a2d724c18c9f44174b]
#
# patch "app_state.cc"
# from [86a9f72e4bfc334b14ab9a64b84621039f52a012]
# to [792e3fb96e0014818b035e55995291bfaf6c932e]
#
# patch "configure.ac"
# from [6b50b307f85eccc907f7d983675590c3bc18d481]
# to [ce35061b8ee9fdb62e2eb59cdaf78e66006fa999]
#
# patch "monotone.cc"
# from [8cb7a023798adb3cfe759d2030151cba793fa733]
# to [98b11bf6e7f980c5306436a2cf0f742b01b3659e]
#
# patch "rcs_import.cc"
# from [0b20cfb6281be6eda31c0e861912a2fe57145638]
# to [64a8b8c0804e841887e4f28c1c377c8890f854af]
#
# patch "ui.cc"
# from [b36b029d0461552bbc5d7ef80bd97a17c16396aa]
# to [956b7c37e04eab186d093e34b39a625b7264849a]
#
========================================================================
--- ChangeLog 77a7371aca626fa0a10cd19a27f76de459342ff7
+++ ChangeLog 7f843f5c4ff6f9adb675e1a2d724c18c9f44174b
@@ -1,5 +1,20 @@
2005-11-27 Julio M. Merino Vidal
+ * app_state.cc: No need to include headers for chdir() any more.
+ This function was replaced by change_current_working_dir.
+ * monotone.cc: Unconditionally include libintl.h as this file uses
+ gettext functions.
+ * configure.ac, rcs_import.cc: Check for strptime(3) and use the
+ check results instead of assuming that only Windows lacks this
+ function.
+ * configure.ac, ui.cc: Check whether C++ streams support the
+ sync_with_stdio method and use the check results instead of assuming
+ that only Windows lacks this function.
+
+ Addresses part of bug #12086.
+
+2005-11-27 Julio M. Merino Vidal
+
* app_state.cc: Correctly detect when MT/options does not have a
database property instead of printing the cryptic message "misuse:
invalid path ''".
========================================================================
--- app_state.cc 86a9f72e4bfc334b14ab9a64b84621039f52a012
+++ app_state.cc 792e3fb96e0014818b035e55995291bfaf6c932e
@@ -1,11 +1,6 @@
#include
#include
#include
-#ifdef WIN32
-#include /* for chdir() */
-#else
-#include /* for chdir() on POSIX */
-#endif
#include // for strtoul()
#include
========================================================================
--- configure.ac 6b50b307f85eccc907f7d983675590c3bc18d481
+++ configure.ac ce35061b8ee9fdb62e2eb59cdaf78e66006fa999
@@ -369,7 +369,7 @@
else
AC_MSG_RESULT(no)
fi
-AC_CHECK_FUNCS(strerror mtrace getuid geteuid)
+AC_CHECK_FUNCS(strerror strptime mtrace getuid geteuid)
AC_CHECK_FUNC(setreuid, [], [
AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
])
@@ -448,6 +448,22 @@
AC_CHECK_FUNC(getaddrinfo, [AM_CONDITIONAL(MISSING_GETADDRINFO, false)],
[AM_CONDITIONAL(MISSING_GETADDRINFO, true)])
+# Check whether C++ streams support sync_with_stdio.
+AC_MSG_CHECKING(whether C++ streams support sync_with_stdio)
+AC_LINK_IFELSE([AC_LANG_SOURCE([
+#include
+
+int main(void)
+{
+ std::clog.sync_with_stdio(false);
+ return 0;
+}
+])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SYNC_WITH_STDIO, 1,
+ [Define to 1 if C++ streams support sync_with_stdio])],
+ [AC_MSG_RESULT(no)])
+
# allow compiling with different flags/optimisation
# for monotone versus libs, useful for testing.
# only makes sense if CFLAGS="" or CXXFLAGS=""
========================================================================
--- monotone.cc 8cb7a023798adb3cfe759d2030151cba793fa733
+++ monotone.cc 98b11bf6e7f980c5306436a2cf0f742b01b3659e
@@ -16,9 +16,7 @@
#include
#include
-#ifdef WIN32
#include
-#endif
#include "botan/botan.h"
========================================================================
--- rcs_import.cc 0b20cfb6281be6eda31c0e861912a2fe57145638
+++ rcs_import.cc 64a8b8c0804e841887e4f28c1c377c8890f854af
@@ -245,7 +245,10 @@
memset(&t, 0, sizeof(t));
char const * dp = delta->second->date.c_str();
L(F("Calculating time of %s\n") % dp);
-#ifdef WIN32
+#ifdef HAVE_STRPTIME
+ if (strptime(dp, "%y.%m.%d.%H.%M.%S", &t) == NULL)
+ I(strptime(dp, "%Y.%m.%d.%H.%M.%S", &t) != NULL);
+#else
I(sscanf(dp, "%d.%d.%d.%d.%d.%d", &(t.tm_year), &(t.tm_mon),
&(t.tm_mday), &(t.tm_hour), &(t.tm_min), &(t.tm_sec))==6);
t.tm_mon--;
@@ -253,9 +256,6 @@
// wants a 2 (or 3) digit year (years since 1900).
if (t.tm_year > 1900)
t.tm_year-=1900;
-#else
- if (strptime(dp, "%y.%m.%d.%H.%M.%S", &t) == NULL)
- I(strptime(dp, "%Y.%m.%d.%H.%M.%S", &t) != NULL);
#endif
time = mktime(&t);
L(boost::format("= %i\n") % time);
========================================================================
--- ui.cc b36b029d0461552bbc5d7ef80bd97a17c16396aa
+++ ui.cc 956b7c37e04eab186d093e34b39a625b7264849a
@@ -263,7 +263,7 @@
t_writer(0)
{
cout.exceptions(ios_base::badbit);
-#ifndef WIN32
+#ifdef HAVE_SYNC_WITH_STDIO
clog.sync_with_stdio(false);
#endif
clog.unsetf(ios_base::unitbuf);