Fossil

Diff
Login

Differences From Artifact [c72272885e]:

To Artifact [de4abe9912]:


109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123







-
+







      fossil_fatal("Multiple descendants");
    }
    tid = db_int(0, "SELECT rid FROM leaves, event"
                    " WHERE event.objid=leaves.rid"
                    " ORDER BY event.mtime DESC"); 
  }

  if( tid==vid ) return;  /* Nothing to update */
  if( !verboseFlag && (tid==vid)) return;  /* Nothing to update */
  db_begin_transaction();
  vfile_check_signature(vid, 1);
  if( !nochangeFlag ) undo_begin();
  load_vfile_from_rid(tid);

  /*
  ** The record.fn field is used to match files against each other.  The
168
169
170
171
172
173
174
175
176
177
178
179
180

181
182




183
184




185
186
187







188
189
190
191
192
193
194
168
169
170
171
172
173
174

175
176
177
178

179
180
181
182
183
184
185


186
187
188
189



190
191
192
193
194
195
196
197
198
199
200
201
202
203







-




-
+


+
+
+
+
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+







  db_finalize(&q);

  /* If FILES appear on the command-line, remove from the "fv" table
  ** every entry that is not named on the command-line.
  */
  if( g.argc>=4 ){
    Blob sql;              /* SQL statement to purge unwanted entries */
    char *zSep = "(";      /* Separator in the list of filenames */
    Blob treename;         /* Normalized filename */
    int i;                 /* Loop counter */

    blob_zero(&sql);
    blob_append(&sql, "DELETE FROM fv WHERE fn NOT IN ", -1);
    blob_append(&sql, "DELETE FROM fv WHERE ", -1);
    for(i=3; i<g.argc; i++){
      file_tree_name(g.argv[i], &treename, 1);
      if (file_isdir(g.argv[i]) == 1) {
	  if (blob_size(&treename) > 0) {
	      blob_appendf(&sql, "fn NOT GLOB '%b/*' ", &treename);
	  } else {
      blob_appendf(&sql, "%s'%q'", zSep, blob_str(&treename));
      blob_reset(&treename);
	      blob_appendf(&sql, "fn NOT GLOB '*' ");
	  }
      } else {
	  blob_appendf(&sql, "fn <> %B ", &treename);
      zSep = ",";
    }
    blob_append(&sql, ")", -1);
      }
      if (i < g.argc - 1) {
	  blob_append(&sql, "AND ", -1);
      }
      blob_reset(&treename);
    }
    fprintf(stderr, "%s\n", blob_str(&sql));
    db_multi_exec(blob_str(&sql));
    blob_reset(&sql);
  }

  db_prepare(&q, 
    "SELECT fn, idv, ridv, idt, ridt, chnged FROM fv ORDER BY 1"
  );
262
263
264
265
266
267
268



269


270
271
272
273
274
275
276
271
272
273
274
275
276
277
278
279
280

281
282
283
284
285
286
287
288
289







+
+
+
-
+
+







        printf("***** Cannot merge binary file %s\n", zName);
      }
      blob_reset(&v);
      blob_reset(&e);
      blob_reset(&t);
      blob_reset(&r);
    }else if( verboseFlag ){
	if (chnged) {
	    printf("EDITED %s\n", zName);
	} else {
      printf("UNCHANGED %s\n", zName);
	    printf("UNCHANGED %s\n", zName);
	}
    }
    free(zFullPath);
  }
  db_finalize(&q);
  
  /*
  ** Clean up the mid and pid VFILE entries.  Then commit the changes.