couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r667857 - in /incubator/couchdb/branches/runtimeconfig: ./ bin/ build-contrib/ etc/ etc/couchdb/ share/ share/server/ share/www/ share/www/browse/ share/www/script/ src/ src/couchdb/ src/mochiweb/ var/
Date Sat, 14 Jun 2008 17:48:26 GMT
Author: jan
Date: Sat Jun 14 10:48:24 2008
New Revision: 667857

URL: http://svn.apache.org/viewvc?rev=667857&view=rev
Log:
Merged revisions 663239,663345,663654,663740,663744,663759,663786,663876,663898,663925,663927,663929,663951,663983-663985,663987,664091,664093,664362-664364,664366-664367,664369,664372,664383,665698,665705,665852,665906,666182,666187,666196,666202,666205,666210,666212,666214,667188,667236,667522-667523 via svnmerge from 
https://jan@svn.apache.org/repos/asf/incubator/couchdb/trunk


Added:
    incubator/couchdb/branches/runtimeconfig/CHANGES
      - copied unchanged from r667523, incubator/couchdb/trunk/CHANGES
    incubator/couchdb/branches/runtimeconfig/LICENSE
      - copied unchanged from r667523, incubator/couchdb/trunk/LICENSE
    incubator/couchdb/branches/runtimeconfig/build-contrib/ac_check_icu.m4_2008-06-07.gz
      - copied unchanged from r667523, incubator/couchdb/trunk/build-contrib/ac_check_icu.m4_2008-06-07.gz
    incubator/couchdb/branches/runtimeconfig/build-contrib/config.guess_2008-06-07.gz
      - copied unchanged from r667523, incubator/couchdb/trunk/build-contrib/config.guess_2008-06-07.gz
    incubator/couchdb/branches/runtimeconfig/build-contrib/config.sub_2008-06-07.gz
      - copied unchanged from r667523, incubator/couchdb/trunk/build-contrib/config.sub_2008-06-07.gz
Removed:
    incubator/couchdb/branches/runtimeconfig/LICENCE
    incubator/couchdb/branches/runtimeconfig/build-contrib/ac_check_icu.m4_2007-09-12.gz
    incubator/couchdb/branches/runtimeconfig/build-contrib/config.guess_2007-09-12.gz
    incubator/couchdb/branches/runtimeconfig/build-contrib/config.sub_2007-09-12.gz
    incubator/couchdb/branches/runtimeconfig/share/www/script/shell.js
    incubator/couchdb/branches/runtimeconfig/share/www/shell.html
Modified:
    incubator/couchdb/branches/runtimeconfig/   (props changed)
    incubator/couchdb/branches/runtimeconfig/Makefile.am
    incubator/couchdb/branches/runtimeconfig/NEWS
    incubator/couchdb/branches/runtimeconfig/NOTICE
    incubator/couchdb/branches/runtimeconfig/README
    incubator/couchdb/branches/runtimeconfig/acinclude.m4.in
    incubator/couchdb/branches/runtimeconfig/bin/Makefile.am
    incubator/couchdb/branches/runtimeconfig/bootstrap
    incubator/couchdb/branches/runtimeconfig/configure.ac
    incubator/couchdb/branches/runtimeconfig/etc/Makefile.am
    incubator/couchdb/branches/runtimeconfig/etc/couchdb/Makefile.am
    incubator/couchdb/branches/runtimeconfig/share/Makefile.am
    incubator/couchdb/branches/runtimeconfig/share/server/main.js
    incubator/couchdb/branches/runtimeconfig/share/www/browse/database.html
    incubator/couchdb/branches/runtimeconfig/share/www/browse/document.html
    incubator/couchdb/branches/runtimeconfig/share/www/browse/index.html
    incubator/couchdb/branches/runtimeconfig/share/www/couch_tests.html
    incubator/couchdb/branches/runtimeconfig/share/www/index.html
    incubator/couchdb/branches/runtimeconfig/share/www/replicator.html
    incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/couch_tests.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js
    incubator/couchdb/branches/runtimeconfig/src/Makefile.am
    incubator/couchdb/branches/runtimeconfig/src/couchdb/Makefile.am
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_btree.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_file.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_query_servers.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_server_sup.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_view.erl
    incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am
    incubator/couchdb/branches/runtimeconfig/var/Makefile.am

Propchange: incubator/couchdb/branches/runtimeconfig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Jun 14 10:48:24 2008
@@ -1 +1 @@
-/incubator/couchdb/trunk:1-663114
+/incubator/couchdb/trunk:1-667856

Modified: incubator/couchdb/branches/runtimeconfig/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,15 +10,13 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 SUBDIRS = bin etc src share var
 
-pkgdoc_DATA = AUTHORS.gz BUGS.gz changelog.gz NEWS.gz README.gz THANKS.gz
+pkgdoc_DATA = AUTHORS.gz BUGS.gz CHANGES.gz NEWS.gz README.gz THANKS.gz
 
 DISTCLEANFILES = $(pkgdoc_DATA)
 
-EXTRA_DIST = AUTHORS BUGS ChangeLog LICENCE NEWS README THANKS
+EXTRA_DIST = AUTHORS BUGS CHANGES LICENSE NEWS README THANKS
 
 AUTHORS.gz: $(top_srcdir)/AUTHORS
 	-gzip -9 < $< > $@
@@ -26,7 +24,7 @@
 BUGS.gz: $(top_srcdir)/BUGS
 	-gzip -9 < $< > $@
 
-changelog.gz: $(top_srcdir)/ChangeLog
+CHANGES.gz: $(top_srcdir)/CHANGES
 	-gzip -9 < $< > $@
 
 NEWS.gz: $(top_srcdir)/NEWS
@@ -41,7 +39,6 @@
 local-clean: maintainer-clean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may need special tools to rebuild."
-	rm -f ChangeLog
 	rm -f INSTALL
 	rm -f acinclude.m4
 	rm -f aclocal.m4
@@ -49,8 +46,8 @@
 	rm -f config.h.in*
 	rm -f configure
 	rm -f configure~
-	rm -f couchdb-$(version).tar.gz
-	rm -f couchdb-$(version).zip
+	rm -f *.tar.gz
+	rm -f *.zip
 	rm -fr m4
 	find . -name Makefile.in | xargs rm
 

Modified: incubator/couchdb/branches/runtimeconfig/NEWS
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/NEWS?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/NEWS (original)
+++ incubator/couchdb/branches/runtimeconfig/NEWS Sat Jun 14 10:48:24 2008
@@ -1,19 +1,28 @@
 Apache CouchDB NEWS
 ===================
 
-Version 0.7.3a
---------------
+For details on backwards incompatible changes between releases, please see:
 
-This version is unreleased and only available from the source repository.
+  http://wiki.apache.org/couchdb/BreakingChanges
 
- * Changed core licensing to the Apache License 2.0.
- * Miscellaneous refactoring of the core Erlang database engine.
- * Miscellaneous improvements to Futon, the web administration console.
- * Miscellaneous improvements to the `couchdb` command.
- * Database server can automatically respawn following a server crash.
- * Database server no longer refuses to start with a stale PID file.
- * System logrotate configuration provided.
- * Improved handling of ICU shared libraries.
+Version 0.8.0-incubating
+------------------------
+
+Released under the patronage of the Apache Software Foundation Incubator.
+
+ * Changed core licensing to the Apache Software License 2.0.
+ * Refactoring of the core view and storage engines.
+ * Added support for incremental map/reduce views.
+ * Changed database file format.
+ * Many improvements to Futon, the web administration interface.
+ * Swapped out Erlang's inets HTTP server for the Mochiweb HTTP server.
+ * SpiderMonkey is no longer included with CouchDB, but rather treated as an
+   external dependendancy.
+ * Added bits of awesome.
+
+Please note that there have been many backwards incomatible changes in this
+release. See http://wiki.apache.org/couchdb/BreakingChanges for more information
+and some tips for upgrading.
 
 Version 0.7.2
 -------------

Modified: incubator/couchdb/branches/runtimeconfig/NOTICE
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/NOTICE?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/NOTICE (original)
+++ incubator/couchdb/branches/runtimeconfig/NOTICE Sat Jun 14 10:48:24 2008
@@ -1,20 +1,23 @@
-Apache CouchDB NOTICE
-=====================
+Apache CouchDB
+Copyright 2008 The Apache Software Foundation
 
-Developed at [The Apache Software Foundation][1].
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
 
-Core software:
+This product also includes the following third-party components:
 
- * Copyright 2008, Damien Katz <damien@apache.org>
- * Copyright 2008, Jan Lehnardt <jan@apache.org>
- * Copyright 2008, Christopher Lenz <cmlenz@apache.org>
- * Copyright 2008, Noah Slater <nslater@apache.org>
+ac_check_icu.m4 (http://autoconf-archive.cryp.to/ac_check_icu.html)
 
-Supporting software:
+  Copyright 2005, Akos Maroy <darkeye@tyrell.hu>
 
- * m4/ac_check_icu.m4 - Copyright 2005, Akos Maroy <darkeye@tyrell.hu>
- * share/www/script/jquery.js - Copyright 2008, John Resig
- * share/www/script/json2.js - In the public domain
- * src/mochiweb - Copyright 2007, Mochi Media Coporation
+jQuery (http://jquery.com/)
 
-[1]: http://www.apache.org/
+  Copyright 2008, John Resig
+
+json2.js (http://www.json.org/)
+
+  In the public domain
+
+MochiWeb (http://code.google.com/p/mochiweb/)
+
+  Copyright 2007, Mochi Media Coporation

Modified: incubator/couchdb/branches/runtimeconfig/README
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/README?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/README (original)
+++ incubator/couchdb/branches/runtimeconfig/README Sat Jun 14 10:48:24 2008
@@ -1,6 +1,18 @@
 Apache CouchDB README
 =====================
 
+Apache CouchDB is alpha software and still under heavy development. Please be
+aware that important areas such as the public API or internal database format
+may see backwards incompatible changes between versions.
+
+Apache CouchDB is an effort undergoing incubation at the Apache Software
+Foundation (ASF), sponsored by the Apache Incubator PMC. Incubation is required
+of all newly accepted projects until a further review indicates that the
+infrastructure, communications, and decision making process have stabilized in a
+manner consistent with other successful ASF projects. While incubation status is
+not necessarily a reflection of the completeness or stability of the code, it
+does indicate that the project has yet to be fully endorsed by the ASF.
+
 Building From Subversion
 ------------------------
 
@@ -13,43 +25,37 @@
  * [GNU Automake][01] (>=1.6.3) (required)
  * [GNU Autoconf][02] (>=2.59) (required)
  * [GNU Libtool][03] (required)
- * [svn2cl][04] (optional)
- * [xsltproc][05] (optional)
- * [help2man][06] (optional)
+ * [help2man][04] (optional)
 
 If you are running a Debian GNU/Linux system (or a derivative such as Ubuntu
 GNU/Linux) you can install these dependencies using the `apt-get` command:
 
-    apt-get install automake autoconf libtool subversion-tools help2man
+    apt-get install automake autoconf libtool help2man
 
 The OS X version of these dependencies may be out of date so it is recommended
-that you use [MacPorts][07] to install newer versions using the `port` command:
+that you use [MacPorts][05] to install newer versions using the `port` command:
 
     port install automake autoconf libtool help2man
 
-Note: MacPorts users will need to install svn2cl by hand if they wish to use it.
-
 ### Bootstrapping ###
 
 Note: You must repeat this step every time you update your Subversion checkout.
 
-Follow the [check out instructions][08] and bootstrap the pristine source by
+Follow the [check out instructions][06] and bootstrap the pristine source by
 running the following command:
 
     ./bootstrap
 
-You can use the `-C` option to generate a dummy `ChangeLog` file.
-
 Installation And First Run
 --------------------------
 
 You will need the following installed:
 
- * [Erlang OTP][09] (>=R11B) (required)
- * [ICU][10] (required)
- * [Mozilla SpiderMonkey][11] (required)
- * [GNU Make][12] (required)
- * [GNU Compiler Collection][13] (required)
+ * [Erlang OTP][07] (>=R11B) (required)
+ * [ICU][08] (required)
+ * [Mozilla SpiderMonkey][09] (required)
+ * [GNU Make][10] (required)
+ * [GNU Compiler Collection][11] (required)
 
 ### UNIX-like Operating Systems (inc. OS X) ###
 
@@ -129,14 +135,16 @@
 
 On many UNIX-like systems you can run the following command:
 
-    adduser couchdb
+    adduser --system --home /var/lib/couchdb --no-create-home \
+            --shell /bin/bash --group --gecos "CouchDB Administrator" couchdb
 
 OS X provides the standard Accounts option from the System Preferences
 application or you can optionally use the Workgroup Manager application which
-can be downloaded as part of the [Server Admin Tools][14].
+can be downloaded as part of the [Server Admin Tools][12].
 
-You should set the home directory of the `couchdb` user to
-`/usr/local/var/lib/couchdb` which is the Apache CouchDB database directory.
+You should make sure that the `couchdb` user has a working POSIX shell and set
+the home directory to `/usr/local/var/lib/couchdb` which is the Apache CouchDB
+database directory.
 
 Make sure to change the ownership of the Apache CouchDB data directories by
 running the following commands:
@@ -159,7 +167,7 @@
 Relax.
 
 To check that everything has worked point your web browser to
-[http://localhost:5984/_utils/index.html][15] and run the test suite.
+[http://localhost:5984/_utils/index.html][13] and run the test suite.
 
 ##### OS X #####
 
@@ -256,13 +264,21 @@
 
 If everything was successful you should now have a pristine checkout.
 
-### Preparing For Distribution ###
+### Making a Release ###
+
+The following steps should be taken prior to preparing the release:
+
+    svn cp trunk branches/Y.Y.x
+    svn cp branches/Y.Y.x tags/Y.Y.Y
+    svn export tags/Y.Y.Y export
+
+You must then use the `export` directory to prepare the release.
 
 To build the source for distribution you should then run the following command:
 
     ./configure && make distcheck
 
-If everything was successful you should see a `zip` file and/or a `tar.gz` file
+If everything was successful you should see an appropriately named `tar.gz` file
 sitting in the root directory ready for distribution.
 
 ### Release Checklist ###
@@ -274,15 +290,13 @@
 [01]: http://www.gnu.org/software/automake/
 [02]: http://www.gnu.org/software/autoconf/
 [03]: http://www.gnu.org/software/libtool/
-[04]: http://ch.tudelft.nl/~arthur/svn2cl/
-[05]: http://xmlsoft.org/XSLT/xsltproc2.html
-[06]: http://www.gnu.org/software/help2man/
-[07]: http://www.macports.org/
-[08]: http://incubator.apache.org/couchdb/community/code.html
-[09]: http://erlang.org/
-[10]: http://icu.sourceforge.net/
-[11]: http://www.mozilla.org/js/spidermonkey/
-[12]: http://www.gnu.org/software/make/
-[13]: http://gcc.gnu.org/
-[14]: http://www.apple.com/support/downloads/serveradmintools1047.html
-[15]: http://localhost:5984/_utils/index.html
+[04]: http://www.gnu.org/software/help2man/
+[05]: http://www.macports.org/
+[06]: http://incubator.apache.org/couchdb/community/code.html
+[07]: http://erlang.org/
+[08]: http://icu.sourceforge.net/
+[09]: http://www.mozilla.org/js/spidermonkey/
+[10]: http://www.gnu.org/software/make/
+[11]: http://gcc.gnu.org/
+[12]: http://www.apple.com/support/downloads/serveradmintools1047.html
+[13]: http://localhost:5984/_utils/index.html

Modified: incubator/couchdb/branches/runtimeconfig/acinclude.m4.in
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/acinclude.m4.in?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/acinclude.m4.in (original)
+++ incubator/couchdb/branches/runtimeconfig/acinclude.m4.in Sat Jun 14 10:48:24 2008
@@ -13,17 +13,19 @@
 m4_define([LOCAL_PACKAGE_AUTHOR_NAME], [Damien Katz])
 m4_define([LOCAL_PACKAGE_AUTHOR_ADDRESS], [damien@apache.org])
 m4_define([LOCAL_PACKAGE_IDENTIFIER], [couchdb])
+m4_define([LOCAL_PACKAGE_TARNAME], [apache-couchdb])
 m4_define([LOCAL_PACKAGE_NAME], [Apache CouchDB])
 
 m4_define([LOCAL_VERSION_MAJOR], [0])
-m4_define([LOCAL_VERSION_MINOR], [7])
-m4_define([LOCAL_VERSION_REVISION], [3])
-m4_define([LOCAL_VERSION_STAGE], [a])
+m4_define([LOCAL_VERSION_MINOR], [8])
+m4_define([LOCAL_VERSION_REVISION], [0])
+m4_define([LOCAL_VERSION_STAGE], [])
 m4_define([LOCAL_VERSION_RELEASE], [%release%])
+m4_define([LOCAL_VERSION_STATUS], [incubating])
 m4_define([LOCAL_VERSION_PRIMARY],
     [LOCAL_VERSION_MAJOR.LOCAL_VERSION_MINOR.LOCAL_VERSION_REVISION])
 m4_define([LOCAL_VERSION_SECONDARY],
-    [LOCAL_VERSION_STAGE[]LOCAL_VERSION_RELEASE])
+    [LOCAL_VERSION_STAGE[]LOCAL_VERSION_RELEASE-LOCAL_VERSION_STATUS])
 m4_define([LOCAL_VERSION],
     [LOCAL_VERSION_PRIMARY[]LOCAL_VERSION_SECONDARY])
 

Modified: incubator/couchdb/branches/runtimeconfig/bin/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/bin/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/bin/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/bin/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 bin_SCRIPTS = couchdb couchjs
 
 if HELP2MAN

Modified: incubator/couchdb/branches/runtimeconfig/bootstrap
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/bootstrap?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/bootstrap (original)
+++ incubator/couchdb/branches/runtimeconfig/bootstrap Sat Jun 14 10:48:24 2008
@@ -17,17 +17,14 @@
 SCRIPT_OK=0
 SCRIPT_ERROR=1
 
-CHANGELOG_PREDICATE=true
-
 ACINCLUDE_FILE="acinclude.m4"
 ACINCLUDE_IN_FILE="acinclude.m4.in"
-AC_CHECK_ICU_COMPRESSED_FILE="build-contrib/ac_check_icu.m4_2007-09-12.gz"
+AC_CHECK_ICU_COMPRESSED_FILE="build-contrib/ac_check_icu.m4_2008-06-07.gz"
 AUTHORS_FILE="authors.xml"
 BUILD_AUX_DIRECTORY="build-aux"
-CHANGELOG_FILE="ChangeLog"
-CONFIG_GUESS_COMPRESSED_FILE="build-contrib/config.guess_2007-09-12.gz"
+CONFIG_GUESS_COMPRESSED_FILE="build-contrib/config.guess_2008-06-07.gz"
 CONFIG_GUESS_FILE="build-aux/config.guess"
-CONFIG_SUB_COMPRESSED_FILE="build-contrib/config.sub_2007-09-12.gz"
+CONFIG_SUB_COMPRESSED_FILE="build-contrib/config.sub_2008-06-07.gz"
 CONFIG_SUB_FILE="build-aux/config.sub"
 M4_DIRECTORY="m4"
 M4_AC_CHECK_ICU_FILE="m4/ac_check_icu.m4"
@@ -40,7 +37,6 @@
 GLIBTOOLIZE_EXECUTABLE=$(which glibtoolize || true)
 LIBTOOLIZE_EXECUTABLE=$(which libtoolize || true)
 SVN_EXECUTABLE=$(which svn || true)
-SVN2CL_EXECUTABLE=$(which svn2cl || true)
 
 basename=$(basename $0)
 
@@ -96,7 +92,6 @@
 
   -h  display a short help message and exit
   -v  display version information and exit
-  -C  do not generate a ChangeLog from Subversion
 
 Environment variables:
 
@@ -117,13 +112,6 @@
     exit $SCRIPT_ERROR
 }
 
-generate_dummy_changelog () {
-    # Generate a dummy ChangLog file.
-
-    echo "Warning: Generating a dummy ChangeLog file."
-    touch $CHANGELOG_FILE
-}
-
 check_svn_environment () {
     # Check the Subversion environment for sanity.
 
@@ -142,27 +130,6 @@
     fi
 }
 
-generate_changelog () {
-    # Generate the ChangLog file using the Subversion repository.
-
-    if test "$SVN_CHECKOUT_BOOLEAN" = "true"; then
-        SVN2CL_COMMAND_ARGUMENT="."
-    fi
-    if test -n "$REPOSITORY_REVISION"; then
-        SVN2CL_COMMAND_ARGUMENT="--revision $REPOSITORY_REVISION:1 $REPOSITORY_URI"
-    fi
-    if test -z "$SVN2CL_COMMAND_ARGUMENT"; then
-        return
-    fi
-    if test ! -x "$SVN2CL_EXECUTABLE"; then
-        echo "Warning: Unable to find the svn2cl command."
-        generate_dummy_changelog
-    else
-        echo "Generating \`"$CHANGELOG_FILE"' (may take a while)"
-        $SVN2CL_EXECUTABLE --authors=$AUTHORS_FILE $SVN2CL_COMMAND_ARGUMENT
-    fi
-}
-
 generate_acinclude () {
     # Generate the acinclude.m4 file using the Subversion repository.
 
@@ -298,7 +265,6 @@
         case "$1" in
             -v) shift; display_version; exit $SCRIPT_OK;;
             -h) shift; display_help; exit $SCRIPT_OK;;
-            -C) shift; CHANGELOG_PREDICATE=false;;
             --) shift; break;;
             *) display_error "Unknown option: $1" >&2;;
         esac
@@ -306,11 +272,6 @@
     cd $(dirname $0)
     process_file_collection
     check_svn_environment || true
-    if test "$CHANGELOG_PREDICATE" = "true"; then
-        generate_changelog
-    else
-        generate_dummy_changelog
-    fi
     generate_acinclude
     run_command_collection
 }

Modified: incubator/couchdb/branches/runtimeconfig/configure.ac
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/configure.ac?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/configure.ac (original)
+++ incubator/couchdb/branches/runtimeconfig/configure.ac Sat Jun 14 10:48:24 2008
@@ -12,11 +12,11 @@
 
 m4_include([m4/ac_check_icu.m4])
 
-AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [], [LOCAL_PACKAGE_IDENTIFIER])
+AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [], [LOCAL_PACKAGE_TARNAME])
 
 AC_PREREQ([2.59])
 
-AC_CONFIG_SRCDIR([ChangeLog])
+AC_CONFIG_SRCDIR([CHANGES])
 AC_CONFIG_AUX_DIR([build-aux])
 
 AM_CONFIG_HEADER([config.h])
@@ -199,6 +199,7 @@
 AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
 AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
 AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
+AC_SUBST([package_tarname], ["LOCAL_PACKAGE_TARNAME"])
 AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
 
 AC_SUBST([version], ["LOCAL_VERSION"])
@@ -210,12 +211,12 @@
 
 AC_SUBST([bug_uri], ["LOCAL_BUG_URI"])
 
-AC_SUBST([pkgconfdir], [${sysconfdir}/${PACKAGE_TARNAME}])
-AC_SUBST([pkgdatadir], [${datadir}/${PACKAGE_TARNAME}])
-AC_SUBST([pkgdocdir], [${datadir}/doc/${PACKAGE_TARNAME}])
-AC_SUBST([pkglibdir], [${libdir}/${PACKAGE_TARNAME}])
-AC_SUBST([pkgstatelibdir], [${localstatedir}/lib/${PACKAGE_TARNAME}])
-AC_SUBST([pkgstatelogdir], [${localstatedir}/log/${PACKAGE_TARNAME}])
+AC_SUBST([pkgconfdir], [${sysconfdir}/${package_identifier}])
+AC_SUBST([pkgdatadir], [${datadir}/${package_identifier}])
+AC_SUBST([pkgdocdir], [${datadir}/doc/${package_identifier}])
+AC_SUBST([pkglibdir], [${libdir}/${package_identifier}])
+AC_SUBST([pkgstatelibdir], [${localstatedir}/lib/${package_identifier}])
+AC_SUBST([pkgstatelogdir], [${localstatedir}/log/${package_identifier}])
 AC_SUBST([libbindir], [${pkglibdir}/bin])
 AC_SUBST([erlangbindir], [${pkglibdir}/erlang/bin])
 AC_SUBST([erlanglibdir], [${pkglibdir}/erlang/lib])

Modified: incubator/couchdb/branches/runtimeconfig/etc/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/etc/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/etc/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/etc/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 SUBDIRS = couchdb default init launchd logrotate.d
 
 default_sysconf_data = logrotate.d/couchdb

Modified: incubator/couchdb/branches/runtimeconfig/etc/couchdb/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/etc/couchdb/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/etc/couchdb/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/etc/couchdb/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 pkgconf_DATA = couch.ini
 
 CLEANFILES = $(pkgconf_DATA)

Modified: incubator/couchdb/branches/runtimeconfig/share/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/share/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 nobase_dist_pkgdata_DATA = \
     server/main.js \
     www/browse/_compact_database.html \
@@ -65,6 +63,4 @@
     www/script/jquery.suggest.js \
     www/script/json2.js \
     www/script/pprint.js \
-    www/script/shell.js \
-    www/shell.html \
     www/style/layout.css

Modified: incubator/couchdb/branches/runtimeconfig/share/server/main.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/server/main.js?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/server/main.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/server/main.js [utf-8] Sat Jun 14 10:48:24 2008
@@ -102,13 +102,13 @@
         print(toJSON(buf));
         break;
 
-      case "combine":
+      case "rereduce":
       case "reduce":
         {
         var keys = null;
         var values = null;
         var reduceFuns = cmd[1];
-        var is_combine = false;
+        var rereduce = false;
         
         if (cmd[0] == "reduce") {
           var kvs = cmd[2];
@@ -120,7 +120,7 @@
           }
         } else {
           values = cmd[2];
-          is_combine = true;
+          rereduce = true;
         }
 
         for (var i in reduceFuns) {
@@ -130,7 +130,7 @@
         var reductions = new Array(funs.length);
         for(var i = 0; i < reduceFuns.length; i++) {
           try {
-            reductions[i] = reduceFuns[i](keys, values, is_combine);
+            reductions[i] = reduceFuns[i](keys, values, rereduce);
           } catch (err) {
             if (err == "fatal_error") {
               throw {error: "reduce_runtime_error",

Modified: incubator/couchdb/branches/runtimeconfig/share/www/browse/database.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/browse/database.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/browse/database.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/browse/database.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,16 +17,16 @@
   <head>
     <title>Browse Database</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="../style/layout.css" type="text/css">
+    <link rel="stylesheet" href="../style/layout.css?0.8.0a" type="text/css">
     <script src="../script/json2.js"></script>
-    <script src="../script/jquery.js"></script>
-    <script src="../script/jquery.cookies.js"></script>
-    <script src="../script/jquery.couch.js"></script>
-    <script src="../script/jquery.dialog.js"></script>
-    <script src="../script/jquery.resizer.js"></script>
-    <script src="../script/jquery.suggest.js"></script>
-    <script src="../script/browse.js"></script>
-    <script src="../script/pprint.js"></script>
+    <script src="../script/jquery.js?1.2.6"></script>
+    <script src="../script/jquery.cookies.js?0.8.0a"></script>
+    <script src="../script/jquery.couch.js?0.8.0a"></script>
+    <script src="../script/jquery.dialog.js?0.8.0a"></script>
+    <script src="../script/jquery.resizer.js?0.8.0a"></script>
+    <script src="../script/jquery.suggest.js?0.8.0a"></script>
+    <script src="../script/browse.js?0.8.0a"></script>
+    <script src="../script/pprint.js?0.8.0a"></script>
     <script>
       var page = new CouchDatabasePage();
       if (window != parent) {

Modified: incubator/couchdb/branches/runtimeconfig/share/www/browse/document.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/browse/document.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/browse/document.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/browse/document.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,15 +17,15 @@
   <head>
     <title>View Document</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="../style/layout.css" type="text/css">
+    <link rel="stylesheet" href="../style/layout.css?0.8.0a" type="text/css">
     <script src="../script/json2.js"></script>
-    <script src="../script/jquery.js"></script>
-    <script src="../script/jquery.cookies.js"></script>
-    <script src="../script/jquery.couch.js"></script>
-    <script src="../script/jquery.dialog.js"></script>
-    <script src="../script/jquery.resizer.js"></script>
-    <script src="../script/browse.js"></script>
-    <script src="../script/pprint.js"></script>
+    <script src="../script/jquery.js?1.2.6"></script>
+    <script src="../script/jquery.cookies.js?0.8.0a"></script>
+    <script src="../script/jquery.couch.js?0.8.0a"></script>
+    <script src="../script/jquery.dialog.js?0.8.0a"></script>
+    <script src="../script/jquery.resizer.js?0.8.0a"></script>
+    <script src="../script/browse.js?0.8.0a"></script>
+    <script src="../script/pprint.js?0.8.0a"></script>
     <script>
       var page = new CouchDocumentPage();
       if (window != parent) {

Modified: incubator/couchdb/branches/runtimeconfig/share/www/browse/index.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/browse/index.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/browse/index.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/browse/index.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,14 +17,14 @@
   <head>
     <title>Welcome</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="../style/layout.css" type="text/css">
+    <link rel="stylesheet" href="../style/layout.css?0.8.0a" type="text/css">
     <script src="../script/json2.js"></script>
-    <script src="../script/jquery.js"></script>
-    <script src="../script/jquery.cookies.js"></script>
-    <script src="../script/jquery.couch.js"></script>
-    <script src="../script/jquery.dialog.js"></script>
-    <script src="../script/browse.js"></script>
-    <script src="../script/pprint.js"></script>
+    <script src="../script/jquery.js?1.2.6"></script>
+    <script src="../script/jquery.cookies.js?0.8.0a"></script>
+    <script src="../script/jquery.couch.js?0.8.0a"></script>
+    <script src="../script/jquery.dialog.js?0.8.0a"></script>
+    <script src="../script/browse.js?0.8.0a"></script>
+    <script src="../script/pprint.js?0.8.0a"></script>
     <script>
       var page = new CouchIndexPage();
       $(document).ready(function() {

Modified: incubator/couchdb/branches/runtimeconfig/share/www/couch_tests.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/couch_tests.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/couch_tests.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/couch_tests.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,11 +17,11 @@
   <head>
     <title>Test Suite</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css" type="text/css">
+    <link rel="stylesheet" href="style/layout.css?0.8.0a" type="text/css">
     <script src="script/json2.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/couch.js"></script>
-    <script src="script/pprint.js"></script>
+    <script src="script/jquery.js?1.2.6"></script>
+    <script src="script/couch.js?0.8.0a"></script>
+    <script src="script/pprint.js?0.8.0a"></script>
     <script>
       $(document).ready(function() {
         $("#toolbar button.load").click(function() {

Modified: incubator/couchdb/branches/runtimeconfig/share/www/index.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/index.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/index.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/index.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,7 +17,7 @@
   <head>
     <title>Apache CouchDB: Futon Utility Client</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css" type="text/css">
+    <link rel="stylesheet" href="style/layout.css?0.8.0a" type="text/css">
     <style type="text/css">
       html { height: 100%; overflow: hidden; }
       body { background: #fff url(image/bg.png) 100% 0 repeat-y;
@@ -27,8 +27,8 @@
       iframe { background: transparent; border: none; width: 100%; height: 100%; }
     </style>
     <script src="script/json2.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
+    <script src="script/jquery.js?1.2.6"></script>
+    <script src="script/jquery.couch.js?0.8.0a"></script>
     <script>
       function updateDatabaseList() {
         var list = $("#dbs").empty();
@@ -87,7 +87,6 @@
     <ul id="nav">
       <li><span>Tools</span><ul>
         <li><a href="browse/index.html" target="content">Overview</a></li>
-        <li><a href="shell.html" target="content">Javascript Shell</a></li>
         <li><a href="replicator.html" target="content">Replicator</a></li>
         <li><a href="couch_tests.html" target="content">Test Suite</a></li>
       </ul></li>

Modified: incubator/couchdb/branches/runtimeconfig/share/www/replicator.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/replicator.html?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/replicator.html [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/replicator.html [utf-8] Sat Jun 14 10:48:24 2008
@@ -17,11 +17,11 @@
   <head>
     <title>Replicator</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css" type="text/css">
+    <link rel="stylesheet" href="style/layout.css?0.8.0a" type="text/css">
     <script src="script/json2.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/pprint.js"></script>
+    <script src="script/jquery.js?1.2.6"></script>
+    <script src="script/jquery.couch.js?0.8.0a"></script>
+    <script src="script/pprint.js?0.8.0a"></script>
     <script>
       $(document).ready(function() {
         if (window !== parent) parent.updateNavigation();

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js [utf-8] Sat Jun 14 10:48:24 2008
@@ -87,7 +87,7 @@
     var result = JSON.parse(req.responseText);
     if (req.status != 201)
       throw result;
-    for(var i in docs) {
+    for (var i = 0; i < docs.length; i++) {
         docs[i]._id = result.new_revs[i].id;
         docs[i]._rev = result.new_revs[i].rev;
     }

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/couch_tests.js?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/couch_tests.js [utf-8] Sat Jun 14 10:48:24 2008
@@ -190,6 +190,42 @@
     }
   },
 
+  bulk_docs: function(debug) {
+    var db = new CouchDB("test_suite_db");
+    db.deleteDb();
+    db.createDb();
+    if (debug) debugger;
+
+    var docs = makeDocs(5);
+
+    // Create the docs
+    var result = db.bulkSave(docs);
+    T(result.ok);
+    T(result.new_revs.length == 5);
+    for (var i = 0; i < 5; i++) {
+      T(result.new_revs[i].id == docs[i]._id);
+      T(result.new_revs[i].rev);
+      docs[i].string = docs[i].string + ".00";
+    }
+
+    // Update the docs
+    result = db.bulkSave(docs);
+    T(result.ok);
+    T(result.new_revs.length == 5);
+    for (i = 0; i < 5; i++) {
+      T(result.new_revs[i].id == i.toString());
+      docs[i]._deleted = true;
+    }
+
+    // Delete the docs
+    result = db.bulkSave(docs);
+    T(result.ok);
+    T(result.new_revs.length == 5);
+    for (i = 0; i < 5; i++) {
+      T(db.open(docs[i]._id) == null);
+    }
+  },
+
   // test saving a semi-large quanitity of documents and do some view queries.
   lots_of_docs: function(debug) {
     var db = new CouchDB("test_suite_db");
@@ -258,6 +294,9 @@
       result = db.query(map, reduce, {startkey: i, endkey: numDocs - i});
       T(result.rows[0].value == summate(numDocs-i) - summate(i-1));
     }
+    
+    db.deleteDb();
+    db.createDb();
 
     for(var i=1; i <= 5; i++) {
       
@@ -276,6 +315,7 @@
         docs.push({keys:["d", "b"]});
         docs.push({keys:["d", "c"]});
         T(db.bulkSave(docs).ok);
+        T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
       }
       
       map = function (doc) {emit(doc.keys, 1)};
@@ -304,6 +344,71 @@
       T(equals(results.rows[5], {key:["d","b"],value:10*i}));
       T(equals(results.rows[6], {key:["d","c"],value:10*i}));
     }
+    
+    // now test out more complex reductions that need to use the combine option.
+    
+    db.deleteDb();
+    db.createDb();
+
+      
+    var map = function (doc) {emit(null, doc.val)};
+    var reduceCombine = function (keys, values, rereduce) {
+        // This computes the standard deviation of the mapped results
+        var stdDeviation=0;
+        var count=0;
+        var total=0;
+        var sqrTotal=0;
+          
+        if (!rereduce) {
+          // This is the reduce phase, we are reducing over emitted values from
+          // the map functions.
+          for(var i in values) {
+            total = total + values[i]
+            sqrTotal = sqrTotal + (values[i] * values[i])
+          }
+          count = values.length;
+        }
+        else { 
+          // This is the rereduce phase, we are re-reducing previosuly
+          // reduced values.
+          for(var i in values) {
+            count = count + values[i].count;
+            total = total + values[i].total;
+            sqrTotal = sqrTotal + (values[i].sqrTotal * values[i].sqrTotal);
+          }
+        }
+        
+        var variance =  (sqrTotal - ((total * total)/count)) / count;
+        stdDeviation = Math.sqrt(variance);
+          
+        // the reduce result. It contains enough information to be rereduced
+        // with other reduce results.
+        return {"stdDeviation":stdDeviation,"count":count,
+            "total":total,"sqrTotal":sqrTotal};
+      };
+      
+      // Save a bunch a docs.
+      for(var j=0; j < 10; j++) {
+        var docs = [];
+        docs.push({val:10});
+        docs.push({val:20});
+        docs.push({val:30});
+        docs.push({val:40});
+        docs.push({val:50});
+        docs.push({val:60});
+        docs.push({val:70});
+        docs.push({val:80});
+        docs.push({val:90});
+        docs.push({val:100});
+        T(db.bulkSave(docs).ok);
+      }
+      
+      var results = db.query(map, reduceCombine);
+      
+      var difference = results.rows[0].value.stdDeviation - 28.722813232690143;
+      // account for floating point rounding error
+      T(Math.abs(difference) < 0.0000000001);
+      
   },
 
   multiple_rows: function(debug) {
@@ -478,6 +583,14 @@
     if (debug) debugger;
 
     var numDocs = 500;
+    
+    function makebigstring(power) {
+      var str = "a";
+      while(power-- > 0) {
+        str = str + str;
+      }
+      return str;
+    }
 
     var designDoc = {
       _id:"_design/test",
@@ -489,7 +602,9 @@
         summate: {map:"function (doc) {emit(doc.integer, doc.integer)};",
                   reduce:"function (keys, values) { return sum(values); };"},
         summate2: {map:"function (doc) {emit(doc.integer, doc.integer)};",
-                  reduce:"function (keys, values) { return sum(values); };"}
+                  reduce:"function (keys, values) { return sum(values); };"},
+        huge_src_and_results: {map: "function(doc) { if (doc._id == \"1\") { emit(\"" + makebigstring(16) + "\", null) }}",
+                  reduce:"function (keys, values) { return \"" + makebigstring(16) + "\"; };"}
       }
     }
     T(db.save(designDoc).ok);
@@ -1070,8 +1185,12 @@
 
 function makeDocs(start, end, templateDoc) {
   var templateDocSrc = templateDoc ? templateDoc.toSource() : "{}"
+  if (end === undefined) {
+    end = start;
+    start = 0;
+  }
   var docs = []
-  for(var i=start; i<end; i++) {
+  for (var i = start; i < end; i++) {
     var newDoc = eval("(" + templateDocSrc + ")");
     newDoc._id = (i).toString();
     newDoc.integer = i

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js [utf-8] Sat Jun 14 10:48:24 2008
@@ -1,13 +1,13 @@
 (function(){
 /*
- * jQuery 1.2.5 - New Wave Javascript
+ * jQuery 1.2.6 - New Wave Javascript
  *
  * Copyright (c) 2008 John Resig (jquery.com)
  * Dual licensed under the MIT (MIT-LICENSE.txt)
  * and GPL (GPL-LICENSE.txt) licenses.
  *
- * $Date: 2008-05-20 23:14:54 -0400 (Tue, 20 May 2008) $
- * $Rev: 5651 $
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
  */
 
 // Map over jQuery in case of overwrite
@@ -84,7 +84,7 @@
 	},
 
 	// The current version of jQuery being used
-	jquery: "1.2.5",
+	jquery: "1.2.6",
 
 	// The number of elements contained in the matched element set
 	size: function() {
@@ -402,6 +402,9 @@
 			return undefined;
 		}
 
+		if( value.constructor == Number )
+			value += '';
+
 		return this.each(function(){
 			if ( this.nodeType != 1 )
 				return;
@@ -428,7 +431,7 @@
 
 	html: function( value ) {
 		return value == undefined ?
-			(this.length ?
+			(this[0] ?
 				this[0].innerHTML :
 				null) :
 			this.empty().append( value );
@@ -505,9 +508,9 @@
 					this;
 
 				// execute all scripts after the elements have been injected
-				if ( jQuery.nodeName( elem, "script" ) ) {
+				if ( jQuery.nodeName( elem, "script" ) )
 					scripts = scripts.add( elem );
-				} else {
+				else {
 					// Remove any inner scripts for later evaluation
 					if ( elem.nodeType == 1 )
 						scripts = scripts.add( jQuery( "script", elem ).remove() );
@@ -746,14 +749,14 @@
 	},
 
 	prop: function( elem, value, type, i, name ) {
-			// Handle executable functions
-			if ( jQuery.isFunction( value ) )
-				value = value.call( elem, i );
-
-			// Handle passing in a number to a CSS property
-			return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
-				value + "px" :
-				value;
+		// Handle executable functions
+		if ( jQuery.isFunction( value ) )
+			value = value.call( elem, i );
+
+		// Handle passing in a number to a CSS property
+		return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
+			value + "px" :
+			value;
 	},
 
 	className: {
@@ -1058,7 +1061,7 @@
 				elem.parentNode.selectedIndex;
 
 			// If applicable, access the attribute via the DOM 0 way
-			if ( notxml && !special && name in elem ) {
+			if ( name in elem && notxml && !special ) {
 				if ( set ){
 					// We can't allow the type property to be changed (since it causes problems in IE)
 					if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
@@ -1081,11 +1084,13 @@
 				// convert the value to a string (all browsers do this but IE) see #1070
 				elem.setAttribute( name, "" + value );
 
-			if ( msie && special && notxml )
-				return elem.getAttribute( name, 2 );
-
-			return elem.getAttribute( name );
+			var attr = msie && notxml && special
+					// Some attributes require a special call on IE
+					? elem.getAttribute( name, 2 )
+					: elem.getAttribute( name );
 
+			// Non-existent attributes return null, we normalize to undefined
+			return attr === null ? undefined : attr;
 		}
 
 		// elem is actually elem.style ... set the style

Modified: incubator/couchdb/branches/runtimeconfig/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/src/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,6 +10,4 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 SUBDIRS = couchdb mochiweb

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 ICU_LOCAL_FLAGS = $(ICU_LOCAL_CFLAGS) $(ICU_LOCAL_LDFLAGS)
 
 couchprivlibdir = $(erlanglibdir)/couch-$(version)/priv/lib
@@ -86,7 +84,7 @@
 	chmod +x $@
 
 %.beam: %.erl
-	erlc $<
+	$(ERLC) $<
 
 install-data-hook:
 	if test -f "$(DESTDIR)/$(couchprivlibdir)/couch_erl_driver"; then \

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_btree.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_btree.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_btree.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_btree.erl Sat Jun 14 10:48:24 2008
@@ -64,7 +64,7 @@
 final_reduce(_Bt, {[], [Red]}) ->
     Red;
 final_reduce(Reduce, {[], Reductions}) ->
-    Reduce(combine, Reductions);
+    Reduce(rereduce, Reductions);
 final_reduce(Reduce, {KVs, Reductions}) ->
     Red = Reduce(reduce, KVs),
     final_reduce(Reduce, {[], [Red | Reductions]}).
@@ -255,7 +255,7 @@
     lists:reverse([lists:reverse(OutList) | OutputChunks]);
 chunkify(Bt, [InElement | RestInList], ChunkThreshold, OutList, OutListSize, OutputChunks) ->
     case size(term_to_binary(InElement)) of
-    Size when (Size + OutListSize) > ChunkThreshold ->
+    Size when (Size + OutListSize) > ChunkThreshold andalso OutList /= [] ->
         chunkify(Bt, RestInList, ChunkThreshold, [], 0, [lists:reverse([InElement | OutList]) | OutputChunks]);
     Size ->
         chunkify(Bt, RestInList, ChunkThreshold, [InElement | OutList], OutListSize + Size, OutputChunks)
@@ -289,7 +289,7 @@
 reduce_node(#btree{reduce=nil}, _NodeType, _NodeList) ->
     [];
 reduce_node(#btree{reduce=R}, kp_node, NodeList) ->
-    R(combine, [Red || {_K, {_P, Red}} <- NodeList]);
+    R(rereduce, [Red || {_K, {_P, Red}} <- NodeList]);
 reduce_node(#btree{reduce=R}, kv_node, NodeList) ->
     R(reduce, NodeList).
 
@@ -398,6 +398,9 @@
     end.
 
 
+reduce_stream_node(_Bt, _Dir, nil, _KeyStart, _KeyEnd, GroupedKey, GroupedKVsAcc, 
+        GroupedRedsAcc, _KeyGroupFun, _Fun, Acc) ->
+    {ok, Acc, GroupedRedsAcc, GroupedKVsAcc, GroupedKey}; 
 reduce_stream_node(Bt, Dir, {P, _R}, KeyStart, KeyEnd, GroupedKey, GroupedKVsAcc, 
         GroupedRedsAcc, KeyGroupFun, Fun, Acc) ->
     case get_node(Bt, P) of
@@ -655,7 +658,7 @@
     ReduceFun =
         fun(reduce, KVs) ->
             length(KVs);
-        (combine, Reds) ->
+        (rereduce, Reds) ->
             lists:sum(Reds)
         end,
     Btree1 = set_options(Btree, [{reduce, ReduceFun}]),

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl Sat Jun 14 10:48:24 2008
@@ -440,13 +440,13 @@
 btree_by_id_reduce(reduce, FullDocInfos) ->
     % count the number of deleted documents
     length([1 || #full_doc_info{deleted=false} <- FullDocInfos]);
-btree_by_id_reduce(combine, Reds) ->
+btree_by_id_reduce(rereduce, Reds) ->
     lists:sum(Reds).
             
 btree_by_seq_reduce(reduce, DocInfos) ->
     % count the number of deleted documents
     length(DocInfos);
-btree_by_seq_reduce(combine, Reds) ->
+btree_by_seq_reduce(rereduce, Reds) ->
     lists:sum(Reds).
 
 init_db(DbName, Filepath, Fd, Header) ->
@@ -597,6 +597,7 @@
                 [Db#db.update_seq, NewSeq]),
             Pid = spawn_link(couch_db, start_copy_compact_int, [Db, false]),
             Db2 = Db#db{compactor_pid=Pid},
+            couch_file:close(NewFd),
             update_loop(Db2)
         end;
     {OrigFrom, increment_update_seq} ->

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_file.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_file.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_file.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_file.erl Sat Jun 14 10:48:24 2008
@@ -93,7 +93,19 @@
 %%----------------------------------------------------------------------
 
 append_term(Fd, Term) ->
-    gen_server:call(Fd, {append_term, Term}).
+    append_binary(Fd, term_to_binary(Term, [compressed])).
+
+
+%%----------------------------------------------------------------------
+%% Purpose: To append an Erlang binary to the end of the file.
+%% Args:    Erlang term to serialize and append to the file.
+%% Returns: {ok, Pos} where Pos is the file offset to the beginning the
+%%  serialized  term. Use pread_term to read the term back.
+%%  or {error, Reason}.
+%%----------------------------------------------------------------------
+    
+append_binary(Fd, Bin) ->
+    gen_server:call(Fd, {append_bin, Bin}).
 
 
 %%----------------------------------------------------------------------
@@ -104,7 +116,18 @@
 %%----------------------------------------------------------------------
 
 pread_term(Fd, Pos) ->
-    gen_server:call(Fd, {pread_term, Pos}).
+    {ok, Bin} = pread_binary(Fd, Pos),
+    {ok, binary_to_term(Bin)}.
+
+%%----------------------------------------------------------------------
+%% Purpose: Reads a binrary from a file that was written with append_binary
+%% Args:    Pos, the offset into the file where the term is serialized.
+%% Returns: {ok, Term}
+%%  or {error, Reason}.
+%%----------------------------------------------------------------------
+
+pread_binary(Fd, Pos) ->
+    gen_server:call(Fd, {pread_bin, Pos}).
 
 
 %%----------------------------------------------------------------------
@@ -144,30 +167,35 @@
 
 
 write_header(Fd, Prefix, Data) ->
-    ok = sync(Fd),
     TermBin = term_to_binary(Data),
     % the size of all the bytes written to the header, including the md5 signature (16 bytes)
     FilledSize = size(Prefix) + size(TermBin) + 16,
+    {TermBin2, FilledSize2} =
     case FilledSize > ?HEADER_SIZE of
     true ->
         % too big!
-        {error, error_header_too_large};
+        {ok, Pos} = append_binary(Fd, TermBin),
+        PtrBin = term_to_binary({pointer_to_header_data, Pos}),
+        {PtrBin, size(Prefix) + size(PtrBin) + 16};
     false ->
-        % pad out the header with zeros, then take the md5 hash
-        PadZeros = <<0:(8*(?HEADER_SIZE - FilledSize))>>,
-        Sig = erlang:md5([TermBin, PadZeros]),
-        % now we assemble the final header binary and write to disk
-        WriteBin = <<Prefix/binary, TermBin/binary, PadZeros/binary, Sig/binary>>,
-        ?HEADER_SIZE = size(WriteBin), % sanity check
-        DblWriteBin = [WriteBin, WriteBin],
-        ok = pwrite(Fd, 0, DblWriteBin),
-        ok = sync(Fd)
-    end.
+        {TermBin, FilledSize}
+    end,
+    ok = sync(Fd),
+    % pad out the header with zeros, then take the md5 hash
+    PadZeros = <<0:(8*(?HEADER_SIZE - FilledSize2))>>,
+    Sig = erlang:md5([TermBin2, PadZeros]),
+    % now we assemble the final header binary and write to disk
+    WriteBin = <<Prefix/binary, TermBin2/binary, PadZeros/binary, Sig/binary>>,
+    ?HEADER_SIZE = size(WriteBin), % sanity check
+    DblWriteBin = [WriteBin, WriteBin],
+    ok = pwrite(Fd, 0, DblWriteBin),
+    ok = sync(Fd).
 
 
 read_header(Fd, Prefix) ->
     {ok, Bin} = couch_file:pread(Fd, 0, 2*(?HEADER_SIZE)),
     <<Bin1:(?HEADER_SIZE)/binary, Bin2:(?HEADER_SIZE)/binary>> = Bin,
+    Result =
     % read the first header
     case extract_header(Prefix, Bin1) of
     {ok, Header1} ->
@@ -200,9 +228,14 @@
             % return the error, no need to log anything as the caller will be responsible for dealing with the error.
             {error, Error}
         end
+    end,
+    case Result of
+    {ok, {pointer_to_header_data, Ptr}} ->
+        pread_term(Fd, Ptr);
+    _ ->
+        Result
     end.
-
-
+    
 extract_header(Prefix, Bin) ->
     SizeOfPrefix = size(Prefix),
     SizeOfTermBin = ?HEADER_SIZE -
@@ -300,17 +333,16 @@
 handle_call({truncate, Pos}, _From, Fd) ->
     {ok, Pos} = file:position(Fd, Pos),
     {reply, file:truncate(Fd), Fd};
-handle_call({append_term, Term}, _From, Fd) ->
-    Bin = term_to_binary(Term, [compressed]),
-    TermLen = size(Bin),
-    Bin2 = <<TermLen:32, Bin/binary>>,
+handle_call({append_bin, Bin}, _From, Fd) ->
+    Len = size(Bin),
+    Bin2 = <<Len:32, Bin/binary>>,
     {ok, Pos} = file:position(Fd, eof),
     {reply, {file:pwrite(Fd, Pos, Bin2), Pos}, Fd};
-handle_call({pread_term, Pos}, _From, Fd) ->
+handle_call({pread_bin, Pos}, _From, Fd) ->
     {ok, <<TermLen:32>>}
         = file:pread(Fd, Pos, 4),
     {ok, Bin} = file:pread(Fd, Pos + 4, TermLen),
-    {reply, {ok, binary_to_term(Bin)}, Fd}.
+    {reply, {ok, Bin}, Fd}.
 
 
 handle_cast(close, Fd) ->

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl Sat Jun 14 10:48:24 2008
@@ -271,18 +271,6 @@
 handle_db_request(_Req, _Method, {_DbName, _Db, ["_compact"]}) ->
     throw({method_not_allowed, "POST"});
 
-handle_db_request(Req, 'GET', {DbName, _Db, ["_search"]}) ->
-    case Req:parse_qs() of
-        [{"q", Query}] when (length(Query) > 0) ->
-            {ok, Response} = couch_ft_query:execute(DbName, Query),
-            send_json(Req, {obj, [{ok, true} | Response]});
-        _Error ->
-            throw({no_fulltext_query, "Empty Query String"})
-    end;
-
-handle_db_request(_Req, _Method, {_DbName, _Db, ["_search"]}) ->
-    throw({method_not_allowed, "GET,HEAD"});
-
 % View request handlers
 
 handle_db_request(Req, 'GET', {_DbName, Db, ["_all_docs"]}) ->
@@ -501,7 +489,9 @@
             Resp:write_chunk(AccSeparator ++ Json),
             {ok, {",",0,AccCount-1}};
         (Key, Red, {AccSeparator,0,AccCount})
-                when is_tuple(Key) and is_integer(GroupLevel) ->
+                when is_integer(GroupLevel) 
+                andalso is_tuple(Key) 
+                andalso element(1, Key) /= obj  ->
             Json = lists:flatten(cjson:encode(
                 {obj, [{key, list_to_tuple(lists:sublist(tuple_to_list(Key), GroupLevel))},
                         {value, Red}]})),
@@ -589,8 +579,7 @@
                     Json = lists:flatten(cjson:encode({obj, [{ok, JsonDoc}]})),
                     Resp:write_chunk(AccSeparator ++ Json);
                 {{not_found, missing}, RevId} ->
-                    Json = {obj, [{"missing", RevId}]},
-                    Json = lists:flatten(cjson:encode(Json)),
+                    Json = lists:flatten(cjson:encode({obj, [{"missing", RevId}]})),
                     Resp:write_chunk(AccSeparator ++ Json)
                 end,
                 "," % AccSeparator now has a comma
@@ -834,14 +823,14 @@
             Resp2 = start_json_response(Req, 200),
             Offset2 = TotalViewCount - Offset -
                 lists:min([TotalViewCount - Offset, - AccCount]),
-            JsonBegin = io_lib:format("{\"total_rows\":~w,\"offset\":~w,\"rows\":[",
+            JsonBegin = io_lib:format("{\"total_rows\":~w,\"offset\":~w,\"rows\":[\r\n",
                     [TotalViewCount, Offset2]),
             Resp2:write_chunk(lists:flatten(JsonBegin)),
             JsonObj = {obj, [{id, DocId}, {key, Key}, {value, Value}]},
             {ok, {AccCount + 1, 0, Resp2, [cjson:encode(JsonObj) | AccRevRows]}};
         {_, AccCount, _, Resp} ->
             JsonObj = {obj, [{id, DocId}, {key, Key}, {value, Value}]},
-            {ok, {AccCount + 1, 0, Resp, [cjson:encode(JsonObj), "," | AccRevRows]}}
+            {ok, {AccCount + 1, 0, Resp, [cjson:encode(JsonObj), ",\r\n" | AccRevRows]}}
         end
     end,
 

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_query_servers.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_query_servers.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_query_servers.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_query_servers.erl Sat Jun 14 10:48:24 2008
@@ -17,7 +17,7 @@
 
 -export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2,code_change/3,stop/0]).
 -export([start_doc_map/2, map_docs/2, stop_doc_map/1]).
--export([reduce/3, combine/3]).
+-export([reduce/3, rereduce/3]).
 -export([test/0]).
 
 -include("couch_db.hrl").
@@ -153,15 +153,15 @@
      [Heads | group_reductions_results(Tails)]
     end.
 
-combine(_Lang, [], _ReducedValues) ->
+rereduce(_Lang, [], _ReducedValues) ->
     {ok, []};
-combine(Lang, RedSrcs, ReducedValues) ->
+rereduce(Lang, RedSrcs, ReducedValues) ->
     Port = get_linked_port(Lang),
     Grouped = group_reductions_results(ReducedValues),
     Results = lists:zipwith(
         fun(FunSrc, Values) ->
             {true, {Result}} = 
-                prompt(Port, {"combine", {FunSrc}, list_to_tuple(Values)}),
+                prompt(Port, {"rereduce", {FunSrc}, list_to_tuple(Values)}),
             Result
         end, RedSrcs, Grouped),
         

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_server_sup.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_server_sup.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_server_sup.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_server_sup.erl Sat Jun 14 10:48:24 2008
@@ -42,7 +42,7 @@
     end,
 
     % read config and register for configuration changes
-    
+
     % just stop if one of the config settings change. couch_server_sup
     % will restart us and then we will pick up the new settings.
     ConfigChangeCallbackFunction =  fun() -> ?MODULE:stop() end,
@@ -119,7 +119,10 @@
                 [couch_ft_query]}]
         end,
 
-    couch_util:start_driver(),
+    io:format("Apache CouchDB ~s (LogLevel=~s)~n", [couch_server:get_version(), LogLevel]),
+    io:format("~s~n~n", [ConsoleStartupMsg]),
+
+    couch_util:start_driver(UtilDriverDir),
 
     % ensure these applications are running
     application:start(inets),

Modified: incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_view.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_view.erl?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_view.erl (original)
+++ incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_view.erl Sat Jun 14 10:48:24 2008
@@ -22,12 +22,12 @@
 -include("couch_db.hrl").
 
 -record(group,
-    {db,
-    fd,
+    {sig=nil,
+    db=nil,
+    fd=nil,
     name,
     def_lang,
     views,
-    reductions=[], % list of reduction names and id_num of view that contains it.
     id_btree=nil,
     current_seq=0,
     query_server=nil
@@ -118,9 +118,9 @@
         fun(reduce, KVs) ->
             {ok, Reduced} = couch_query_servers:reduce(Lang, [FunSrc], KVs),
             {0, PreResultPadding ++ Reduced ++ PostResultPadding};
-        (combine, Reds) ->
+        (rereduce, Reds) ->
             UserReds = [[lists:nth(NthRed, UserRedsList)] || {_, UserRedsList} <- Reds],
-            {ok, Reduced} = couch_query_servers:combine(Lang, [FunSrc], UserReds),
+            {ok, Reduced} = couch_query_servers:rereduce(Lang, [FunSrc], UserReds),
             {0, PreResultPadding ++ Reduced ++ PostResultPadding}
         end,
     WrapperFun = fun({GroupedKey, _}, PartialReds, Acc0) ->
@@ -157,7 +157,7 @@
     couch_btree:final_reduce(
         fun(reduce, KVs) ->
             {length(KVs), []};
-        (combine, Reds) ->
+        (rereduce, Reds) ->
             {lists:sum([Count0 || {Count0, _} <- Reds]), []}
         end, Reductions),
     Count.
@@ -192,7 +192,8 @@
             {View#view{id_num=N},N+1}
         end, 0, dict:to_list(DictBySrc)),
     
-    reset_group(#group{name=Id, views=Views, def_lang=Language}).
+    Group = #group{name=Id, views=Views, def_lang=Language},
+    Group#group{sig=erlang:md5(term_to_binary(Group))}.
     
 
 
@@ -337,7 +338,7 @@
             current_seq=0,
             def_lang=Lang,
             id_btree=nil},
-        Group2 = disk_group_to_mem(Db, Fd, Group),
+        Group2 = init_group(Db, Fd, Group,nil),
         temp_update_loop(Group2, NotifyPids);
     Else ->
         exit(Else)
@@ -361,7 +362,7 @@
     start_update_loop(RootDir, DbName, GroupId, get_notify_pids(1000)).
     
 start_update_loop(RootDir, DbName, GroupId, NotifyPids) ->
-    {Db, DbGroup} =
+    {Db, Group} =
     case (catch couch_server:open(DbName)) of
     {ok, Db0} ->
         case (catch couch_db:open_doc(Db0, GroupId)) of
@@ -376,38 +377,37 @@
  	    exit(Else)
  	end,
  	FileName = RootDir ++ "/." ++ DbName ++ GroupId ++".view",
- 	Group =
+ 	Group2 =
     case couch_file:open(FileName) of
     {ok, Fd} ->
+        Sig = Group#group.sig,
         case (catch couch_file:read_header(Fd, <<$r, $c, $k, 0>>)) of
-        {ok, ExistingDiskGroup} ->
-            % validate all the view definitions in the index are correct.
-            case reset_group(ExistingDiskGroup) == reset_group(DbGroup) of
-            true  -> disk_group_to_mem(Db, Fd, ExistingDiskGroup);
-            false -> reset_file(Db, Fd, DbName, DbGroup)
-            end;
+        {ok, {Sig, HeaderInfo}} ->
+            % sigs match!
+            init_group(Db, Fd, Group, HeaderInfo);
         _ ->
-            reset_file(Db, Fd, DbName, DbGroup)
+            reset_file(Db, Fd, DbName, Group)
         end;
     {error, enoent} ->
         case couch_file:open(FileName, [create]) of
-        {ok, Fd} -> reset_file(Db, Fd, DbName, DbGroup);
+        {ok, Fd} -> reset_file(Db, Fd, DbName, Group);
         Error    -> throw(Error)
         end
     end,
     
-    update_loop(RootDir, DbName, GroupId, Group, NotifyPids).
+    update_loop(RootDir, DbName, GroupId, Group2, NotifyPids).
 
-reset_file(Db, Fd, DbName, #group{name=Name} = DiskReadyGroup) ->
+reset_file(Db, Fd, DbName, #group{sig=Sig,name=Name} = Group) ->
     ?LOG_DEBUG("Reseting group index \"~s\" in db ~s", [Name, DbName]),
     ok = couch_file:truncate(Fd, 0),
-    ok = couch_file:write_header(Fd, <<$r, $c, $k, 0>>, DiskReadyGroup),
-    disk_group_to_mem(Db, Fd, DiskReadyGroup).
+    ok = couch_file:write_header(Fd, <<$r, $c, $k, 0>>, {Sig, nil}),
+    init_group(Db, Fd, reset_group(Group), nil).
 
-update_loop(RootDir, DbName, GroupId, #group{fd=Fd}=Group, NotifyPids) ->
+update_loop(RootDir, DbName, GroupId, #group{sig=Sig,fd=Fd}=Group, NotifyPids) ->
     try update_group(Group) of
     {ok, Group2} ->    
-        ok = couch_file:write_header(Fd, <<$r, $c, $k, 0>>, mem_group_to_disk(Group2)),
+        HeaderData = {Sig, get_index_header_data(Group2)},
+        ok = couch_file:write_header(Fd, <<$r, $c, $k, 0>>, HeaderData),
         [Pid ! {self(), {ok, Group2}} || Pid <- NotifyPids],
         garbage_collect(),
         update_loop(RootDir, DbName, GroupId, Group2, get_notify_pids(100000))
@@ -481,38 +481,35 @@
 delete_index_file(RootDir, DbName, GroupId) ->
     file:delete(RootDir ++ "/." ++ DbName ++ GroupId ++ ".view").
 
-% Given a disk ready group structure, return an initialized, in-memory version.
-disk_group_to_mem(Db, Fd, #group{id_btree=IdState,def_lang=Lang,views=Views}=Group) ->
-    {ok, IdBtree} = couch_btree:open(IdState, Fd),
-    Views2 = lists:map(
-        fun(#view{btree=BtreeState,reduce_funs=RedFuns}=View) ->
+init_group(Db, Fd, #group{views=Views}=Group, nil = _IndexHeaderData) ->
+    init_group(Db, Fd, Group, {0, nil, [nil || _ <- Views]});
+init_group(Db, Fd, #group{def_lang=Lang,views=Views}=Group,
+        {Seq, IdBtreeState, ViewStates} = _IndexHeaderData) ->
+    {ok, IdBtree} = couch_btree:open(IdBtreeState, Fd),
+    Views2 = lists:zipwith(
+        fun(BtreeState, #view{reduce_funs=RedFuns}=View) ->
             FunSrcs = [FunSrc || {_Name, FunSrc} <- RedFuns],
             ReduceFun = 
                 fun(reduce, KVs) ->
                     {ok, Reduced} = couch_query_servers:reduce(Lang, FunSrcs, KVs),
                     {length(KVs), Reduced};
-                (combine, Reds) ->
+                (rereduce, Reds) ->
                     Count = lists:sum([Count0 || {Count0, _} <- Reds]),
                     UserReds = [UserRedsList || {_, UserRedsList} <- Reds],
-                    {ok, Reduced} = couch_query_servers:combine(Lang, FunSrcs, UserReds),
+                    {ok, Reduced} = couch_query_servers:rereduce(Lang, FunSrcs, UserReds),
                     {Count, Reduced}
                 end,
             {ok, Btree} = couch_btree:open(BtreeState, Fd,
                         [{less, fun less_json/2},{reduce, ReduceFun}]),
             View#view{btree=Btree}
         end,
-        Views),
-    Group#group{db=Db, fd=Fd, id_btree=IdBtree, views=Views2}.
-    
-% Given an initialized, in-memory group structure, return a disk ready version.
-mem_group_to_disk(#group{id_btree=IdBtree,views=Views}=Group) ->
-    Views2 = lists:map(
-        fun(#view{btree=Btree}=View) ->
-            State = couch_btree:get_state(Btree),
-            View#view{btree=State}
-        end,
-        Views),
-    Group#group{db=nil, fd=nil, id_btree=couch_btree:get_state(IdBtree), views=Views2}.
+        ViewStates, Views),
+    Group#group{db=Db, fd=Fd, current_seq=Seq, id_btree=IdBtree, views=Views2}.
+
+
+get_index_header_data(#group{current_seq=Seq,id_btree=IdBtree,views=Views}) ->
+    ViewStates = [couch_btree:get_state(Btree) || #view{btree=Btree} <- Views],
+    {Seq, couch_btree:get_state(IdBtree), ViewStates}.
 
 
 
@@ -588,7 +585,7 @@
         end
     end.
 
-process_doc(Db, DocInfo, {Docs, #group{name=GroupId}=Group, ViewKVs, DocIdViewIdKeys, _LastSeq}) ->
+process_doc(Db, DocInfo, {Docs, #group{sig=Sig,name=GroupId}=Group, ViewKVs, DocIdViewIdKeys, _LastSeq}) ->
     % This fun computes once for each document
     #doc_info{id=DocId, update_seq=Seq, deleted=Deleted} = DocInfo,
     case DocId of
@@ -597,11 +594,11 @@
         % anything in the definition changed.
         case couch_db:open_doc(Db, DocInfo) of
         {ok, Doc} ->
-            case design_doc_to_view_group(Doc) == reset_group(Group) of
-            true ->
-                % nothing changed, keeping on computing
+            case design_doc_to_view_group(Doc) of
+            #group{sig=Sig} ->
+                % The same md5 signature, keep on computing
                 {ok, {Docs, Group, ViewKVs, DocIdViewIdKeys, Seq}};
-            false ->
+            _ ->
                 throw(restart)
             end;
         {not_found, deleted} ->

Modified: incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations under
 ## the License.
 
-datarootdir = @prefix@/share
-
 mochiwebebindir = $(erlanglibdir)/mochiweb-r76/ebin
 
 mochiweb_file_collection = \
@@ -78,4 +76,4 @@
     $(mochiwebebin_make_generated_file_list)
 
 %.beam: %.erl
-	erlc $<
+	$(ERLC) $<

Modified: incubator/couchdb/branches/runtimeconfig/var/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/var/Makefile.am?rev=667857&r1=667856&r2=667857&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/var/Makefile.am (original)
+++ incubator/couchdb/branches/runtimeconfig/var/Makefile.am Sat Jun 14 10:48:24 2008
@@ -10,8 +10,6 @@
 ## License for the specific language governing permissions and limitations
 ## under the License.
 
-datarootdir = @prefix@/share
-
 install-data-hook:
 	if test ! "$(mkdir_p)" = ""; then \
 	    $(mkdir_p) "$(DESTDIR)$(pkgstatelibdir)"; \



Mime
View raw message