Fossil SCM

Remove some excess comments, minor rearrangement

andygoth 2016-11-06 21:28 UTC andygoth-changes
Commit 8b8e7654232fda5ccf64e97c355dc5808f81e0fc
1 file changed +8 -12
+8 -12
--- src/checkin.c
+++ src/checkin.c
@@ -150,11 +150,11 @@
150150
" coalesce(origname!=pathname,0) AS renamed, islink, 1 AS managed"
151151
" FROM vfile, blob USING (rid)"
152152
" WHERE is_selected(id)%s",
153153
flags & C_MTIME ? "datetime(checkin_mtime(:vid, rid), "
154154
"'unixepoch', toLocal())" : "''" /*safe-for-%s*/,
155
- flags & C_SIZE ? "blob.size" : "0" /*safe-for-%s*/,
155
+ flags & C_SIZE ? "blob.size" : "0" /*safe-for-%s*/,
156156
blob_sql_text(&where));
157157
158158
/* Exclude unchanged files unless requested. */
159159
if( !(flags & C_UNCHANGED) ){
160160
blob_append_sql(&sql,
@@ -169,13 +169,14 @@
169169
}
170170
blob_append_sql(&sql,
171171
" SELECT pathname, %s, %s, 0, 0, 0, 0, 0, 0"
172172
" FROM sfile WHERE pathname NOT IN (%s)%s",
173173
flags & C_MTIME ? "datetime(mtime, 'unixepoch', toLocal())" : "''",
174
- flags & C_SIZE ? "size" : "0",
174
+ flags & C_SIZE ? "size" : "0",
175175
fossil_all_reserved_names(0), blob_sql_text(&where));
176176
}
177
+ blob_reset(&where);
177178
178179
/* Pre-create the "ok" temporary table so the checkin_mtime() SQL function
179180
* does not lead to SQLITE_ABORT_ROLLBACK during execution of the OP_OpenRead
180181
* SQLite opcode. checkin_mtime() calls mtime_of_manifest_file() which
181182
* creates a temporary table if it doesn't already exist, thus invalidating
@@ -184,11 +185,10 @@
184185
185186
/* Append an ORDER BY clause then compile the query. */
186187
blob_append_sql(&sql, " ORDER BY pathname");
187188
db_prepare(&q, "%s", blob_sql_text(&sql));
188189
blob_reset(&sql);
189
- blob_reset(&where);
190190
191191
/* Bind the checkout version ID to the query if needed. */
192192
if( (flags & C_ALL) && (flags & C_MTIME) ){
193193
db_bind_int(&q, ":vid", db_lget_int("checkout", 0));
194194
}
@@ -297,27 +297,23 @@
297297
/* If C_MERGE, put merge contributors at the end of the report. */
298298
if( flags & C_MERGE ){
299299
db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
300300
" WHERE id<=0");
301301
while( db_step(&q)==SQLITE_ROW ){
302
- /* If C_COMMENT, precede each line with "# ". */
303302
if( flags & C_COMMENT ){
304303
blob_append(report, "# ", 2);
305304
}
306
-
307
- /* If C_CLASSIFY, include the merge type. */
308305
if( flags & C_CLASSIFY ){
309
- const char *zClass = "MERGED_WITH";
306
+ const char *zClass;
310307
switch( db_column_int(&q, 1) ){
311
- case -1: zClass = "CHERRYPICK"; break;
312
- case -2: zClass = "BACKOUT" ; break;
313
- case -4: zClass = "INTEGRATE" ; break;
308
+ case -1: zClass = "CHERRYPICK" ; break;
309
+ case -2: zClass = "BACKOUT" ; break;
310
+ case -4: zClass = "INTEGRATE" ; break;
311
+ default: zClass = "MERGED_WITH"; break;
314312
}
315313
blob_appendf(report, "%-10s ", zClass);
316314
}
317
-
318
- /* Finish the line with the full SHA1 of the merge contributor. */
319315
blob_append(report, db_column_text(&q, 0), -1);
320316
blob_append(report, "\n", 1);
321317
}
322318
db_finalize(&q);
323319
}
324320
--- src/checkin.c
+++ src/checkin.c
@@ -150,11 +150,11 @@
150 " coalesce(origname!=pathname,0) AS renamed, islink, 1 AS managed"
151 " FROM vfile, blob USING (rid)"
152 " WHERE is_selected(id)%s",
153 flags & C_MTIME ? "datetime(checkin_mtime(:vid, rid), "
154 "'unixepoch', toLocal())" : "''" /*safe-for-%s*/,
155 flags & C_SIZE ? "blob.size" : "0" /*safe-for-%s*/,
156 blob_sql_text(&where));
157
158 /* Exclude unchanged files unless requested. */
159 if( !(flags & C_UNCHANGED) ){
160 blob_append_sql(&sql,
@@ -169,13 +169,14 @@
169 }
170 blob_append_sql(&sql,
171 " SELECT pathname, %s, %s, 0, 0, 0, 0, 0, 0"
172 " FROM sfile WHERE pathname NOT IN (%s)%s",
173 flags & C_MTIME ? "datetime(mtime, 'unixepoch', toLocal())" : "''",
174 flags & C_SIZE ? "size" : "0",
175 fossil_all_reserved_names(0), blob_sql_text(&where));
176 }
 
177
178 /* Pre-create the "ok" temporary table so the checkin_mtime() SQL function
179 * does not lead to SQLITE_ABORT_ROLLBACK during execution of the OP_OpenRead
180 * SQLite opcode. checkin_mtime() calls mtime_of_manifest_file() which
181 * creates a temporary table if it doesn't already exist, thus invalidating
@@ -184,11 +185,10 @@
184
185 /* Append an ORDER BY clause then compile the query. */
186 blob_append_sql(&sql, " ORDER BY pathname");
187 db_prepare(&q, "%s", blob_sql_text(&sql));
188 blob_reset(&sql);
189 blob_reset(&where);
190
191 /* Bind the checkout version ID to the query if needed. */
192 if( (flags & C_ALL) && (flags & C_MTIME) ){
193 db_bind_int(&q, ":vid", db_lget_int("checkout", 0));
194 }
@@ -297,27 +297,23 @@
297 /* If C_MERGE, put merge contributors at the end of the report. */
298 if( flags & C_MERGE ){
299 db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
300 " WHERE id<=0");
301 while( db_step(&q)==SQLITE_ROW ){
302 /* If C_COMMENT, precede each line with "# ". */
303 if( flags & C_COMMENT ){
304 blob_append(report, "# ", 2);
305 }
306
307 /* If C_CLASSIFY, include the merge type. */
308 if( flags & C_CLASSIFY ){
309 const char *zClass = "MERGED_WITH";
310 switch( db_column_int(&q, 1) ){
311 case -1: zClass = "CHERRYPICK"; break;
312 case -2: zClass = "BACKOUT" ; break;
313 case -4: zClass = "INTEGRATE" ; break;
 
314 }
315 blob_appendf(report, "%-10s ", zClass);
316 }
317
318 /* Finish the line with the full SHA1 of the merge contributor. */
319 blob_append(report, db_column_text(&q, 0), -1);
320 blob_append(report, "\n", 1);
321 }
322 db_finalize(&q);
323 }
324
--- src/checkin.c
+++ src/checkin.c
@@ -150,11 +150,11 @@
150 " coalesce(origname!=pathname,0) AS renamed, islink, 1 AS managed"
151 " FROM vfile, blob USING (rid)"
152 " WHERE is_selected(id)%s",
153 flags & C_MTIME ? "datetime(checkin_mtime(:vid, rid), "
154 "'unixepoch', toLocal())" : "''" /*safe-for-%s*/,
155 flags & C_SIZE ? "blob.size" : "0" /*safe-for-%s*/,
156 blob_sql_text(&where));
157
158 /* Exclude unchanged files unless requested. */
159 if( !(flags & C_UNCHANGED) ){
160 blob_append_sql(&sql,
@@ -169,13 +169,14 @@
169 }
170 blob_append_sql(&sql,
171 " SELECT pathname, %s, %s, 0, 0, 0, 0, 0, 0"
172 " FROM sfile WHERE pathname NOT IN (%s)%s",
173 flags & C_MTIME ? "datetime(mtime, 'unixepoch', toLocal())" : "''",
174 flags & C_SIZE ? "size" : "0",
175 fossil_all_reserved_names(0), blob_sql_text(&where));
176 }
177 blob_reset(&where);
178
179 /* Pre-create the "ok" temporary table so the checkin_mtime() SQL function
180 * does not lead to SQLITE_ABORT_ROLLBACK during execution of the OP_OpenRead
181 * SQLite opcode. checkin_mtime() calls mtime_of_manifest_file() which
182 * creates a temporary table if it doesn't already exist, thus invalidating
@@ -184,11 +185,10 @@
185
186 /* Append an ORDER BY clause then compile the query. */
187 blob_append_sql(&sql, " ORDER BY pathname");
188 db_prepare(&q, "%s", blob_sql_text(&sql));
189 blob_reset(&sql);
 
190
191 /* Bind the checkout version ID to the query if needed. */
192 if( (flags & C_ALL) && (flags & C_MTIME) ){
193 db_bind_int(&q, ":vid", db_lget_int("checkout", 0));
194 }
@@ -297,27 +297,23 @@
297 /* If C_MERGE, put merge contributors at the end of the report. */
298 if( flags & C_MERGE ){
299 db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
300 " WHERE id<=0");
301 while( db_step(&q)==SQLITE_ROW ){
 
302 if( flags & C_COMMENT ){
303 blob_append(report, "# ", 2);
304 }
 
 
305 if( flags & C_CLASSIFY ){
306 const char *zClass;
307 switch( db_column_int(&q, 1) ){
308 case -1: zClass = "CHERRYPICK" ; break;
309 case -2: zClass = "BACKOUT" ; break;
310 case -4: zClass = "INTEGRATE" ; break;
311 default: zClass = "MERGED_WITH"; break;
312 }
313 blob_appendf(report, "%-10s ", zClass);
314 }
 
 
315 blob_append(report, db_column_text(&q, 0), -1);
316 blob_append(report, "\n", 1);
317 }
318 db_finalize(&q);
319 }
320

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button