Check-in [bbcb6326c9]
Not logged in
Overview

SHA1 Hash:bbcb6326c9068b37546503156dc4212ed0c95592
Date: 2007-09-17 00:58:51
User: aku
Comment:Pulled in the navbar and timeline changes.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified ideas.txt from [ff113a4540] to [44635deb96].

@@ -1,5 +1,106 @@
+Possible ticket file format:
+
+   "Ticket"
+   title: TEXT
+   ticketid: TEXT
+   exists-in: BASELINE   -- 0 or more
+   fixed-in: BASELINE    -- 0 or more
+   tag: TAG              -- 0 or more
+   created: DATETIME
+   attachment: FILENAME DESCRIPTION
+   parent: UUID*
+   derived-from: TICKET-FILENAME
+   description: MULTILINE-TEXT
+   remarks: MULTILINE-TEXT
+
+   * Things handles with tags:
+     created-by
+     assigned-to
+     priority
+     severity
+     target-release
+     status
+     resolution
+     type
+     subsystem
+
+Wiki header format:
+   "WikiPage"
+   parent: UUID*
+   title: TEXT
+   pagename: TEXT
+   mode: (readonly|appendonly|readwrite)
+   attachment: UUID name description
+
+   * Header ends with a blank line.  wiki content follows.
+
+Cluster format:
+
+       M+ uuid
+       Z manifest-cksum
+
+   * Cluster generated in server mode only.
+   * Embargo cluster that reference phantoms or other embargoed clusters.
+   * Never send or ihave an embargoed cluster
+
+New sync algorithm based on clusters:
+
+   * Keep a table of unclustered artifacts.  Strive to keep this table
+     less than 100 entries.
+   * Client sends content of unclustered table as ihaves to server
+   * Server builds a new cluster if size of cluster table >100.
+   * Server sends unclustered table to client
+   * Server sends gimme for all unknown ihave received from client
+   * Client sends gimme for all unknown ihave received from server
+   * Previous two steps repeat until no more gimmes
+
+Details of new push algorithm:
+
+   * Table "unsent" contains all files never pushed
+   * TEMP table "wanted" contains files the server does not have
+   Loop:
+     * Client sends login and "push" record
+     * Client sends file message for all files in unsent and removes
+       those files from the table.
+     * Client sends file message for all files in wanted.
+     * Client sends ihave messages for each entry in unclustered
+     ------
+     * Server receives file message
+     * Server creates phantoms for unknown ihaves
+     * Server sends gimme messages for all phantoms
+     ------
+     * Client clears its unsent table
+     * For each gimme message add an entry to wanted
+     * Halt if the wanted table is empty
+
+Details on new pull algorithm:
+
+   Loop:
+     * Client sends login and "pull" record
+     * Client sends "prior" message with repository id and max record number
+     * Client sends "gimme" for each phantom
+     --------
+     * Server creates new clusters to get unclustered size below 100
+     * If there is "prior" message with repository id that matches this
+       server, then send file messages for all record ids greater than
+       prior
+     * Server sends ihave messages for each entry in unclustered
+     * Server sends maxrid message
+     --------
+     * Client receives file records
+     * Client creates phantoms for unknown ihaves
+     * If no phantoms exist, record maxrid for the server and halt
+
+Need a dephantomize algorithm
+
+
+Auxiliary tables needed for new sync algorithm:
+
+   * unsent:  files that have never been sent to another repository
+   * unclustered: non-phantom files not mentioned by a cluster
+
 Random thoughts:
 
   *  Changes to manifest to support:
      +  Trees of wiki pages and tickets
      +  The ability to cap or close a branch
@@ -59,19 +160,44 @@
        descendents and ancestors of the mouseover checkin.
      + Timeline showing individual branches
      + Timeline shows forks and merges
      + Tags shown on timeline (maybe) and in vinfo (surely).
 
+Features needed:
+  * Means to suppress artifacts
+  * Means to cap a branch
+  * Ticketing
+     +  Problem is/is-not expressed in baseline X.
+     +  Append comment and zero or more attachments
+  * Modify comments on baselines
+  * Append comments to any artifact
+  * Wiki?
+
+
+
 Extended manifests.
   * normal manifest has:
        C comment
        D date-time
        F* filename uuid
        P uuid ...           -- omitted for first manifest
        R repository-md5sum
        U user-login
        Z manifest-checksum
+
+  * Accessory:
+       A uuid|* attachment-uuid description
+       B (+|-)branchtag uuid
+       D date-time
+       E uuid new-comment
+       G uuid appended-remark
+       S repositoryid serial-number
+       U userid
+       V (+|-)versiontag uuid
+       X uuid-to-surpress
+       Z this-file-checksum
+
   * Change the comment on a version:   -- always a leaf except in cluster
        D date-time
        E new-comment
        P uuid              -- baseline whose comment is changed
        U user-login

Added src/bag.c version [c1c41296e0]

@@ -1,1 +1,200 @@
+/*
+** Copyright (c) 2007 D. Richard Hipp
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public
+** License version 2 as published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+**
+** You should have received a copy of the GNU General Public
+** License along with this library; if not, write to the
+** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+** Boston, MA  02111-1307, USA.
+**
+** Author contact information:
+**   drh@hwaci.com
+**   http://www.hwaci.com/drh/
+**
+*******************************************************************************
+**
+** This file contains code used to implement a "bag" of integers.
+** A bag is an unordered collection without duplicates.  In this
+** implementation, all elements must be positive integers.
+*/
+#include "config.h"
+#include "bag.h"
+#include <assert.h>
+
+
+#if INTERFACE
+/*
+** An integer can appear in the bag at most once.
+** Integers must be positive.
+*/
+struct Bag {
+  int cnt;   /* Number of integers in the bag */
+  int sz;    /* Number of slots in a[] */
+  int used;  /* Number of used slots in a[] */
+  int *a;    /* Hash table of integers that are in the bag */
+};
+#endif
+
+/*
+** Initialize a Bag structure
+*/
+void bag_init(Bag *p){
+  memset(p, 0, sizeof(*p));
+}
+
+/*
+** Destroy a Bag.  Delete all of its content.
+*/
+void bag_clear(Bag *p){
+  free(p->a);
+  bag_init(p);
+}
+
+/*
+** The hash function
+*/
+#define bag_hash(i)  (i*101)
+
+/*
+** Change the size of the hash table on a bag so that
+** it contains N slots
+*/
+static void bag_resize(Bag *p, int newSize){
+  int i;
+  Bag old;
+
+  old = *p;
+  assert( newSize>old.cnt );
+  p->a = malloc( sizeof(p->a[0])*newSize );
+  p->sz = newSize;
+  memset(p->a, 0, sizeof(p->a[0])*newSize );
+  for(i=0; i<old.sz; i++){
+    int e = old.a[i];
+    if( e>0 ){
+      unsigned h = bag_hash(e)%newSize;
+      while( p->a[h] ){
+        h++;
+        if( h==newSize ) h = 0;
+      }
+      p->a[h] = e;
+    }
+  }
+  p->used = p->cnt;
+  bag_clear(&old);
+}
+
+/*
+** Insert element e into the bag if it is not there already.
+** Return TRUE if the insert actually occurred.  Return FALSE
+** if the element was already in the bag.
+*/
+int bag_insert(Bag *p, int e){
+  unsigned h;
+  int rc = 0;
+  assert( e>0 );
+  if( p->used+1 >= p->sz/2 ){
+    bag_resize(p,  p->cnt*2 + 20 );
+  }
+  h = bag_hash(e)%p->sz;
+  while( p->a[h] && p->a[h]!=e ){
+    h++;
+    if( h>=p->sz ) h = 0;
+  }
+  if( p->a[h]==0 ){
+    p->a[h] = e;
+    p->used++;
+    p->cnt++;
+    rc = 1;
+  }
+  return rc;
+}
+
+/*
+** Return true if e in the bag.  Return false if it is no.
+*/
+int bag_find(Bag *p, int e){
+  unsigned h;
+  assert( e>0 );
+  if( p->sz==0 ){
+    return 0;
+  }
+  h = bag_hash(e)%p->sz;
+  while( p->a[h] && p->a[h]!=e ){
+    h++;
+    if( h>=p->sz ) h = 0;
+  }
+  return p->a[h]==e;
+}
+
+/*
+** Remove element e from the bag if it exists in the bag.
+** If e is not in the bag, this is a no-op.
+*/
+void bag_remove(Bag *p, int e){
+  unsigned h;
+  assert( e>0 );
+  if( p->sz==0 ) return;
+  h = bag_hash(e)%p->sz;
+  while( p->a[h] && p->a[h]!=e ){
+    h++;
+    if( h>=p->sz ) h = 0;
+  }
+  if( p->a[h] ){
+    p->a[h] = -1;
+    p->cnt--;
+    if( p->sz>20 && p->cnt<p->sz/8 ){
+      bag_resize(p, p->sz/2);
+    }
+  }
+}
+
+/*
+** Return the first element in the bag.  Return 0 if the bag
+** is empty.
+*/
+int bag_first(Bag *p){
+  int i;
+  for(i=0; i<p->sz && p->a[i]<=0; i++){}
+  if( i<p->sz ){
+    return p->a[i];
+  }else{
+    return 0;
+  }
+}
+
+/*
+** Return the next element in the bag after e.  Return 0 if
+** is the last element in the bag.  Any insert or removal from
+** the bag might reorder the bag.
+*/
+int bag_next(Bag *p, int e){
+  unsigned h;
+  assert( p->sz>0 );
+  assert( e>0 );
+  h = bag_hash(e)%p->sz;
+  while( p->a[h] && p->a[h]!=e ){
+    h++;
+    if( h>=p->sz ) h = 0;
+  }
+  assert( p->a[h] );
+  h++;
+  while( h<p->sz && p->a[h]<=0 ){
+    h++;
+  }
+  return h<p->sz ? p->a[h] : 0;
+}
 
+/*
+** Return the number of elements in the bag.
+*/
+int bag_count(Bag *p){
+  return p->cnt;
+}

Modified src/checkin.c from [e53057ad70] to [2b31bba6d0].

@@ -391,10 +391,11 @@
     nrid = content_put(&content, 0, 0);
     if( rid>0 ){
       content_deltify(rid, nrid, 0);
     }
     db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id);
+    db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
   }
   db_finalize(&q);
 
   /* Create the manifest */
   blob_zero(&manifest);
@@ -451,10 +452,11 @@
   free(zManifestFile);
   nvid = content_put(&manifest, 0, 0);
   if( nvid==0 ){
     fossil_panic("trouble committing manifest: %s", g.zErrMsg);
   }
+  db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid);
   manifest_crosslink(nvid, &manifest);
   content_deltify(vid, nvid, 0);
   zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid);
   printf("New_Version: %s\n", zUuid);
   zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);

Modified src/content.c from [60a9520d47] to [310f7c7a1f].

@@ -154,10 +154,12 @@
   int size;
   int rid;
   Stmt s1;
   Blob cmpr;
   Blob hash;
+  int markAsUnclustered = 0;
+
   assert( g.repositoryOpen );
   if( pBlob && srcId==0 ){
     sha1sum_blob(pBlob, &hash);
   }else{
     blob_init(&hash, zUuid, -1);
@@ -183,10 +185,11 @@
       db_end_transaction(0);
       return rid;
     }
   }else{
     rid = 0;  /* No entry with the same UUID currently exists */
+    markAsUnclustered = 1;
   }
   db_finalize(&s1);
 
   /* Construct a received-from ID if we do not already have one */
   if( g.rcvid==0 && pBlob!=0 ){
@@ -233,10 +236,17 @@
   /* If the srcId is specified, then the data we just added is
   ** really a delta.  Record this fact in the delta table.
   */
   if( srcId ){
     db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId);
+  }
+
+  /* Add the element to the unclustered table if has never been
+  ** previously seen.
+  */
+  if( markAsUnclustered ){
+    db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid);
   }
 
   /* Finish the transaction and cleanup */
   db_finalize(&s1);
   db_end_transaction(0);

Modified src/db.c from [ca474c1e96] to [7ab2af8add].

@@ -257,11 +257,11 @@
   return sqlite3_column_double(pStmt->pStmt, N);
 }
 const char *db_column_text(Stmt *pStmt, int N){
   return (char*)sqlite3_column_text(pStmt->pStmt, N);
 }
-const char *db_column_malloc(Stmt *pStmt, int N){
+char *db_column_malloc(Stmt *pStmt, int N){
   return mprintf("%s", db_column_text(pStmt, N));
 }
 void db_column_blob(Stmt *pStmt, int N, Blob *pBlob){
   blob_append(pBlob, sqlite3_column_blob(pStmt->pStmt, N),
               sqlite3_column_bytes(pStmt->pStmt, N));

Modified src/delta.c from [4f6e9c70e9] to [e79479fc0f].

@@ -340,15 +340,16 @@
     hash_init(&h, &zOut[base]);
     i = 0;     /* Trying to match a landmark against zOut[base+i] */
     bestCnt = 0;
     while( 1 ){
       int hv;
+      int limit = 250;
 
       hv = hash_32bit(&h) & (MX_LANDMARK-1);
       DEBUG2( printf("LOOKING: %4d [%s]\n", base+i, print16(&zOut[base+i])); )
       iBlock = landmark[hv];
-      while( iBlock>=0 ){
+      while( iBlock>=0 && (limit--)>0 ){
         /*
         ** The hash window has identified a potential match against
         ** landmark block iBlock.  But we need to investigate further.
         **
         ** Look for a region in zOut that matches zSrc. Anchor the search
@@ -404,11 +405,11 @@
       }
 
       /* We have a copy command that does not cause the delta to be larger
       ** than a literal insert.  So add the copy command to the delta.
       */
-      if( bestCnt>0 && base+i>=bestOfst+NHASH ){
+      if( bestCnt>0 ){
         if( bestLitsz>0 ){
           /* Add an insert command before the copy */
           putInt(bestLitsz,&zDelta);
           *(zDelta++) = ':';
           memcpy(zDelta, &zOut[base], bestLitsz);

Modified src/descendents.c from [cea178cd6b] to [420beefa61].

@@ -30,40 +30,105 @@
 
 
 /*
 ** Create a temporary table named "leaves" if it does not
 ** already exist.  Load this table with the RID of all
-** versions that are leaves are which are decended from
+** versions that are leaves which are decended from
 ** version iBase.
 */
 void compute_leaves(int iBase){
-  int generation = 0;
-  int chngCnt = 0;
+  Bag seen;       /* Descendents seen */
+  Bag pending;    /* Unpropagated descendents */
 
   db_multi_exec(
     "CREATE TEMP TABLE IF NOT EXISTS leaves("
-    "  rid INTEGER PRIMARY KEY,"
-    "  generation INTEGER"
+    "  rid INTEGER PRIMARY KEY"
     ");"
     "DELETE FROM leaves;"
-    "INSERT INTO leaves VALUES(%d,0);",
-    iBase
   );
-  do{
-    db_multi_exec(
-      "INSERT OR IGNORE INTO leaves(rid,generation) "
-      "SELECT cid, %d FROM plink"
-      " WHERE pid IN (SELECT rid FROM leaves WHERE generation=%d)",
-      generation+1, generation
+  bag_init(&seen);
+  bag_init(&pending);
+  bag_insert(&pending, iBase);
+  while( bag_count(&pending) ){
+    int rid = bag_first(&pending);
+    int cnt = 0;
+    Stmt q;
+    bag_remove(&pending, rid);
+    db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d", rid);
+    while( db_step(&q)==SQLITE_ROW ){
+      int cid = db_column_int(&q, 0);
+      if( bag_insert(&seen, cid) ){
+        bag_insert(&pending, cid);
+      }
+      cnt++;
+    }
+    db_finalize(&q);
+    if( cnt==0 ){
+      db_multi_exec("INSERT INTO leaves VALUES(%d)", rid);
+    }
+  }
+  bag_clear(&pending);
+  bag_clear(&seen);
+}
+
+/*
+** Load the record ID rid and up to N-1 closest ancestors into
+** the "ok" table.
+*/
+void compute_ancestors(int rid, int N){
+  Bag seen;
+  PQueue queue;
+  bag_init(&seen);
+  pqueue_init(&queue);
+  bag_insert(&seen, rid);
+  pqueue_insert(&queue, rid, 0.0);
+  while( (N--)>0 && (rid = pqueue_extract(&queue))!=0 ){
+    Stmt q;
+    db_multi_exec("INSERT OR IGNORE INTO ok VALUES(%d)", rid);
+    db_prepare(&q,
+       "SELECT a.pid, b.mtime FROM plink a LEFT JOIN plink b ON b.cid=a.pid"
+       " WHERE a.cid=%d", rid
     );
-    generation++;
-    chngCnt = db_changes();
-  }while( chngCnt>0 );
-  db_multi_exec(
-    "DELETE FROM leaves"
-    " WHERE EXISTS(SELECT 1 FROM plink WHERE pid=rid)"
-  );
+    while( db_step(&q)==SQLITE_ROW ){
+      int pid = db_column_int(&q, 0);
+      double mtime = db_column_double(&q, 1);
+      if( bag_insert(&seen, pid) ){
+        pqueue_insert(&queue, pid, -mtime);
+      }
+    }
+    db_finalize(&q);
+  }
+  bag_clear(&seen);
+  pqueue_clear(&queue);
+}
+
+/*
+** Load the record ID rid and up to N-1 closest descendents into
+** the "ok" table.
+*/
+void compute_descendents(int rid, int N){
+  Bag seen;
+  PQueue queue;
+  bag_init(&seen);
+  pqueue_init(&queue);
+  bag_insert(&seen, rid);
+  pqueue_insert(&queue, rid, 0.0);
+  while( (N--)>0 && (rid = pqueue_extract(&queue))!=0 ){
+    Stmt q;
+    db_multi_exec("INSERT OR IGNORE INTO ok VALUES(%d)", rid);
+    db_prepare(&q,"SELECT cid, mtime FROM plink WHERE pid=%d", rid);
+    while( db_step(&q)==SQLITE_ROW ){
+      int pid = db_column_int(&q, 0);
+      double mtime = db_column_double(&q, 1);
+      if( bag_insert(&seen, pid) ){
+        pqueue_insert(&queue, pid, mtime);
+      }
+    }
+    db_finalize(&q);
+  }
+  bag_clear(&seen);
+  pqueue_clear(&queue);
 }
 
 /*
 ** COMMAND:  leaves
 **
@@ -117,12 +182,13 @@
   );
   print_timeline(&q, 20);
   db_finalize(&q);
 }
 
+#if 0
 /*
-** WEBPAGE:  leaves
+** WEB PAGE:  leaves
 **
 ** Find leaves of all branches.
 */
 void branches_page(void){
   Stmt q;
@@ -148,5 +214,6 @@
   @ function xout(id){
   @ }
   @ </script>
   style_footer();
 }
+#endif

Modified src/info.c from [e4bf002e1d] to [1d02bccab4].

@@ -211,11 +211,10 @@
     "       event.user, event.comment"
     "  FROM leaves, plink, blob, event"
     " WHERE plink.cid=leaves.rid"
     "   AND blob.rid=leaves.rid"
     "   AND event.objid=leaves.rid"
-    "   AND +generation>0"
     " ORDER BY event.mtime DESC"
   );
   while( db_step(&q)==SQLITE_ROW ){
     const char *zUuid = db_column_text(&q, 0);
     const char *zDate = db_column_text(&q, 1);
@@ -536,12 +535,14 @@
   style_footer();
 }
 
 /*
 ** WEBPAGE: fview
+** URL: /fview/UUID
 **
-** Show the complete content of a file identified by g.zExtra
+** Show the complete content of a file identified by UUID
+** as preformatted text.
 */
 void fview_page(void){
   int rid;
   Blob content;
 

Modified src/main.c from [500655758a] to [17322e8c2b].

@@ -339,11 +339,11 @@
     printf("\n");
   }
 }
 
 /*
-** COMMAND: commands
+** COM MAND: commands
 **
 ** Usage: %fossil commands
 ** List all supported commands.
 */
 void cmd_cmd_list(void){
@@ -385,10 +385,11 @@
   int rc, idx;
   const char *z;
   if( g.argc!=3 ){
     printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
     cmd_cmd_list();
+    printf("You are running fossil baseline " MANIFEST_UUID "\n");
     return;
   }
   rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
   if( rc==1 ){
     fossil_fatal("unknown command: %s", g.argv[2]);
@@ -408,20 +409,10 @@
       putchar(*z);
       z++;
     }
   }
   putchar('\n');
-}
-
-/*
-** COMMAND: baseline
-**
-** Show the baseline number of the source code from which this
-** fossil executable was generated.
-*/
-void baseline_cmd(void){
-  printf("%s\n", MANIFEST_UUID);
 }
 
 /*
 ** RSS feeds need to reference absolute URLs so we need to calculate
 ** the base URL onto which we add components. This is basically

Modified src/main.mk from [d7d0790c57] to [fc782f901a].

@@ -12,10 +12,11 @@
 XTCC = $(TCC) $(CFLAGS) -I. -I$(SRCDIR)
 
 
 SRC = \
   $(SRCDIR)/add.c \
+  $(SRCDIR)/bag.c \
   $(SRCDIR)/blob.c \
   $(SRCDIR)/cgi.c \
   $(SRCDIR)/checkin.c \
   $(SRCDIR)/checkout.c \
   $(SRCDIR)/clearsign.c \
@@ -39,10 +40,11 @@
   $(SRCDIR)/md5.c \
   $(SRCDIR)/merge.c \
   $(SRCDIR)/merge3.c \
   $(SRCDIR)/name.c \
   $(SRCDIR)/pivot.c \
+  $(SRCDIR)/pqueue.c \
   $(SRCDIR)/printf.c \
   $(SRCDIR)/rebuild.c \
   $(SRCDIR)/schema.c \
   $(SRCDIR)/setup.c \
   $(SRCDIR)/sha1.c \
@@ -59,10 +61,11 @@
   $(SRCDIR)/xfer.c \
   $(SRCDIR)/zip.c
 
 TRANS_SRC = \
   add_.c \
+  bag_.c \
   blob_.c \
   cgi_.c \
   checkin_.c \
   checkout_.c \
   clearsign_.c \
@@ -86,10 +89,11 @@
   md5_.c \
   merge_.c \
   merge3_.c \
   name_.c \
   pivot_.c \
+  pqueue_.c \
   printf_.c \
   rebuild_.c \
   schema_.c \
   setup_.c \
   sha1_.c \
@@ -106,10 +110,11 @@
   xfer_.c \
   zip_.c
 
 OBJ = \
   add.o \
+  bag.o \
   blob.o \
   cgi.o \
   checkin.o \
   checkout.o \
   clearsign.o \
@@ -133,10 +138,11 @@
   md5.o \
   merge.o \
   merge3.o \
   name.o \
   pivot.o \
+  pqueue.o \
   printf.o \
   rebuild.o \
   schema.o \
   setup.o \
   sha1.o \
@@ -184,14 +190,14 @@
 	$(TCC) -o $(APPNAME) $(OBJ) sqlite3.o $(LIB)
 
 clean:
 	rm -f *.o *_.c $(APPNAME) VERSION.h
 	rm -f translate makeheaders mkindex page_index.h headers
-	rm -f add.h blob.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h construct.h content.h db.h delta.h deltacmd.h descendents.h diff.h diffcmd.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h printf.h rebuild.h schema.h setup.h sha1.h style.h sync.h timeline.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h xfer.h zip.h
+	rm -f add.h bag.h blob.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h construct.h content.h db.h delta.h deltacmd.h descendents.h diff.h diffcmd.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h pqueue.h printf.h rebuild.h schema.h setup.h sha1.h style.h sync.h timeline.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h xfer.h zip.h
 
 headers:	makeheaders mkindex $(TRANS_SRC) ./VERSION.h
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	./mkindex $(TRANS_SRC) >page_index.h
 	touch headers
 
 add_.c:	$(SRCDIR)/add.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/add.c | sed -f $(SRCDIR)/VERSION >add_.c
@@ -198,451 +204,471 @@
 
 add.o:	add_.c add.h  $(SRCDIR)/config.h
 	$(XTCC) -o add.o -c add_.c
 
 add.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	touch headers
+
+bag_.c:	$(SRCDIR)/bag.c $(SRCDIR)/VERSION translate
+	./translate $(SRCDIR)/bag.c | sed -f $(SRCDIR)/VERSION >bag_.c
+
+bag.o:	bag_.c bag.h  $(SRCDIR)/config.h
+	$(XTCC) -o bag.o -c bag_.c
+
+bag.h:	makeheaders
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 blob_.c:	$(SRCDIR)/blob.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/blob.c | sed -f $(SRCDIR)/VERSION >blob_.c
 
 blob.o:	blob_.c blob.h  $(SRCDIR)/config.h
 	$(XTCC) -o blob.o -c blob_.c
 
 blob.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 cgi_.c:	$(SRCDIR)/cgi.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/cgi.c | sed -f $(SRCDIR)/VERSION >cgi_.c
 
 cgi.o:	cgi_.c cgi.h  $(SRCDIR)/config.h
 	$(XTCC) -o cgi.o -c cgi_.c
 
 cgi.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 checkin_.c:	$(SRCDIR)/checkin.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/checkin.c | sed -f $(SRCDIR)/VERSION >checkin_.c
 
 checkin.o:	checkin_.c checkin.h  $(SRCDIR)/config.h
 	$(XTCC) -o checkin.o -c checkin_.c
 
 checkin.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 checkout_.c:	$(SRCDIR)/checkout.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/checkout.c | sed -f $(SRCDIR)/VERSION >checkout_.c
 
 checkout.o:	checkout_.c checkout.h  $(SRCDIR)/config.h
 	$(XTCC) -o checkout.o -c checkout_.c
 
 checkout.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 clearsign_.c:	$(SRCDIR)/clearsign.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/clearsign.c | sed -f $(SRCDIR)/VERSION >clearsign_.c
 
 clearsign.o:	clearsign_.c clearsign.h  $(SRCDIR)/config.h
 	$(XTCC) -o clearsign.o -c clearsign_.c
 
 clearsign.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 clone_.c:	$(SRCDIR)/clone.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/clone.c | sed -f $(SRCDIR)/VERSION >clone_.c
 
 clone.o:	clone_.c clone.h  $(SRCDIR)/config.h
 	$(XTCC) -o clone.o -c clone_.c
 
 clone.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 comformat_.c:	$(SRCDIR)/comformat.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/comformat.c | sed -f $(SRCDIR)/VERSION >comformat_.c
 
 comformat.o:	comformat_.c comformat.h  $(SRCDIR)/config.h
 	$(XTCC) -o comformat.o -c comformat_.c
 
 comformat.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 construct_.c:	$(SRCDIR)/construct.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/construct.c | sed -f $(SRCDIR)/VERSION >construct_.c
 
 construct.o:	construct_.c construct.h  $(SRCDIR)/config.h
 	$(XTCC) -o construct.o -c construct_.c
 
 construct.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 content_.c:	$(SRCDIR)/content.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/content.c | sed -f $(SRCDIR)/VERSION >content_.c
 
 content.o:	content_.c content.h  $(SRCDIR)/config.h
 	$(XTCC) -o content.o -c content_.c
 
 content.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 db_.c:	$(SRCDIR)/db.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/db.c | sed -f $(SRCDIR)/VERSION >db_.c
 
 db.o:	db_.c db.h  $(SRCDIR)/config.h
 	$(XTCC) -o db.o -c db_.c
 
 db.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 delta_.c:	$(SRCDIR)/delta.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/delta.c | sed -f $(SRCDIR)/VERSION >delta_.c
 
 delta.o:	delta_.c delta.h  $(SRCDIR)/config.h
 	$(XTCC) -o delta.o -c delta_.c
 
 delta.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 deltacmd_.c:	$(SRCDIR)/deltacmd.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/deltacmd.c | sed -f $(SRCDIR)/VERSION >deltacmd_.c
 
 deltacmd.o:	deltacmd_.c deltacmd.h  $(SRCDIR)/config.h
 	$(XTCC) -o deltacmd.o -c deltacmd_.c
 
 deltacmd.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 descendents_.c:	$(SRCDIR)/descendents.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/descendents.c | sed -f $(SRCDIR)/VERSION >descendents_.c
 
 descendents.o:	descendents_.c descendents.h  $(SRCDIR)/config.h
 	$(XTCC) -o descendents.o -c descendents_.c
 
 descendents.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 diff_.c:	$(SRCDIR)/diff.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/diff.c | sed -f $(SRCDIR)/VERSION >diff_.c
 
 diff.o:	diff_.c diff.h  $(SRCDIR)/config.h
 	$(XTCC) -o diff.o -c diff_.c
 
 diff.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 diffcmd_.c:	$(SRCDIR)/diffcmd.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/diffcmd.c | sed -f $(SRCDIR)/VERSION >diffcmd_.c
 
 diffcmd.o:	diffcmd_.c diffcmd.h  $(SRCDIR)/config.h
 	$(XTCC) -o diffcmd.o -c diffcmd_.c
 
 diffcmd.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 encode_.c:	$(SRCDIR)/encode.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/encode.c | sed -f $(SRCDIR)/VERSION >encode_.c
 
 encode.o:	encode_.c encode.h  $(SRCDIR)/config.h
 	$(XTCC) -o encode.o -c encode_.c
 
 encode.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 file_.c:	$(SRCDIR)/file.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/file.c | sed -f $(SRCDIR)/VERSION >file_.c
 
 file.o:	file_.c file.h  $(SRCDIR)/config.h
 	$(XTCC) -o file.o -c file_.c
 
 file.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 http_.c:	$(SRCDIR)/http.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/http.c | sed -f $(SRCDIR)/VERSION >http_.c
 
 http.o:	http_.c http.h  $(SRCDIR)/config.h
 	$(XTCC) -o http.o -c http_.c
 
 http.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 info_.c:	$(SRCDIR)/info.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/info.c | sed -f $(SRCDIR)/VERSION >info_.c
 
 info.o:	info_.c info.h  $(SRCDIR)/config.h
 	$(XTCC) -o info.o -c info_.c
 
 info.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 login_.c:	$(SRCDIR)/login.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/login.c | sed -f $(SRCDIR)/VERSION >login_.c
 
 login.o:	login_.c login.h  $(SRCDIR)/config.h
 	$(XTCC) -o login.o -c login_.c
 
 login.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 main_.c:	$(SRCDIR)/main.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/main.c | sed -f $(SRCDIR)/VERSION >main_.c
 
 main.o:	main_.c main.h page_index.h $(SRCDIR)/config.h
 	$(XTCC) -o main.o -c main_.c
 
 main.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 manifest_.c:	$(SRCDIR)/manifest.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/manifest.c | sed -f $(SRCDIR)/VERSION >manifest_.c
 
 manifest.o:	manifest_.c manifest.h  $(SRCDIR)/config.h
 	$(XTCC) -o manifest.o -c manifest_.c
 
 manifest.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 md5_.c:	$(SRCDIR)/md5.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/md5.c | sed -f $(SRCDIR)/VERSION >md5_.c
 
 md5.o:	md5_.c md5.h  $(SRCDIR)/config.h
 	$(XTCC) -o md5.o -c md5_.c
 
 md5.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 merge_.c:	$(SRCDIR)/merge.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/merge.c | sed -f $(SRCDIR)/VERSION >merge_.c
 
 merge.o:	merge_.c merge.h  $(SRCDIR)/config.h
 	$(XTCC) -o merge.o -c merge_.c
 
 merge.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 merge3_.c:	$(SRCDIR)/merge3.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/merge3.c | sed -f $(SRCDIR)/VERSION >merge3_.c
 
 merge3.o:	merge3_.c merge3.h  $(SRCDIR)/config.h
 	$(XTCC) -o merge3.o -c merge3_.c
 
 merge3.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 name_.c:	$(SRCDIR)/name.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/name.c | sed -f $(SRCDIR)/VERSION >name_.c
 
 name.o:	name_.c name.h  $(SRCDIR)/config.h
 	$(XTCC) -o name.o -c name_.c
 
 name.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 pivot_.c:	$(SRCDIR)/pivot.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/pivot.c | sed -f $(SRCDIR)/VERSION >pivot_.c
 
 pivot.o:	pivot_.c pivot.h  $(SRCDIR)/config.h
 	$(XTCC) -o pivot.o -c pivot_.c
 
 pivot.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	touch headers
+
+pqueue_.c:	$(SRCDIR)/pqueue.c $(SRCDIR)/VERSION translate
+	./translate $(SRCDIR)/pqueue.c | sed -f $(SRCDIR)/VERSION >pqueue_.c
+
+pqueue.o:	pqueue_.c pqueue.h  $(SRCDIR)/config.h
+	$(XTCC) -o pqueue.o -c pqueue_.c
+
+pqueue.h:	makeheaders
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 printf_.c:	$(SRCDIR)/printf.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/printf.c | sed -f $(SRCDIR)/VERSION >printf_.c
 
 printf.o:	printf_.c printf.h  $(SRCDIR)/config.h
 	$(XTCC) -o printf.o -c printf_.c
 
 printf.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 rebuild_.c:	$(SRCDIR)/rebuild.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/rebuild.c | sed -f $(SRCDIR)/VERSION >rebuild_.c
 
 rebuild.o:	rebuild_.c rebuild.h  $(SRCDIR)/config.h
 	$(XTCC) -o rebuild.o -c rebuild_.c
 
 rebuild.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 schema_.c:	$(SRCDIR)/schema.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/schema.c | sed -f $(SRCDIR)/VERSION >schema_.c
 
 schema.o:	schema_.c schema.h  $(SRCDIR)/config.h
 	$(XTCC) -o schema.o -c schema_.c
 
 schema.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 setup_.c:	$(SRCDIR)/setup.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/setup.c | sed -f $(SRCDIR)/VERSION >setup_.c
 
 setup.o:	setup_.c setup.h  $(SRCDIR)/config.h
 	$(XTCC) -o setup.o -c setup_.c
 
 setup.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 sha1_.c:	$(SRCDIR)/sha1.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/sha1.c | sed -f $(SRCDIR)/VERSION >sha1_.c
 
 sha1.o:	sha1_.c sha1.h  $(SRCDIR)/config.h
 	$(XTCC) -o sha1.o -c sha1_.c
 
 sha1.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 style_.c:	$(SRCDIR)/style.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/style.c | sed -f $(SRCDIR)/VERSION >style_.c
 
 style.o:	style_.c style.h  $(SRCDIR)/config.h
 	$(XTCC) -o style.o -c style_.c
 
 style.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 sync_.c:	$(SRCDIR)/sync.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/sync.c | sed -f $(SRCDIR)/VERSION >sync_.c
 
 sync.o:	sync_.c sync.h  $(SRCDIR)/config.h
 	$(XTCC) -o sync.o -c sync_.c
 
 sync.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 timeline_.c:	$(SRCDIR)/timeline.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/timeline.c | sed -f $(SRCDIR)/VERSION >timeline_.c
 
 timeline.o:	timeline_.c timeline.h  $(SRCDIR)/config.h
 	$(XTCC) -o timeline.o -c timeline_.c
 
 timeline.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 update_.c:	$(SRCDIR)/update.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/update.c | sed -f $(SRCDIR)/VERSION >update_.c
 
 update.o:	update_.c update.h  $(SRCDIR)/config.h
 	$(XTCC) -o update.o -c update_.c
 
 update.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 url_.c:	$(SRCDIR)/url.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/url.c | sed -f $(SRCDIR)/VERSION >url_.c
 
 url.o:	url_.c url.h  $(SRCDIR)/config.h
 	$(XTCC) -o url.o -c url_.c
 
 url.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 user_.c:	$(SRCDIR)/user.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/user.c | sed -f $(SRCDIR)/VERSION >user_.c
 
 user.o:	user_.c user.h  $(SRCDIR)/config.h
 	$(XTCC) -o user.o -c user_.c
 
 user.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 verify_.c:	$(SRCDIR)/verify.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/verify.c | sed -f $(SRCDIR)/VERSION >verify_.c
 
 verify.o:	verify_.c verify.h  $(SRCDIR)/config.h
 	$(XTCC) -o verify.o -c verify_.c
 
 verify.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 vfile_.c:	$(SRCDIR)/vfile.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/vfile.c | sed -f $(SRCDIR)/VERSION >vfile_.c
 
 vfile.o:	vfile_.c vfile.h  $(SRCDIR)/config.h
 	$(XTCC) -o vfile.o -c vfile_.c
 
 vfile.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 wiki_.c:	$(SRCDIR)/wiki.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/wiki.c | sed -f $(SRCDIR)/VERSION >wiki_.c
 
 wiki.o:	wiki_.c wiki.h  $(SRCDIR)/config.h
 	$(XTCC) -o wiki.o -c wiki_.c
 
 wiki.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 wikiformat_.c:	$(SRCDIR)/wikiformat.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/wikiformat.c | sed -f $(SRCDIR)/VERSION >wikiformat_.c
 
 wikiformat.o:	wikiformat_.c wikiformat.h  $(SRCDIR)/config.h
 	$(XTCC) -o wikiformat.o -c wikiformat_.c
 
 wikiformat.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 xfer_.c:	$(SRCDIR)/xfer.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/xfer.c | sed -f $(SRCDIR)/VERSION >xfer_.c
 
 xfer.o:	xfer_.c xfer.h  $(SRCDIR)/config.h
 	$(XTCC) -o xfer.o -c xfer_.c
 
 xfer.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 zip_.c:	$(SRCDIR)/zip.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/zip.c | sed -f $(SRCDIR)/VERSION >zip_.c
 
 zip.o:	zip_.c zip.h  $(SRCDIR)/config.h
 	$(XTCC) -o zip.o -c zip_.c
 
 zip.h:	makeheaders
-	./makeheaders  add_.c:add.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
+	./makeheaders  add_.c:add.h bag_.c:bag.h blob_.c:blob.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendents_.c:descendents.h diff_.c:diff.h diffcmd_.c:diffcmd.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h style_.c:style.h sync_.c:sync.h timeline_.c:timeline.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h ./VERSION.h
 	touch headers
 
 sqlite3.o:	$(SRCDIR)/sqlite3.c
 	$(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_PRIVATE= -DTHREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -c $(SRCDIR)/sqlite3.c -o sqlite3.o
 

Modified src/makemake.tcl from [e6f77439f4] to [a8dc2e6dd4].

@@ -5,10 +5,11 @@
 
 # Basenames of all source files:
 #
 set src {
   add
+  bag
   blob
   cgi
   checkin
   checkout
   clearsign
@@ -32,10 +33,11 @@
   md5
   merge
   merge3
   name
   pivot
+  pqueue
   printf
   rebuild
   schema
   setup
   sha1

Modified src/manifest.c from [2a7dfdcb16] to [3b8a4242be].

@@ -27,11 +27,11 @@
 #include "manifest.h"
 #include <assert.h>
 
 #if INTERFACE
 /*
-** A parsed manifest
+** A parsed manifest or cluster.
 */
 struct Manifest {
   Blob content;         /* The original content blob */
   char *zComment;       /* Decoded comment */
   double rDate;         /* Time in the "D" line */
@@ -44,10 +44,13 @@
     char *zUuid;           /* UUID of the file */
   } *aFile;
   int nParent;          /* Number of parents */
   int nParentAlloc;     /* Slots allocated in azParent[] */
   char **azParent;      /* UUIDs of parents */
+  int nCChild;          /* Number of cluster children */
+  int nCChildAlloc;     /* Number of closts allocated in azCChild[] */
+  char **azCChild;      /* UUIDs of referenced objects in a cluster */
 };
 #endif
 
 
 /*
@@ -55,10 +58,11 @@
 */
 void manifest_clear(Manifest *p){
   blob_reset(&p->content);
   free(p->aFile);
   free(p->azParent);
+  free(p->azCChild);
   memset(p, 0, sizeof(*p));
 }
 
 /*
 ** Parse a manifest blob into a Manifest object.  The Manifest
@@ -140,10 +144,28 @@
       if( p->rDate!=0.0 ) goto manifest_syntax_error;
       if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
       if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
       zDate = blob_terminate(&a1);
       p->rDate = db_double(0.0, "SELECT julianday(%Q)", zDate);
+    }else if( z[0]=='M' ){
+      char *zUuid;
+      md5sum_step_text(blob_buffer(&line), blob_size(&line));
+      if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
+      zUuid = blob_terminate(&a1);
+      if( blob_size(&a1)!=UUID_SIZE ) goto manifest_syntax_error;
+      if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
+      if( p->nCChild>=p->nCChildAlloc ){
+        p->nCChildAlloc = p->nCChildAlloc*2 + 10;
+        p->azCChild =
+           realloc(p->azCChild, p->nCChildAlloc*sizeof(p->azCChild[0]) );
+        if( p->azCChild==0 ) fossil_panic("out of memory");
+      }
+      i = p->nCChild++;
+      p->azCChild[i] = zUuid;
+      if( i>0 && strcmp(p->azCChild[i-1], zUuid)>=0 ){
+        goto manifest_syntax_error;
+      }
     }else if( z[0]=='U' ){
       md5sum_step_text(blob_buffer(&line), blob_size(&line));
       if( p->zUser!=0 ) goto manifest_syntax_error;
       if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
       if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
@@ -291,10 +313,14 @@
 
 /*
 ** Scan record rid/pContent to see if it is a manifest.  If
 ** it is a manifest, then populate the mlink, plink,
 ** filename, and event tables with cross-reference information.
+**
+** (Later:) Also check to see if pContent is a cluster.  If it
+** is a cluster then remove all referenced elements from the
+** unclustered table and create phantoms for any unknown elements.
 */
 int manifest_crosslink(int rid, Blob *pContent){
   int i;
   Manifest m;
   Stmt q;
@@ -321,10 +347,17 @@
     db_multi_exec(
       "INSERT INTO event(type,mtime,objid,user,comment)"
       "VALUES('ci',%.17g,%d,%Q,%Q)",
       m.rDate, rid, m.zUser, m.zComment
     );
+  }
+  for(i=0; i<m.nCChild; i++){
+    int rid;
+    rid = uuid_to_rid(m.azCChild[i], 1);
+    if( rid>0 ){
+      db_multi_exec("DELETE FROM unclustered WHERE rid=%d", rid);
+    }
   }
   db_end_transaction(0);
   manifest_clear(&m);
   return 1;
 }

Added src/pqueue.c version [c849b6ba26]

@@ -1,1 +1,114 @@
+/*
+** Copyright (c) 2007 D. Richard Hipp
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public
+** License version 2 as published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+**
+** You should have received a copy of the GNU General Public
+** License along with this library; if not, write to the
+** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+** Boston, MA  02111-1307, USA.
+**
+** Author contact information:
+**   drh@hwaci.com
+**   http://www.hwaci.com/drh/
+**
+*******************************************************************************
+**
+** This file contains code used to implement a priority queue.
+** A priority queue is a list of items order by a floating point
+** value.  We can insert integers with each integer tied to its
+** value then extract the integer with the smallest value.
+**
+** The way this queue is used, we never expect it to contain more
+** than 2 or 3 elements, so a simple array is sufficient as the
+** implementation.  This could give worst case O(N) insert times,
+** but because of the nature of the problem we expect O(1) performance.
+*/
+#include "config.h"
+#include "pqueue.h"
+#include <assert.h>
+
+
+#if INTERFACE
+/*
+** An integer can appear in the bag at most once.
+** Integers must be positive.
+*/
+struct PQueue {
+  int cnt;   /* Number of entries in the queue */
+  int sz;    /* Number of slots in a[] */
+  struct QueueElement {
+    int id;          /* ID of the element */
+    double value;    /* Value of element.  Kept in ascending order */
+  } *a;
+};
+#endif
+
+/*
+** Initialize a PQueue structure
+*/
+void pqueue_init(PQueue *p){
+  memset(p, 0, sizeof(*p));
+}
+
+/*
+** Destroy a PQueue.  Delete all of its content.
+*/
+void pqueue_clear(PQueue *p){
+  free(p->a);
+  pqueue_init(p);
+}
+
+/*
+** Change the size of the queue so that it contains N slots
+*/
+static void pqueue_resize(PQueue *p, int N){
+  p->a = realloc(p->a, sizeof(p->a[0])*N);
+  p->sz = N;
+}
+
+/*
+** Insert element e into the queue.
+*/
+void pqueue_insert(PQueue *p, int e, double v){
+  int i, j;
+  if( p->cnt+1>p->sz ){
+    pqueue_resize(p, p->cnt+5);
+  }
+  for(i=0; i<p->cnt; i++){
+    if( p->a[i].value>v ){
+      for(j=p->cnt; j>i; j--){
+        p->a[j] = p->a[j-1];
+      }
+      break;
+    }
+  }
+  p->a[i].id = e;
+  p->a[i].value = v;
+  p->cnt++;
+}
 
+/*
+** Extract the first element from the queue (the element with
+** the smallest value) and return its ID.  Return 0 if the queue
+** is empty.
+*/
+int pqueue_extract(PQueue *p){
+  int e, i;
+  if( p->cnt==0 ){
+    return 0;
+  }
+  e = p->a[0].id;
+  for(i=0; i<p->cnt-1; i++){
+    p->a[i] = p->a[i+1];
+  }
+  p->cnt--;
+  return e;
+}

Modified src/rebuild.c from [104f7b4bf8] to [45c4994360].

@@ -52,10 +52,14 @@
     db_multi_exec("DROP TABLE %Q", zTable);
     free(zTable);
   }
   db_multi_exec(zRepositorySchema2);
 
+  db_multi_exec("INSERT INTO unclustered SELECT rid FROM blob");
+  db_multi_exec(
+    "DELETE FROM config WHERE name IN ('remote-code', 'remote-maxid')"
+  );
   db_prepare(&s, "SELECT rid, size FROM blob");
   while( db_step(&s)==SQLITE_ROW ){
     int rid = db_column_int(&s, 0);
     int size = db_column_int(&s, 1);
     if( size>=0 ){
@@ -62,11 +66,11 @@
       Blob content;
       content_get(rid, &content);
       manifest_crosslink(rid, &content);
       blob_reset(&content);
     }else{
-      db_multi_exec("INSERT INTO phantom VALUES(%d)", rid);
+      db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
     }
   }
   return errCnt;
 }
 

Modified src/schema.c from [c780fb4f32] to [2f12edc522].

@@ -162,13 +162,35 @@
 @   comment TEXT
 @ );
 @ CREATE INDEX event_i1 ON event(mtime);
 @ CREATE INDEX event_i2 ON event(objid);
 @
-@ -- A record of phantoms
+@ -- A record of phantoms.  A phantom is a record for which we know the
+@ -- UUID but we do not (yet) know the file content.
 @ --
 @ CREATE TABLE phantom(
+@   rid INTEGER PRIMARY KEY         -- Record ID of the phantom
+@ );
+@
+@ -- Unclustered records.  An unclustered record is a record (including
+@ -- a cluster records themselves) that is not mentioned by some other
+@ -- cluster.
+@ --
+@ -- Phantoms are usually included in the unclustered table.  A new cluster
+@ -- will never be created that contains a phantom.  But another repository
+@ -- might send us a cluster that contains entries that are phantoms to
+@ -- us.
+@ --
+@ CREATE TABLE unclustered(
+@   rid INTEGER PRIMARY KEY         -- Record ID of the unclustered file
+@ );
+@
+@ -- Records which have never been pushed to another server.  This is
+@ -- used to reduce push operations to a single HTTP request in the
+@ -- common case when one repository only talks to a single server.
+@ --
+@ CREATE TABLE unsent(
 @   rid INTEGER PRIMARY KEY         -- Record ID of the phantom
 @ );
 @
 @ -- Aggregated ticket information
 @ --

Modified src/setup.c from [1750dc4678] to [0c2a6e74d5].

@@ -520,11 +520,12 @@
 
   @ <hr>
   entry_attribute("Home page", 60, "homepage", "hp", "");
   @ <p>The name of a wiki file that is the homepage for the website.
   @ The home page is the page that is displayed by the "Home" link
-  @ at the top of this screen.</p>
+  @ at the top of this screen.  Omit the path and the ".wiki"
+  @ suffix.  </p>
 
   entry_attribute("Ticket subdirectory", 60, "ticket-subdir", "tsd", "");
   @ <p>A subdirectory in the file hierarchy that contains all trouble
   @ tickets.  Leave this blank to disable ticketing.  Tickets text
   @ files within this subdirectory containing a particular format

Modified src/style.c from [7dcde67735] to [4e8cafc457].

@@ -133,13 +133,20 @@
 ** WEBPAGE: index
 ** WEBPAGE: home
 ** WEBPAGE: not_found
 */
 void page_index(void){
-  style_header("Main Title Page");
-  @ This will become the title page
-  style_footer();
+  char *zHome = db_get("homepage", 0);
+  if( zHome ){
+    g.zExtra = zHome;
+    g.okRdWiki = 1;
+    wiki_page();
+  }else{
+    style_header("Main Title Page");
+    @ No homepage configured for this server
+    style_footer();
+  }
 }
 
 /*
 ** WEBPAGE: test_env
 */

Modified src/timeline.c from [7962fee79e] to [6222d040d3].

@@ -22,10 +22,11 @@
 *******************************************************************************
 **
 ** This file contains code to implement the timeline web page
 **
 */
+#include <string.h>
 #include "config.h"
 #include "timeline.h"
 
 /*
 ** Generate a hyperlink to a version.
@@ -87,24 +88,37 @@
 **    6.  Number of parents
 **    7.  True if is a leaf
 */
 void www_print_timeline(
   Stmt *pQuery,
-  char *zLastDate,
+  int *pFirstEvent,
+  int *pLastEvent,
   int (*xCallback)(int, Blob*),
   Blob *pArg
  ){
   char zPrevDate[20];
+  int cnt = 0;
   zPrevDate[0] = 0;
+  db_multi_exec(
+     "CREATE TEMP TABLE IF NOT EXISTS seen(rid INTEGER PRIMARY KEY);"
+     "DELETE FROM seen;"
+  );
   @ <table cellspacing=0 border=0 cellpadding=0>
   while( db_step(pQuery)==SQLITE_ROW ){
     int rid = db_column_int(pQuery, 0);
     const char *zUuid = db_column_text(pQuery, 1);
     int nPChild = db_column_int(pQuery, 5);
     int nParent = db_column_int(pQuery, 6);
     int isLeaf = db_column_int(pQuery, 7);
     const char *zDate = db_column_text(pQuery, 2);
+    if( cnt==0 && pFirstEvent ){
+      *pFirstEvent = rid;
+    }
+    if( pLastEvent ){
+      *pLastEvent = rid;
+    }
+    db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid);
     if( xCallback ){
       xCallback(rid, pArg);
     }
     if( memcmp(zDate, zPrevDate, 10) ){
       sprintf(zPrevDate, "%.10s", zDate);
@@ -132,13 +146,10 @@
     if( isLeaf ){
       @ <b>Leaf</b>
     }
     @ %h(db_column_text(pQuery,3))
     @ (by %h(db_column_text(pQuery,4)))</td></tr>
-    if( zLastDate ){
-      strcpy(zLastDate, zDate);
-    }
   }
   @ </table>
 }
 
 /*
@@ -172,18 +183,33 @@
   return 0;
 }
 
 /*
 ** WEBPAGE: timeline
+**
+** Query parameters:
+**
+**    d=STARTDATE    date in iso8601 notation.          dflt: newest event
+**    n=INTEGER      number of events to show.          dflt: 25
+**    e=INTEGER      starting event id.                 dflt: nil
+**    u=NAME         show only events from user.        dflt: nil
+**    a              show events after and including.   dflt: false
+**    r              show only related events.          dflt: false
 */
 void page_timeline(void){
   Stmt q;
   char *zSQL;
   Blob scriptInit;
   char zDate[100];
   const char *zStart = P("d");
-  int nEntry = atoi(PD("n","25"));
+  int nEntry = atoi(PD("n","20"));
+  const char *zUser = P("u");
+  int objid = atoi(PD("e","0"));
+  int relatedEvents = P("r")!=0;
+  int afterFlag = P("a")!=0;
+  int firstEvent;
+  int lastEvent;
 
   /* To view the timeline, must have permission to read project data.
   */
   login_check_credentials();
   if( !g.okRead ){ login_needed(); return; }
@@ -202,23 +228,46 @@
     "       (SELECT count(*) FROM plink WHERE cid=blob.rid),"
     "       NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid)"
     "  FROM event, blob"
     " WHERE event.type='ci' AND blob.rid=event.objid"
   );
+  if( zUser ){
+    zSQL = mprintf("%z AND event.user=%Q", zSQL, zUser);
+  }
+  if( objid ){
+    char *z = db_text(0, "SELECT datetime(event.mtime) FROM event"
+                         " WHERE objid=%d", objid);
+    if( z ){
+      zStart = z;
+    }
+  }
   if( zStart ){
     while( isspace(zStart[0]) ){ zStart++; }
     if( zStart[0] ){
-      zSQL = mprintf("%z AND event.mtime<=julianday(%Q, 'localtime')",
-                      zSQL, zStart);
+      zSQL = mprintf("%z AND event.mtime %s julianday(%Q, 'localtime')",
+                      zSQL, afterFlag ? ">=" : "<=", zStart);
+    }
+  }
+  if( relatedEvents && objid ){
+    db_multi_exec(
+       "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)"
+    );
+    if( afterFlag ){
+      compute_descendents(objid, nEntry);
+    }else{
+      compute_ancestors(objid, nEntry);
     }
+    zSQL = mprintf("%z AND event.objid IN ok", zSQL);
   }
   zSQL = mprintf("%z ORDER BY event.mtime DESC LIMIT %d", zSQL, nEntry);
   db_prepare(&q, zSQL);
   free(zSQL);
   zDate[0] = 0;
   blob_zero(&scriptInit);
-  www_print_timeline(&q, zDate, save_parentage_javascript, &scriptInit);
+  zDate[0] = 0;
+  www_print_timeline(&q, &firstEvent, &lastEvent,
+                     save_parentage_javascript, &scriptInit);
   db_finalize(&q);
   if( zStart==0 ){
     zStart = zDate;
   }
   @ <script>
@@ -350,48 +399,107 @@
 
 
 /*
 ** COMMAND: timeline
 **
-** Usage: %fossil timeline ?DATETIME? ?-n|--count N?
+** Usage: %fossil timeline ?WHEN? ?UUID|DATETIME? ?-n|--count N?
 **
 ** Print a summary of activity going backwards in date and time
 ** specified or from the current date and time if no arguments
-** are given.  Show as many as N (default 20) check-ins.
+** are given.  Show as many as N (default 20) check-ins.  The
+** WHEN argument can be any unique abbreviation of one of these
+** keywords:
+**
+**     before
+**     after
+**     descendents | children
+**     ancestors | parents
 **
-** The date and time should be in the ISO8601 format.  For
-** examples: "2007-08-18 07:21:21".  The time may be omitted.
-** Times are according to the local timezone.
+** The UUID can be any unique prefix of 4 characters or more.
+** The DATETIME should be in the ISO8601 format.  For
+** examples: "2007-08-18 07:21:21".  You can also say "current"
+** for the current version or "now" for the current time.
 */
 void timeline_cmd(void){
   Stmt q;
-  int n;
+  int n, k;
   const char *zCount;
+  char *zOrigin;
   char *zDate;
+  char *zSQL;
+  int objid = 0;
+  Blob uuid;
+  int mode = 1 ;       /* 1: before  2:after  3:children  4:parents */
   db_find_and_open_repository();
   zCount = find_option("n","count",1);
   if( zCount ){
     n = atoi(zCount);
   }else{
     n = 20;
   }
-  if( g.argc!=2 && g.argc!=3 ){
-    usage("YYYY-MM-DDtHH:MM:SS");
+  if( g.argc==4 ){
+    k = strlen(g.argv[2]);
+    if( strncmp(g.argv[2],"before",k)==0 ){
+      mode = 1;
+    }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
+      mode = 2;
+    }else if( strncmp(g.argv[2],"descendents",k)==0 ){
+      mode = 3;
+    }else if( strncmp(g.argv[2],"children",k)==0 ){
+      mode = 3;
+    }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
+      mode = 4;
+    }else if( strncmp(g.argv[2],"parents",k)==0 ){
+      mode = 4;
+    }else{
+      usage("?WHEN? ?UUID|DATETIME?");
+    }
+    zOrigin = g.argv[3];
+  }else if( g.argc==3 ){
+    zOrigin = g.argv[2];
+  }else{
+    zOrigin = "now";
   }
-  if( g.argc==3 ){
-    zDate = g.argv[2];
+  k = strlen(zOrigin);
+  blob_zero(&uuid);
+  blob_append(&uuid, zOrigin, -1);
+  if( strcmp(zOrigin, "now")==0 ){
+    if( mode==3 || mode==4 ){
+      fossil_fatal("cannot compute descendents or ancestors of a date");
+    }
+    zDate = mprintf("(SELECT julianday('now','utc'))");
+  }else if( strncmp(zOrigin, "current", k)==0 ){
+    objid = db_lget_int("checkout",0);
+    zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
+  }else if( name_to_uuid(&uuid, 0)==0 ){
+    objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
+    zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
   }else{
-    zDate = "now";
+    if( mode==3 || mode==4 ){
+      fossil_fatal("cannot compute descendents or ancestors of a date");
+    }
+    zDate = mprintf("(SELECT julianday(%Q, 'utc'))", zOrigin);
   }
-  db_prepare(&q,
+  zSQL = mprintf(
     "SELECT blob.rid, uuid, datetime(event.mtime,'localtime'),"
     "       comment || ' (by ' || user || ')',"
     "       (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim),"
     "       (SELECT count(*) FROM plink WHERE cid=blob.rid)"
     "  FROM event, blob"
     " WHERE event.type='ci' AND blob.rid=event.objid"
-    "   AND event.mtime<=(SELECT julianday(%Q,'utc'))"
-    " ORDER BY event.mtime DESC", zDate
+    "   AND event.mtime %s %s",
+    (mode==1 || mode==4) ? "<=" : ">=", zDate
   );
+  if( mode==3 || mode==4 ){
+    db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
+    if( mode==3 ){
+      compute_descendents(objid, n);
+    }else{
+      compute_ancestors(objid, n);
+    }
+    zSQL = mprintf("%z AND blob.rid IN ok", zSQL);
+  }
+  zSQL = mprintf("%z ORDER BY event.mtime DESC", zSQL);
+  db_prepare(&q, zSQL);
   print_timeline(&q, n);
   db_finalize(&q);
 }

Modified src/wiki.c from [daf8014fa8] to [804763a66e].

@@ -25,20 +25,161 @@
 */
 #include <assert.h>
 #include "config.h"
 #include "wiki.h"
 
+
+/*
+** Create a fake replicate of the "vfile" table as a TEMP table
+** using the manifest identified by manid.
+*/
+static void create_fake_vfile(int manid){
+  static const char zVfileDef[] =
+    @ CREATE TEMP TABLE vfile(
+    @   id INTEGER PRIMARY KEY,     -- ID of the checked out file
+    @   vid INTEGER REFERENCES blob, -- The version this file is part of.
+    @   chnged INT DEFAULT 0,       -- 0:unchnged 1:edited 2:m-chng 3:m-add
+    @   deleted BOOLEAN DEFAULT 0,  -- True if deleted
+    @   rid INTEGER,                -- Originally from this repository record
+    @   mrid INTEGER,               -- Based on this record due to a merge
+    @   pathname TEXT,              -- Full pathname
+    @   UNIQUE(pathname,vid)
+    @ );
+    ;
+  db_multi_exec(zVfileDef);
+  load_vfile_from_rid(manid);
+}
+
+/*
+** Locate the wiki page with the name zPageName and render it.
+*/
+static void locate_and_render_wikipage(const char *zPageName){
+  Stmt q;
+  int id = 0;
+  int rid = 0;
+  int chnged = 0;
+  char *zPathname = 0;
+  db_prepare(&q,
+     "SELECT id, rid, chnged, pathname FROM vfile"
+     " WHERE (pathname='%q.wiki' OR pathname LIKE '%%/%q.wiki')"
+     "   AND NOT deleted", zPageName, zPageName
+  );
+  if( db_step(&q)==SQLITE_ROW ){
+    id = db_column_int(&q, 0);
+    rid = db_column_int(&q, 1);
+    chnged = db_column_int(&q, 2);
+    if( chnged || rid==0 ){
+      zPathname = db_column_malloc(&q, 3);
+    }
+  }
+  db_finalize(&q);
+  if( id ){
+    Blob page, src;
+    char *zTitle = "wiki";
+    char *z;
+    blob_zero(&src);
+    if( zPathname ){
+      zPathname = mprintf("%s/%z", g.zLocalRoot, zPathname);
+      blob_read_from_file(&src, zPathname);
+      free(zPathname);
+    }else{
+      content_get(rid, &src);
+    }
+
+    /* The wiki page content is now in src.  Check to see if
+    ** there is a <readonly/> or <appendonly/> element at the
+    ** beginning of the content.
+    */
+    z = blob_str(&src);
+    while( isspace(*z) ) z++;
+    if( strncmp(z, "<readonly/>", 11)==0 ){
+      z += 11;
+    }else if( strncmp(z, "<appendonly/>", 13)==0 ){
+      z += 13;
+    }
+
+    /* Check for <title>...</title> markup and remove it if present. */
+    while( isspace(*z) ) z++;
+    if( strncmp(z, "<title>", 7)==0 ){
+      int i;
+      for(i=7; z[i] && z[i]!='<'; i++){}
+      if( z[i]=='<' && strncmp(&z[i], "</title>", 8)==0 ){
+        zTitle = htmlize(&z[7], i-7);
+        z = &z[i+8];
+      }
+    }
+
+    /* Render the page */
+    style_header(zTitle);
+    blob_init(&page, z, -1);
+    wiki_convert(&page, cgi_output_blob(), WIKI_HTML);
+    blob_reset(&src);
+  }else{
+    style_header("Unknown Wiki Page");
+    @ The wiki page "%h(zPageName)" does not exist.
+  }
+  style_footer();
+}
+
 /*
 ** WEBPAGE: wiki
+** URL: /wiki/PAGENAME
 **
-** Render the wiki page that is named after the /wiki/ part of
-** the url.
+** If the local database is available (which only happens if run
+** as "server" instead of "cgi" or "http") then the file is taken
+** from the local checkout.  If there is no local checkout, then
+** the content is taken from the "head" baseline.
 */
 void wiki_page(void){
-  style_header("Wiki");
-  @ extra=%h(g.zExtra)
-  style_footer();
+  login_check_credentials();
+  if( !g.okRdWiki ){ login_needed(); return; }
+  if( !g.localOpen ){
+    int headid = db_int(0,
+       "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1"
+    );
+    create_fake_vfile(headid);
+  }
+  locate_and_render_wikipage(g.zExtra);
+}
+
+/*
+** The g.zExtra value is of the form UUID/otherstuff.
+** Extract the UUID and convert it to a record id.  Leave
+** g.zExtra holding just otherstuff.  If UUID does not exist
+** or is malformed, return 0 and leave g.zExtra unchanged.
+*/
+int extract_uuid_from_url(void){
+  int i, rid;
+  Blob uuid;
+  for(i=0; g.zExtra[i] && g.zExtra[i]!='/'; i++){}
+  blob_zero(&uuid);
+  blob_append(&uuid, g.zExtra, i);
+  rid = name_to_uuid(&uuid, 0);
+  blob_reset(&uuid);
+  if( rid ){
+    while( g.zExtra[i]=='/' ){ i++; }
+    g.zExtra = &g.zExtra[i];
+  }
+  return rid;
+}
+
+/*
+** WEBPAGE: bwiki
+** URL: /bwiki/UUID/PAGENAME
+**
+** UUID specifies a baseline.  Render the wiki page PAGENAME as
+** it appears in that baseline.
+*/
+void bwiki_page(void){
+  int headid;
+  login_check_credentials();
+  if( !g.okRdWiki || !g.okHistory ){ login_needed(); return; }
+  headid = extract_uuid_from_url();
+  if( headid ){
+    create_fake_vfile(headid);
+  }
+  locate_and_render_wikipage(g.zExtra);
 }
 
 /*
 ** WEBPAGE: ambiguous
 **

Modified src/wikiformat.c from [8a54463d32] to [a4e0918f23].

@@ -319,10 +319,11 @@
   if( z[n]!='>' && !isspace(z[n]) ) return 0;
   while( z[n] && (z[n]!='>' || inparen) ){
     if( z[n]=='"' ){
       inparen = !inparen;
     }
+    n++;
   }
   if( z[n]!='>' ) return 0;
   return n+1;
 }
 
@@ -712,14 +713,14 @@
   /* TBD */
 }
 
 /*
 ** Resolve a hyperlink.  The argument is the content of the [...]
-** in the wiki.  Append the URL to the given blob.
+** in the wiki.  Append the URL to the output of the Renderer.
 */
-static void resolveHyperlink(const char *zTarget, Blob *pOut){
-  blob_appendf(pOut, "http://www.fossil-scm.org/test-%T", zTarget);
+static void resolveHyperlink(const char *zTarget, Renderer *p){
+  blob_appendf(p->pOut, "http://www.fossil-scm.org/test-%T", zTarget);
 }
 
 /*
 ** Check to see if the given parsed markup is the correct
 ** </verbatim> tag.
@@ -804,11 +805,11 @@
           zDisplay = zTarget;
         }else{
           while( isspace(*zDisplay) ) zDisplay++;
         }
         blob_append(p->pOut, "<a href=\"", -1);
-        resolveHyperlink(zTarget, p->pOut);
+        resolveHyperlink(zTarget, p);
         blob_append(p->pOut, "\">", -1);
         savedState = p->state;
         p->state &= ~ALLOW_WIKI;
         p->state |= FONT_MARKUP_ONLY;
         wiki_render(p, zDisplay);

Modified src/xfer.c from [f732b233d1] to [00b48b7513].

@@ -234,105 +234,11 @@
   remote_has(rid);
   blob_reset(&uuid);
 }
 
 /*
-** Send the file identified by mid and pUuid.  If that file happens
-** to be a manifest, then also send all of the associated content
-** files for that manifest.  If the file is not a manifest, then this
-** routine is the equivalent of send_file().
-*/
-static void send_manifest(Xfer *pXfer, int mid, Blob *pUuid, int srcId){
-  Stmt q2;
-  send_file(pXfer, mid, pUuid, srcId);
-  db_prepare(&q2,
-     "SELECT pid, uuid, fid FROM mlink, blob"
-     " WHERE rid=fid AND mid=%d",
-     mid
-  );
-  while( db_step(&q2)==SQLITE_ROW ){
-    int pid, fid;
-    Blob uuid;
-    pid = db_column_int(&q2, 0);
-    db_ephemeral_blob(&q2, 1, &uuid);
-    fid = db_column_int(&q2, 2);
-    send_file(pXfer, fid, &uuid, pid);
-  }
-  db_finalize(&q2);
-}
-
-/*
-** This routine runs when either client or server is notified that
-** the other side thinks rid is a leaf manifest.  If we hold
-** children of rid, then send them over to the other side.
-*/
-static void leaf_response(Xfer *pXfer, int rid){
-  Stmt q1;
-  db_prepare(&q1,
-      "SELECT cid, uuid FROM plink, blob"
-      " WHERE blob.rid=plink.cid"
-      "   AND plink.pid=%d",
-      rid
-  );
-  while( db_step(&q1)==SQLITE_ROW ){
-    Blob uuid;
-    int cid;
-
-    cid = db_column_int(&q1, 0);
-    db_ephemeral_blob(&q1, 1, &uuid);
-    send_manifest(pXfer, cid, &uuid, rid);
-    if( blob_size(pXfer->pOut)<pXfer->mxSend ){
-      leaf_response(pXfer, cid);
-    }
-  }
-}
-
-/*
-** Sent a leaf message for every leaf.
-*/
-static void send_leaves(Xfer *pXfer){
-  Stmt q;
-  db_prepare(&q,
-    "SELECT uuid FROM blob WHERE rid IN"
-    "  (SELECT cid FROM plink EXCEPT SELECT pid FROM plink)"
-  );
-  while( db_step(&q)==SQLITE_ROW ){
-    const char *zUuid = db_column_text(&q, 0);
-    blob_appendf(pXfer->pOut, "leaf %s\n", zUuid);
-  }
-  db_finalize(&q);
-}
-
-/*
-** Sent leaf content for every leaf that is not found in the
-** onremote table.  This is intended to send leaf content for
-** every leaf that is unknown on the remote end.
-**
-** In addition, we might send "igot" messages for a few generations of
-** parents of the unknown leaves.  This will speed the transmission
-** of new branches.
-*/
-static void send_unknown_leaf_content(Xfer *pXfer){
-  Stmt q1;
-  db_prepare(&q1,
-    "SELECT rid, uuid FROM blob WHERE rid IN"
-    "  (SELECT cid FROM plink EXCEPT SELECT pid FROM plink)"
-    "  AND NOT EXISTS(SELECT 1 FROM onremote WHERE rid=blob.rid)"
-  );
-  while( db_step(&q1)==SQLITE_ROW ){
-    Blob uuid;
-    int cid;
-
-    cid = db_column_int(&q1, 0);
-    db_ephemeral_blob(&q1, 1, &uuid);
-    send_manifest(pXfer, cid, &uuid, 0);
-  }
-  db_finalize(&q1);
-}
-
-/*
-** Sen a gimme message for every phantom.
+** Send a gimme message for every phantom.
 */
 static void request_phantoms(Xfer *pXfer){
   Stmt q;
   db_prepare(&q, "SELECT uuid FROM phantom JOIN blob USING(rid)");
   while( db_step(&q)==SQLITE_ROW ){
@@ -396,10 +302,77 @@
     }
   }
   db_reset(&q);
 }
 
+/*
+** Send the content of all files in the unsent table.
+**
+** This is really just an optimization.  If you clear the
+** unsent table, all the right files will still get transferred.
+** It just might require an extra round trip or two.
+*/
+static void send_unsent(Xfer *pXfer){
+  Stmt q;
+  db_prepare(&q, "SELECT rid FROM unsent");
+  while( db_step(&q)==SQLITE_ROW ){
+    int rid = db_column_int(&q, 0);
+    send_file(pXfer, rid, 0, 0);
+  }
+  db_finalize(&q);
+  db_multi_exec("DELETE FROM unsent");
+}
+
+/*
+** Check to see if the number of unclustered entries is greater than
+** 100 and if it is, form a new cluster.  Unclustered phantoms do not
+** count toward the 100 total.  And phantoms are never added to a new
+** cluster.
+*/
+static void create_cluster(void){
+  Blob cluster, cksum;
+  Stmt q;
+  int nUncl;
+  nUncl = db_int(0, "SELECT count(*) FROM unclustered"
+                    " WHERE NOT EXISTS(SELECT 1 FROM phantom"
+                                      " WHERE rid=unclustered.rid)");
+  if( nUncl<100 ){
+    return;
+  }
+  blob_zero(&cluster);
+  db_prepare(&q, "SELECT uuid FROM unclustered, blob"
+                 " WHERE NOT EXISTS(SELECT 1 FROM phantom"
+                 "                   WHERE rid!=unclustered.rid)"
+                 "   AND unclustered.rid=blob.rid"
+                 " ORDER BY 1");
+  while( db_step(&q)==SQLITE_ROW ){
+    blob_appendf(&cluster, "M %s\n", db_column_text(&q, 0));
+  }
+  db_finalize(&q);
+  md5sum_blob(&cluster, &cksum);
+  blob_appendf(&cluster, "Z %b\n", &cksum);
+  blob_reset(&cksum);
+  db_multi_exec("DELETE FROM unclustered");
+  content_put(&cluster, 0, 0);
+  blob_reset(&cluster);
+}
+
+/*
+** Send an igot message for every entry in unclustered table.
+** Return the number of messages sent.
+*/
+static int send_unclustered(Xfer *pXfer){
+  Stmt q;
+  int cnt = 0;
+  db_prepare(&q, "SELECT uuid FROM unclustered JOIN blob USING(rid)");
+  while( db_step(&q)==SQLITE_ROW ){
+    blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0));
+    cnt++;
+  }
+  db_finalize(&q);
+  return cnt;
+}
 
 /*
 ** If this variable is set, disable login checks.  Used for debugging
 ** only.
 */
@@ -454,22 +427,20 @@
       }
     }else
 
     /*   gimme UUID
     **
-    ** Client is requesting a file.  If the file is a manifest,
-    ** the server can assume that the client also needs all content
-    ** files associated with that manifest.
+    ** Client is requesting a file.  Send it.
     */
     if( blob_eq(&xfer.aToken[0], "gimme")
      && xfer.nToken==2
      && blob_is_uuid(&xfer.aToken[1])
     ){
       if( isPull ){
         int rid = rid_from_uuid(&xfer.aToken[1], 0);
         if( rid ){
-          send_manifest(&xfer, rid, &xfer.aToken[1], 0);
+          send_file(&xfer, rid, &xfer.aToken[1], 0);
         }
       }
     }else
 
     /*   igot UUID
@@ -483,32 +454,10 @@
       if( isPush ){
         rid_from_uuid(&xfer.aToken[1], 1);
       }
     }else
 
-
-    /*   leaf UUID
-    **
-    ** Client announces that it has a particular manifest.  If
-    ** the server has children of this leaf, then send those
-    ** children back to the client.  If the server lacks this
-    ** leaf, request it.
-    */
-    if( xfer.nToken==2
-     && blob_eq(&xfer.aToken[0], "leaf")
-     && blob_is_uuid(&xfer.aToken[1])
-    ){
-      int rid = rid_from_uuid(&xfer.aToken[1], 0);
-      if( rid ){
-        remote_has(rid);
-        if( isPull ){
-          leaf_response(&xfer, rid);
-        }
-      }else if( isPush ){
-        content_put(0, blob_str(&xfer.aToken[1]), 0);
-      }
-    }else
 
     /*    pull  SERVERCODE  PROJECTCODE
     **    push  SERVERCODE  PROJECTCODE
     **
     ** The client wants either send or receive.  The server should
@@ -557,38 +506,28 @@
           cgi_reset_content();
           @ error not\sauthorized\sto\swrite
           nErr++;
           break;
         }
-        send_leaves(&xfer);
         isPush = 1;
       }
     }else
 
     /*    clone
     **
     ** The client knows nothing.  Tell all.
     */
     if( blob_eq(&xfer.aToken[0], "clone") ){
-      int rootid;
       login_check_credentials();
       if( !g.okClone ){
         cgi_reset_content();
         @ error not\sauthorized\sto\sclone
         nErr++;
         break;
       }
       isPull = 1;
       @ push %s(db_get("server-code", "x")) %s(db_get("project-code", "x"))
-      rootid = db_int(0,
-          "SELECT pid FROM plink AS a"
-          " WHERE NOT EXISTS(SELECT 1 FROM plink WHERE cid=a.pid)"
-      );
-      if( rootid ){
-        send_file(&xfer, rootid, 0, -1);
-        leaf_response(&xfer, rootid);
-      }
     }else
 
     /*    login  USER  NONCE  SIGNATURE
     **
     ** Check for a valid login.  This has to happen before anything else.
@@ -602,10 +541,31 @@
       }else{
         check_login(&xfer.aToken[1], &xfer.aToken[2], &xfer.aToken[3]);
       }
     }else
 
+    /*    cookie TEXT
+    **
+    ** A cookie contains a arbitrary-length argument that is server-defined.
+    ** The argument must be encoded so as not to contain any whitespace.
+    ** The server can optionally send a cookie to the client.  The client
+    ** might then return the same cookie back to the server on its next
+    ** communication.  The cookie might record information that helps
+    ** the server optimize a push or pull.
+    **
+    ** The client is not required to return a cookie.  So the server
+    ** must not depend on the cookie.  The cookie should be an optimization
+    ** only.  The client might also send a cookie that came from a different
+    ** server.  So the server must be prepared to distinguish its own cookie
+    ** from cookies originating from other servers.  The client might send
+    ** back several different cookies to the server.  The server should be
+    ** prepared to sift through the cookies and pick the one that it wants.
+    */
+    if( blob_eq(&xfer.aToken[0], "cookie") && xfer.nToken==2 ){
+      /* Process the cookie */
+    }else
+
     /* Unknown message
     */
     {
       cgi_reset_content();
       @ error bad\scommand:\s%F(blob_str(&xfer.line))
@@ -614,11 +574,12 @@
   }
   if( isPush ){
     request_phantoms(&xfer);
   }
   if( isPull ){
-    send_unknown_leaf_content(&xfer);
+    create_cluster();
+    send_unclustered(&xfer);
   }
   db_end_transaction(0);
 }
 
 /*
@@ -668,10 +629,11 @@
   const char *zSCode = db_get("server-code", "x");
   const char *zPCode = db_get("project-code", 0);
   int nMsg = 0;          /* Number of messages sent or received */
   int nCycle = 0;        /* Number of round trips to the server */
   int nFileSend = 0;
+  const char *zCookie;   /* Server cookie */
   Blob send;        /* Text we are sending to the server */
   Blob recv;        /* Reply we got back from the server */
   Xfer xfer;        /* Transfer data */
 
   memset(&xfer, 0, sizeof(xfer));
@@ -711,16 +673,27 @@
 
 
   while( go ){
     int newPhantom = 0;
 
+    /* Send make the most recently received cookie.  Let the server
+    ** figure out if this is a cookie that it cares about.
+    */
+    zCookie = db_get("cookie", 0);
+    if( zCookie ){
+      blob_appendf(&send, "cookie %s\n", zCookie);
+    }
+
     /* Generate gimme messages for phantoms and leaf messages
     ** for all leaves.
     */
     if( pullFlag ){
       request_phantoms(&xfer);
-      send_leaves(&xfer);
+    }
+    if( pushFlag ){
+      send_unsent(&xfer);
+      nMsg += send_unclustered(&xfer);
     }
 
     /* Exchange messages with the server */
     nFileSend = xfer.nFileSent + xfer.nDeltaSent;
     printf("Send:      %10d bytes, %3d messages, %3d files (%d+%d)\n",
@@ -742,11 +715,10 @@
     }
     if( pushFlag ){
       blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
       nMsg++;
     }
-
 
     /* Process the reply that came back from the server */
     while( blob_line(&recv, &xfer.line) ){
       if( blob_buffer(&xfer.line)[0]=='#' ){
         continue;
@@ -773,11 +745,11 @@
        && blob_is_uuid(&xfer.aToken[1])
       ){
         nMsg++;
         if( pushFlag ){
           int rid = rid_from_uuid(&xfer.aToken[1], 0);
-          send_manifest(&xfer, rid, &xfer.aToken[1], 0);
+          send_file(&xfer, rid, &xfer.aToken[1], 0);
         }
       }else
 
       /*   igot UUID
       **
@@ -805,34 +777,10 @@
         }
         remote_has(rid);
       }else
 
 
-      /*   leaf UUID
-      **
-      ** Server announces that it has a particular manifest.  Send
-      ** any children of this leaf that we have if we are pushing.
-      ** Make the leaf a phantom if we are pulling.  Remember that the
-      ** remote end has the specified UUID.
-      */
-      if( xfer.nToken==2
-       && blob_eq(&xfer.aToken[0], "leaf")
-       && blob_is_uuid(&xfer.aToken[1])
-      ){
-        int rid = rid_from_uuid(&xfer.aToken[1], 0);
-        nMsg++;
-        if( pushFlag && rid ){
-          leaf_response(&xfer, rid);
-        }
-        if( pullFlag && rid==0 ){
-          rid = content_put(0, blob_str(&xfer.aToken[1]), 0);
-          newPhantom = 1;
-        }
-        remote_has(rid);
-      }else
-
-
       /*   push  SERVERCODE  PRODUCTCODE
       **
       ** Should only happen in response to a clone.  This message tells
       ** the client what product to use for the new database.
       */
@@ -852,10 +800,23 @@
         }
         cloneFlag = 0;
         pullFlag = 1;
         blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
         nMsg++;
+      }else
+
+      /*    cookie TEXT
+      **
+      ** The server might include a cookie in its reply.  The client
+      ** should remember this cookie and send it back to the server
+      ** in its next query.
+      **
+      ** Each cookie received overwrites the prior cookie from the
+      ** same server.
+      */
+      if( blob_eq(&xfer.aToken[0], "cookie") && xfer.nToken==2 ){
+        db_set("cookie", blob_str(&xfer.aToken[1]));
       }else
 
       /*   error MESSAGE
       **
       ** Report an error
@@ -881,27 +842,25 @@
             blob_size(&recv), nMsg,
             xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile,
             xfer.nFileRcvd, xfer.nDeltaRcvd, xfer.nDanglingFile);
 
     blob_reset(&recv);
+    nCycle++;
+    go = 0;
+
+    /* If we received one or more files on the previous exchange but
+    ** there are still phantoms, then go another round.
+    */
+    if( (xfer.nFileRcvd+xfer.nDeltaRcvd+xfer.nDanglingFile>0 || newPhantom)
+         && db_exists("SELECT 1 FROM phantom")
+    ){
+      go = 1;
+    }
     nMsg = 0;
     xfer.nFileRcvd = 0;
     xfer.nDeltaRcvd = 0;
     xfer.nDanglingFile = 0;
-    nCycle++;
-    go = 0;
-
-    /* If we have received one or more files on this cycle or if
-    ** we have received information that has caused us to create
-    ** new phantoms and we have one or more phantoms, then go for
-    ** another round
-    */
-    if( (xfer.nFileRcvd+xfer.nDeltaRcvd+xfer.nDanglingFile>0 || newPhantom)
-     && db_exists("SELECT 1 FROM phantom")
-    ){
-      go = 1;
-    }
 
     /* If we have one or more files queued to send, then go
     ** another round
     */
     if( xfer.nFileSent+xfer.nDeltaSent>0 ){

Deleted test/basic1.test version [d90e14fae8]

Added wiki_and_ticket_ideas.txt version [210e4ddb28]

@@ -1,1 +1,190 @@
+Thoughts On How To Implement Wiki And Tickets In Fossil
+
+The crux of the problem of wiki and tickets is not how
+to render the information.  There are countless other
+wiki and ticket systems that have explored this territory.
+We have a lot of experience rendering wiki and writing
+ticketing systems and we know how that part works.  The
+hard part about doing wiki and tickets in Fossil is
+figuring how how to synchronize the wiki and tickets
+across different repositories.
+
+There are a number of approaches:
+
+(1) Don't synchronize.  Write a traditional wiki and ticket
+    system that lives on a single repository.  Fossil will
+    sync the source tree from one repository to another but
+    the wiki and tickets live in separate tables of the
+    database stay on a single repository.
+
+(2) Make each wiki pages and each ticket a file in the source
+    tree.  Each change to a wiki page or ticket creates a new
+    baseline.  Actually, wiki and ticket changes could cluster
+    so that each new baseline contained multiple wiki and
+    ticket changes, but any isolated wiki or ticket change
+    still requires a new baseline.
+
+(3) Store each wiki page and ticket as a separate branch of
+    the source tree that forks at the very root of the tree.
+    Every change to a wiki page or ticket still requires a
+    new baseline, but the baseline consists of single file
+    change and is thus quite compact and easy to manage.
+
+(4) Other synchronization methods.  We could treat the wiki
+    and/or tickets as a completely separate system with its
+    on synchronization protocol that just happens to live in
+    the same executable and use the same database as the
+    source tree sync mechanism.
+
+(5) Hybrid approaches.  One can combine any of the previous
+    four approaches to wiki and ticket synchronization to
+    generate a hybrid.
+
+The advantage of (1) is that it is simple and direct and
+easy to implement.  We already know how to do wiki and tickets
+on a single server with a database.  CVSTrac is a good example
+of these and there are countless other excellent examples.
+Method (1) also keeps the wiki and tickets distinct from the
+source files.  The problem with (1) is that you cannot take
+the wiki or tickets with your for disconnected operation.
+Well, maybe you could pull down a complete copy of the wiki
+and ticket tables to carry with you on the airplane, but even
+then you would not be able to make changes and then later
+synchronize those changes with the main repository.
+
+Method (2) makes each wiki page and each ticket a separate
+file in the source tree.  This means that the existing versioning
+and synchronization logic is unchanged.  And the repository
+file format is simple and easy to describe.  (The simplicity
+of the file format is an important feature for my intended
+use of Fossil.  The ability to reconstruct a baseline from
+raw artifacts with no special software is an important though
+not well described feature of Fossil.)  Having wiki and tickets
+readily at hand also gives the interesting possibility of editing
+tickets and especially wiki using your favorite text editor,
+rather than having to use an often clunky web interface.
+The web interface is still provided, of course, but if the
+wiki source text is there in a file in front of you, how much
+easier it would be to edit it using emacs or vi.
+
+Among the disadvantages of (2) is that it greatly increases
+the number of files in the source tree because of the added
+wiki and tickets.  The SQLite project, for example, currently
+has about 560 files in the tree.  But there are around 2600
+tickets and 120 wiki pages.  If we remove tickets that are
+closed we can get down to around 800 tickets.  And if I were
+more aggressive about closing tickets, that number might be
+lower.  But there are still more tickets than there are source
+files.  The number of wiki pages is not that great, but on
+the other hand the SQLite wiki is not active like the Tcl/Tk
+wiki.
+
+Another disadvantage of (2) is that you cannot add a ticket
+or fix a ticket on a baseline after the baseline is created.
+To add or fix a ticket, you have to create a new baseline.
+That means that if a bug is discovered in a baseline after its
+release, you cannot add the ticket to the baseline in which
+the bug was found; you have to put the ticket in a follow-on
+baseline.  This seems weird.  Perhaps some additional processing
+inside of fossil can identify when tickets are added to subsequent
+baselines and tag prior baselines accordingly.  On the other hand,
+because tickets are part of the baseline, tickets fixed in one
+branch remain open in parallel branches until fixed separately
+there, as they should be.
+
+Any interesting question with method (2) is what baseline to
+use for displaying wiki and tickets on the web interface.
+Clearly the display should use a leaf baseline.  But the
+project might have several peer branches each with their
+own leaves.  Which leaf should be used to display the wiki
+and tickets?  Is there an interface that allows the user to
+browse through wiki and tickets from prior baselines?
+
+The third method solves the many-files problem of method (2).
+In (3), each wiki page and ever ticket becomes a separate
+branch of the baseline change hierarchy.  So the number of
+files in the source tree remains small.  The problem here is
+the number of branches in the baseline hierarchy explodes.
+The amount of network traffic used by the synchronization
+protocol (and to some degree the amount of CPU time) is
+proportional to the number of leaves in the baseline hierarchy.
+If every wiki page and every ticket is in its own tree with
+at least one leaf, then suddenly the project goes from have
+a 6 or 12 leaves to having thousands.  The synchronization
+protocol would have to be enhanced to deal with this.  I have
+outlined ways of doing this, but they involve more complex
+file format and more complicated wire protocols.  My assessment
+is that this approach is not consistent with simplicity.
+
+In the list above, I mention methods (4) and (5) mostly as a
+way of showing that the list of (1) through (3) does not intend
+to be exhaustive.  One can certainly devise variations on
+methods (1) through (3) to accomplish the same thing.  And there
+might be other techniques that I have not thought of yet.
+
+I have been vacillating between methods (1), (2), and (3) for
+months.  As of this writing, I am leaning toward (2) with
+careful attention to the ticket interpreter within Fossil so
+that when a ticket in a later baseline is written against an
+earlier baseline, a link is established in the database so that
+the later ticket is displayed with the earlier baseline.  (The
+details are still sketchy.)  Scaling is still an issue.  But
+for the kinds of projects that Fossil is intended, I do not
+expect the number of wiki pages or tickets to become excessive.
+Fossil is not intended to be a replacement for the tcler's wiki
+or for wikipedia.  Fossil is designed to be a convenient and
+self-contained CM system for an SQLite-sized project.  Just
+as SQLite is not intended to replace Oracle, so Fossil is not
+intended to replace the server farm at a Web 2.0 startup.
+
+------------- 2007-08-02 ---------------
+
+Wiki and tickets need not be handled in the same way.  Method
+(1) is disadvantageous to tickets since we what to be able to
+carry tickets with us, and modify them, while working offline.
+But the need to modify wiki offline is not nearly as acute.
+Hence consideration should be given to implementations that
+use different methods for handling tickets and wiki.
+
+Another hybrid method worth consideration is to place
+baselines of wiki and/or tickets in the source tree but
+allow overlays or deltas to be entered on a per-server
+basis.  The overlays or deltas are not synchronized between
+servers.  But one can take a "snapshot" of the overlays/deltas
+to create a new source tree baseline which could then be
+synchronized and used and/or modified offline.  Let us call
+refer to this new methods as (6).  Here are the details:
+
+  *  Tickets or wiki or both are stored as part of the tree
+     as described in method (2).
+
+  *  Web-based changes to wiki or tickets are not written back
+     into the tree but are instead stored locally in a cache
+     of exceptions or overlays.
+
+  *  When the web interface goes to look for a ticket or a
+     wiki it consults its local cache first and then if not
+     found there, a designated baseline.
+
+  *  The cache of changes is not synchronized by the push,
+     pull, or sync commands.  It is local to the repository
+     on which it is entered.
+
+  *  A button on the web interface (invoked by users with
+     appropriate privileges) takes all locally cached changes
+     and adds them to the tree in a new baseline.
+
+  *  Locally cached changes are against a specific baseline.
+     That specific baseline is used as backup if a page or
+     ticket request is not found in the local cache.  If the
+     backing baseline is changed, the local cache automatically
+     merges in the differences in wiki or tickets between
+     the old and new baselines.
+
+This approach still leaves the many-files problem.  In SQLite,
+there are about 500 source files and about 3000 different ticket
+and wiki page titles.  But if the wiki isn't that big and if
+tickets are removed from baselines after they have been closed
+for 30 days or longer and if tickets are dealt with aggressively,
+there perhaps the many-files problem won't be such a big deal.
 

Modified www/build.html from [6089f0b563] to [ea6b1e4bf3].

@@ -1,9 +1,11 @@
 <html>
 <title>Building And Installing Fossil</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1>Installing Fossil</h1>
 
 <p>This page describes how to build and install Fossil.  The
 whole process is designed to be very easy.</p>
 

Modified www/concepts.html from [8da6496b93] to [d53cc73d6e].

@@ -1,10 +1,12 @@
 <html>
 <head>
 <title>Fossil Concepts</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1 align="center">
 Fossil Concepts
 </h1>
 
 <h2>1.0 Introduction</h2>

Modified www/delta_encoder_algorithm.html from [75d37d5e32] to [2fdda57151].

@@ -128,10 +128,16 @@
 backward from "slide" in the "target", and the candidate location in
 the "origin". This search is constrained on the side of the "target"
 by the "base" (backward search), and the end of the "target" (forward
 search), and on the side of the "origin" by the beginning and end of
 the "origin", respectively.</p>
+
+<p>There are input files for which the hash chains generated by the
+pre-processing step can become very long, leading to long search times
+and affecting the performance of the delta generator. To limit the
+effect such long chains can have the actual search for candidates is
+bounded, looking at most N candidates. Currently N is set to 250.</p>
 
 <p>From the ranges for all the candidates the best (= largest) common
 range is taken and it is determined how many bytes are needed to
 encode the bytes between the "base" and the end of that range. If the
 range extended back to the "base" then this can be done in a single

Modified www/fileformat.html from [677ac744b2] to [65db56924d].

@@ -1,10 +1,12 @@
 <html>
 <head>
 <title>Fossil File Format</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1 align="center">
 Fossil File Formats
 </h1>
 
 <p>

Modified www/index.html from [976b9491be] to [c49cf389d3].

@@ -81,18 +81,19 @@
 
 <ul>
 <li>The <a href="concepts.html">concepts</b> behind fossil</li>
 <li><a href="build.html">Building And Installing</a></li>
 <li><a href="quickstart.html">Quick Start</a> guide to using fossil
-<li><a href="pop.html">Principals Of Operation</a></li>
+<li><a href="pop.html">Principles Of Operation</a></li>
 <li>The <a href="selfcheck.html">automatic self-check</a> mechanism
 helps insure project integrity.</li>
 <li>The <a href="fileformat.html">file format</a> used by every content
 file stored in the repository.</li>
 <li>The <a href="delta_format.html">format of deltas</a> used to
 efficiently store changes between file revisions.</li>
 <li>The <a href="delta_encoder_algorithm.html">encoder algorithm</a> used to
 efficiently generate deltas.</li>
+<li>The <a href="sync.html">synchronization protocol</a>.
 </ul>
 
 </body>
 </html>

Added www/index.wiki version [314475c431]

@@ -1,1 +1,88 @@
+<title>Fossil SCM Homepage</title>
+
+This is a preliminary homepage for a new software configuration
+management system called "Fossil".
+The system is
+<a href="http://fossil-scm.hwaci.com/fossil/timeline">self-hosting</a> on
+<a href="http://www.hwaci.com/cgi-bin/fossil/timeline">two separate servers</a>.
+You can download the lastest sources
+compile it yourself using the instructions below.
+
+<h2>Design Goals For Fossil:</h1>
+
+<ul>
+<li>Supports disconnected, distributed development (like
+<a href="http://kerneltrap.org/node/4982">git</a>,
+<a href="http://www.venge.net/monotone/">monotone</a>,
+<a href="http://www.selenic.com/mercurial/wiki/index.cgi">mercurial</a>, or
+<a href="http://www.bitkeeper.com/">bitkeeper</a>)
+or client/server operation (like
+<a href="http://www.nongnu.org/cvs/">CVS</a> or
+<a href="http://subversion.tigris.org/">subversion</a>)
+or both at the same time</li>
+<li>Integrated bug tracking and wiki, along the lines of
+<a href="http://www.cvstrac.org/">CVSTrac</a> and
+<a href="http://www.edgewall.com/trac/">Trac</a>.</li>
+<li>Built-in web interface that supports deep archaeological digs through
+historical source code.</li>
+<li>All network communication via
+<a href="http://en.wikipedia.org/wiki/HTTP">HTTP</a>
+(so that everything works from behind restrictive firewalls).</li>
+<li>Everything included in a single self-contained executable -
+    trivial to install</li>
+<li>Server runs as <a href="http://www.w3.org/CGI/">CGI</a>, using
+<a href="http://en.wikipedia.org/wiki/inetd">inetd</a> or
+<a href="http://www.xinetd.org/">xinetd</a> or using its own built-in,
+standalone web server.</li>
+<li>An entire project contained in single disk file (which also
+happens to be an <a href="http://www.sqlite.org/">SQLite</a> database.)</li>
+<li>Trivial to setup and administer</li>
+<li>Files and versions are identified by their
+<a href="http://en.wikipedia.org/wiki/SHA-1">SHA1</a> signature.</a>
+Any unique prefix is sufficient to identify a file
+or version - usually the first 4 or 5 characters suffice.</li>
+<li>The file format is trival and requires nothing more complex
+than a text editor and the "sha1sum" command-line utility to decode.</li>
+<li>Automatic <a href="selfcheck.html">self-check</a>
+on repository changes makes it exceedingly
+unlikely that data will ever be lost because of a software bug.</li>
+</ul>
+
+<h2>Objectives Of Fossil:</h2>
+
+<ul>
+<li>Fossil should be ridiculously easy to
+<a href="build.html">install</a> and
+<a href="quickstart.html">operate</a>.</li>
+<li>With fossil, it should be possible (and
+<a href="quickstart.html#serversetup">easy</a>) to set up a project
+on an inexpensive shared-hosting ISP
+(example: <a href="http://www.he.net/hosting.html">Hurricane Electric</a>)
+that provides nothing more than web space and CGI capability.
+Here is <a href="http://www.hwaci.com/cgi-bin/fossil/timeline">a demo</a>.</li>
+<li>Fossil should provide in-depth historical and status information about the
+project through a web interface</li>
+<li>The integration of <a href="http://wiki.org/wiki.cgi?WhatIsWiki">Wiki</a>
+and the ability to safely support anonymous check-in are features sometimes
+described as
+<a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">Web 2.0</a>.
+Fossil attempts to better capture "collective intelligence" and
+"the wisdom of crowds" by opening up write access to the masses.</li>
+</ul>
+
+<p>Other Links:</p>
 
+<ul>
+<li>The <a href="concepts.html">concepts</b> behind fossil</li>
+<li><a href="build.html">Building And Installing</a></li>
+<li><a href="quickstart.html">Quick Start</a> guide to using fossil
+<li><a href="pop.html">Principals Of Operation</a></li>
+<li>The <a href="selfcheck.html">automatic self-check</a> mechanism
+helps insure project integrity.</li>
+<li>The <a href="fileformat.html">file format</a> used by every content
+file stored in the repository.</li>
+<li>The <a href="delta_format.html">format of deltas</a> used to
+efficiently store changes between file revisions.</li>
+<li>The <a href="delta_encoder_algorithm.html">encoder algorithm</a> used to
+efficiently generate deltas.</li>
+</ul>

Modified www/pop.html from [c4c7a9be7e] to [be259767d3].

@@ -1,10 +1,12 @@
 <html>
 <head>
 <title>Fossil - Principles of Operation</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1>Principles Of Operation</h1>
 
 <p>
 This page attempts to define the foundational principals upon
 which Fossil is built.

Modified www/quickstart.html from [02bea354be] to [427965635d].

@@ -1,8 +1,10 @@
 <html>
 <title>Fossil - Quick Start</title>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1 align="center">Fossil Quick Start</h1>
 
 <p>This is a guide to get you started using fossil quickly
 and painlessly.</p>
 

Modified www/selfcheck.html from [849df9860d] to [48d9461817].

@@ -1,10 +1,12 @@
 <html>
 <head>
 <title>Fossil Repository Integrity Self-Checks</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1 align="center">
 Fossil Repository Integrity Self-Checks
 </h1>
 
 <p>

Added www/sync.html version [748c60be85]

@@ -1,1 +1,465 @@
+<html>
+<head>
+<title>The Fossil Sync Protocol</title>
+</head>
+<body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
+<h1 align="center">The Fossil Sync Protocol</h1>
+
+<p>Fossil supports commands <b>push</b>, <b>pull</b>, and <b>sync</b>
+for transferring information from one repository to another.  The
+command is run on the client repository.  A URL for the server repository
+is specified as part of the command.  This document describes what happens
+behind the scenes in order to synchronize the information on the two
+repositories.</p>
+
+<h2>1.0 Transport</h2>
+
+<p>All communication between client and server is via HTTP requests.
+The server is listening for incoming HTTP requests.  The client
+issues one or more HTTP requests and receives replies for each
+request.</p>
+
+<p>The server might be running as an independent server
+using the <b>server</b> command, or it might be launched from
+inetd or xinetd using the <b>http</b> command.  Or the server might
+be launched from CGI.  The details of how the server is configured
+to "listen" for incoming HTTP requests is immaterial.  The important
+point is that the server is listening for requests and the client
+is the issuer of the requests.</p>
+
+<p>A single push, pull, or sync might involve multiple HTTP requests.
+The client maintains state between all requests.  But on the server
+side, each request is independent.  The server does not preserve
+any information about the client from one request to the next.</p>
+
+<h3>1.1 Server Identification</h3>
+
+<p>The server is identified by a URL argument that accompanies the
+push, pull, or sync command on the client.  (As a convenience to
+users, the URL can be omitted on the client command and the same URL
+from the most recent push, pull, or sync will be reused.  This saves
+typing in the common case where the client does multiple syncs to
+the same server.)</p>
+
+<p>The client modifies the URL by appending the method name "<b>/xfer</b>"
+to the end.  For example, if the URL specified on the client command
+line is</p>
+
+<blockquote>
+http://fossil-scm.hwaci.com/fossil
+</blockquote>
+
+<p>Then the URL that is really used to do the synchronization will
+be:</p>
+
+<blockquote>
+http://fossil-scm.hwaci.com/fossil/xfer
+</blockquote>
+
+<h3>1.2 HTTP Request Format</h3>
+
+<p>The client always sends a POST request to the server.  The
+general format of the POST request is as follows:</p>
+
+<blockquote><pre>
+POST /fossil/xfer HTTP/1.0
+Host: fossil-scm.hwaci.com:80
+Content-Type: application/x-fossil
+Content-Length: 4216
+
+<i>content...</i>
+</pre></blockquote>
+
+<p>In the example above, the pathname given after the POST keyword
+on the first line is a copy of the URL pathname.  The Host: parameter
+is also taken from the URL.  The content type is always either
+"application/x-fossil" or "application/x-fossil-debug".  The "x-fossil"
+content type is the default.  The only difference is that "x-fossil"
+content is compressed using zlib whereas "x-fossil-debug" is sent
+uncompressed.</p>
+
+<p>A typical reply from the server might look something like this:</p>
+
+<blockquote><pre>
+HTTP/1.0 200 OK
+Date: Mon, 10 Sep 2007 12:21:01 GMT
+Connection: close
+Cache-control: private
+Content-Type: application/x-fossil; charset=US-ASCII
+Content-Length: 265
+
+<i>content...</i>
+</pre></blockquote>
+
+<p>The content type of the reply is always the same as the content type
+of the request.</p>
+
+<h2>2.0 Fossil Synchronization Content</h2>
+
+<p>A synchronization request between a client and server consists of
+one or more HTTP requests as described in the previous section.  This
+section details the "x-fossil" content type.</p>
+
+<h3>2.1 Line-oriented Format</h3>
+
+<p>The x-fossil content type consists of zero or more "cards".  Cards
+are separate by the newline character ("\n").  Leading and trailing
+whitespace on a card is ignored.  Blank cards are ignored.</p>
+
+<p>Each card is divided into zero or more space separated tokens.
+The first token on each card is the operator.  Subsequent tokens
+are arguments.  The set of operators understood by servers is slightly
+different from the operators understood by clients, though the two
+are very similar.</p>
+
+<h3>2.2 Login Cards</h3>
+
+<p>Every message from client to server begins with one or more login
+cards.  Each login card has the following format:</p>
+
+<blockquote>
+<b>login</b>  <i>userid  nonce  signature</i>
+</blockquote>
+
+<p>The userid is the name of the user that is requesting service
+from the server.  The nonce is a random one-use hexadecimal number.
+The signature is the SHA1 hash of the users password.</p>
+
+<p>For each login card, the server looks up the user and verifies
+that the nonce has never before been used.  It then checks the
+signature hash to make sure the signature matches.  If everything
+checks out, then the client is granted all privileges of the
+specified user.</p>
+
+<p>Privileges are cumulative.  There can be multiple successful
+login cards.  The session privileges are the bit-wise OR of the
+privileges of each individual login.</p>
+
+<h3>2.3 File Cards</h3>
+
+<p>Repository content records or files are transferred using
+a "file" card.  File cards come in two different formats depending
+on whether the file is sent directly or as a delta from some
+other file.</p>
+
+<blockquote>
+<b>file</b> <i>uuid size</i> <b>\n</b> <i>content</i><br>
+<b>file</b> <i>uuid delta-uuid size</i> <b>\n</b> <i>content</i>
+</blockquote>
+
+<p>File cards are different from all other cards in that they
+followed by in-line "payload" data.  The content of the file
+or the file delta consists of the first <i>size</i> bytes of the
+x-fossil content that immediately follow the newline that
+terminates the file card.  No other cards have this characteristic.
+</p>
+
+<p>The first argument of a file card is the UUID of the file that
+is being transferred.  The UUID is the lower-case hexadecimal
+representation of the SHA1 hash of the entire file content.
+The last argument of the file card is the number of bytes of
+payload that immediately follow the file card.  If the file
+card has only two arguments, that means the payload is the
+complete content of the file.  If the file card has three
+arguments, then the payload is a delta and second argument is
+the UUID of another file that is the source of the delta.</p>
+
+<p>File cards are sent in both directions: client to server and
+server to client.  A delta might be sent before the source of
+the delta, so both client and server should remember deltas
+and be able to apply them when their source arrives.</p>
+
+<h3>2.4 Push and Pull Cards</h3>
+
+<p>Among of the first cards in a client-to-server message are
+the push and pull cards.  The push card tell the server that
+the client is pushing content.  The pull card tell the server
+that the client wants to pull content.  In the event of a sync,
+both cards are sent.  The format is as follows:</p>
+
+<blockquote>
+<b>push</b> <i>servercode projectcode</i><br>
+<b>pull</b> <i>servercode projectcode</i>
+</blockquote>
+
+<p>The <i>servercode</i> argument is the repository ID for the
+client.  The server will only allow the transaction to proceed
+if the servercode is different from its own servercode.  This
+prevents a sync-loop.  The <i>projectcode</i> is the identifier
+of the software project that the client repository contains.
+The projectcode for the client and server must match in order
+for the transaction to proceed.</p>
+
+<p>The server will also send a push card back to the client
+during a clone.  This is how the client determines what project
+code to put in the new repository it is constructing.</p>
+
+<h3>2.5 Clone Cards</h3>
+
+<p>A clone card works like a pull card in that it is sent from
+client to server in order to tell the server that the client
+wants to pull content.  But unlike the pull card, the clone
+card has no arguments.</p>
+
+<blockquote>
+<b>clone</b>
+</blockquote>
+
+<p>In response to a clone message, the server also sends the client
+a push message so that the client can discover the projectcode for
+this project.</p>
+
+<h3>2.6 Igot Cards</h3>
+
+<p>An igot card can be sent from either client to server or from
+server to client in order to indicate that the sender holds a copy
+of a particular file.  The format is:</p>
+
+<blockquote>
+<b>igot</b> <i>uuid</i>
+</blockquote>
+
+<p>The argument of the igot card is the UUID of the file that
+the sender possesses.
+The receiver of an igot card will typically check to see if
+it also holds the same file and if not it will request the file
+using a gimme card in either the reply or in the next message.</p>
+
+<h3>2.7 Gimme Cards</h3>
+
+<p>A gimme card is sent from either client to server or from server
+to client.  The gimme card asks the receiver to send a particular
+file back to the sender.  The format of a gimme card is this:</p>
+
+<blockquote>
+<b>gimme</b> <i>uuid</i>
+</blockquote>
+
+<p>The argument to the gimme card is the UUID of the file that
+the sender wants.  The receiver will typically respond to a
+gimme card by sending a file card in its reply or in the next
+message.</p>
+
+<h3>2.8 Cookie Cards</h3>
+
+<p>A cookie card can be used by a server to record a small amount
+of state information on a client.  The server sends a cookie to the
+client.  The client sends the same cookie back to the server on
+its next request.  The cookie card has a single argument which
+is its payload.</p>
+
+<blockquote>
+<b>cookie</b> <i>payload</i>
+</blockquote>
+
+<p>The client is not required to return the cookie to the server on
+its next request.  Or the client might send a cookie from a different
+server on the next request.  So the server must not depend on the
+cookie and the server must structure the cookie payload in such
+a way that it can tell if the cookie it sees is its own cookie or
+a cookie from another server.  (Typically the server will embed
+its servercode as part of the cookie.)</p>
+
+<h3>2.9 Error Cards</h3>
+
+<p>If the server discovers anything wrong with a request, it generates
+an error card in its reply.  When the client sees the error card,
+it displays an error message to the user and aborts the sync
+operation.  An error card looks like this:</p>
+
+<blockquote>
+<b>error</b> <i>error-message</i>
+</blockquote>
+
+<p>The error message is English text that is encoded in order to
+be a single token.
+A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73).  A
+newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E).  A backslash
+(ASCII 0x5C) is represented as two backslashes "\\".  Apart from
+space and newline, no other whitespace characters nor any
+unprintable characters are allowed in
+the error message.</p>
+
+<h3>2.10 Unknown Cards</h3>
+
+<p>If either the client or the server sees a card that is not
+described above, then it generates an error and aborts.</p>
+
+<h2>3.0 Phantoms And Clusters</h2>
+
+<p>When a repository knows that a file exists and knows the UUID of
+that file, but it does not know the file content, then it stores that
+file as a "phantom".  A repository will typically create a phantom when
+it receives an igot card for a file that it does not hold or when it
+receives a file card that references a delta source that it does not
+hold.  When a server is generating its reply or when a client is
+generating a new request, it will usually send gimme cards for every
+phantom that it holds.</p>
+
+<p>A cluster is a special file that tells of the existence of other
+files.  Any file in the repository that follows the syntactic rules
+of a cluster is considered a cluster.</p>
+
+<p>A cluster is a line oriented file.  Each line of a cluster
+is a card.  The cards are separated by the newline ("\n") character.
+Each card consists of a single character card type, a space, and a
+single argument.  No extra whitespace and no trailing or leading
+whitespace is allowed.  All cards in the cluster must occur in
+strict lexicographical order.</p>
+
+<p>A cluster consists of one or more "M" cards followed by a single
+"Z" card.  Each M card holds an argument which is a UUID for a file
+in the repository.  The Z card has a single argument which is the
+lower-case hexadecimal representation of the MD5 checksum of all
+preceding M cards up to and included the newline character that
+occurred just before the Z that starts the Z card.</p>
+
+<p>Any file that does not match the specifications of a cluster
+exactly is not a cluster.  There must be no extra whitespace in
+the file.  There must be one or more M cards.  There must be a
+single Z card with a correct MD5 checksum.  And all cards must
+be in strict lexicographical order.</p>
+
+<h3>3.1 The Unclustered Table</h3>
+
+<p>Every repository maintains a table named "<b>unclustered</b>"
+which records the identity of every file and phantom it holds that is not
+mentioned in a cluster.  The entries in the unclustered table can
+be thought of as leaves on a tree of files.  Some of the unclustered
+files will be clusters.  Those clusters may contain other clusters,
+which might contain still more clusters, and so forth.  Beginning
+with the files in the unclustered table, one can follow the chain
+of clusters to find every file in the repository.</p>
+
+<h2>4.0 Synchronization Strategies</h2>
+
+<h3>4.1 Pull</h3>
+
+<p>A typical pull operation proceeds as shown below.  Details
+of the actual implementation may very slightly but the gist of
+a pull is captured in the following steps:</p>
+
+<ol>
+<li>The client sends login and pull cards.
+<li>The client sends a cookie card if it has previously received a cookie.
+<li>The client sends gimme cards for every phantom that it holds.
+<hr>
+<li>The server checks the login password and rejects the session if
+the user does not have permission to pull.
+<li>If the number entries in the unclustered table on the server is
+greater than 100, then the server constructs a new cluster file to
+cover all those unclustered entries.
+<li>The server sends file cards for every gimme card it received
+from the client.
+<li>The server sends ihave cards for every file in its unclustered
+table that is not a phantom.
+<hr>
+<li>The client adds the content of file cards to its repository.
+<li>The client creates a phantom for every ihave card in the server reply
+that mentions a file that the client does not possess.
+<li>The client creates a phantom for the delta source of file cards when
+the delta source is a file that the client does not possess.
+</ol>
+
+<p>These ten steps represent a single HTTP round-trip request.
+The first three steps are the processing that occurs on the client
+to generate the request.  The middle four steps are processing
+that occurs on the server to interpret the request and generate a
+reply.  And the last three steps are the processing that the
+client does to interpret the reply.</p>
+
+<p>During a pull, the client will keep sending HTTP requests
+until it holds all files that exist on the server.</p>
+
+<p>Note that the server tries
+to limit the size of its reply message to something reasonable
+(usually about 1MB) so that it might stop sending file cards as
+described in step (6) if the reply becomes too large.</p>
+
+<p>Step (5) is the only way in which new clusters can be created.
+By only creating clusters on the server, we hope to minimize the
+amount of overlap between clusters in the common configuration where
+there is a single server and many clients.  The same synchronization
+protocol will continue to work even if there are multiple servers
+or if servers and clients sometimes change roles.  The only negative
+effects of these unusual arrangements is that more than the minimum
+number of clusters might be generated.</p>
+
+<h3>4.2 Push</h3>
+
+<p>A typical push operation proceeds roughly as shown below.  As
+with a pull, the actual implementation may vary slightly.</p>
+
+<ol>
+<li>The client sends login and push cards.
+<li>The client sends file cards for any files that it holds that have
+never before been pushed - files that come from local check-ins.
+<li>If this is the second or later cycle in a push, then the
+client sends file cards for any gimme cards that the server sent
+in the previous cycle.
+<li>The client sends igot cards for every file in its unclustered table
+that is not a phantom.
+<hr>
+<li>The server checks the login and push cards and issues an error if
+anything is amiss.
+<li>The server accepts file cards from the client and adds those files
+to its repository.
+<li>The server creates phantoms for igot cards that mention files it
+does not possess or for file cards that mention delta source files that
+it does not possess.
+<li>The server issues gimme cards for all phantoms.
+<hr>
+<li>The client remembers the gimme cards from the server so that it
+can generate file cards in reply on the next cycle.
+</ol>
+
+<p>As with a pull, the steps of a push operation repeat until the
+server knows all files that exist on the client.  Also, as with
+pull, the client attempts to keep the size of the request from
+growing too large by suppressing file cards once the
+size of the request reaches 1MB.</p>
+
+<h3>4.3 Sync</h3>
+
+<p>A sync is just a pull and a push that happen at the same time.
+The first three steps of a pull are combined with the first five steps
+of a push.  Steps (4) through (7) of a pull are combined with steps
+(5) through (8) of a push.  And steps (8) through (10) of a pull
+are combined with step (9) of a push.</p>
+
+<h2>5.0 Summary</h2>
+
+<p>Here are the key points of the synchronization protocol:</p>
+
+<ol>
+<li>The client sends one or more PUSH HTTP requests to the server.
+    The request and reply content type is "application/x-fossil".
+<li>HTTP request content is compressed using zlib.
+<li>The content of request and reply consists of cards with one
+    card per line.
+<li>Card formats are:
+    <ul>
+    <li> <b>login</b> <i>userid nonce signature</i>
+    <li> <b>push</b> <i>servercode projectcode</i>
+    <li> <b>pull</b> <i>servercode projectcode</i>
+    <li> <b>clone</b>
+    <li> <b>file</b> <i>uuid size</i> <b>\n</b> <i>content</i>
+    <li> <b>file</b> <i>uuid delta-uuid size</i> <b>\n</b> <i>content</i>
+    <li> <b>igot</b> <i>uuid</i>
+    <li> <b>gimme</b> <i>uuid</i>
+    <li> <b>cookie</b>  <i>cookie-text</i>
+    <li> <b>error</b> <i>error-message</i>
+    </ul>
+<li>Phantoms are files that a repository knows exist but does not possess.
+<li>Clusters are files that contain the UUIDs of other files.
+<li>Clusters are created automatically on the server during a pull.
+<li>Repositories keep track of all files that are not named in any
+cluster and send igot messages for those files.
+<li>Repositories keep track of all the phantoms they hold and send
+gimme messages for those files.
+</ol>
 
+</body>
+</html>