Fossil SCM
Remove some excess comments, minor rearrangement
Commit
8b8e7654232fda5ccf64e97c355dc5808f81e0fc
Parent
5258a43d78fd433…
1 file changed
+8
-12
+8
-12
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -150,11 +150,11 @@ | ||
| 150 | 150 | " coalesce(origname!=pathname,0) AS renamed, islink, 1 AS managed" |
| 151 | 151 | " FROM vfile, blob USING (rid)" |
| 152 | 152 | " WHERE is_selected(id)%s", |
| 153 | 153 | flags & C_MTIME ? "datetime(checkin_mtime(:vid, rid), " |
| 154 | 154 | "'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*/, | |
| 156 | 156 | blob_sql_text(&where)); |
| 157 | 157 | |
| 158 | 158 | /* Exclude unchanged files unless requested. */ |
| 159 | 159 | if( !(flags & C_UNCHANGED) ){ |
| 160 | 160 | blob_append_sql(&sql, |
| @@ -169,13 +169,14 @@ | ||
| 169 | 169 | } |
| 170 | 170 | blob_append_sql(&sql, |
| 171 | 171 | " SELECT pathname, %s, %s, 0, 0, 0, 0, 0, 0" |
| 172 | 172 | " FROM sfile WHERE pathname NOT IN (%s)%s", |
| 173 | 173 | flags & C_MTIME ? "datetime(mtime, 'unixepoch', toLocal())" : "''", |
| 174 | - flags & C_SIZE ? "size" : "0", | |
| 174 | + flags & C_SIZE ? "size" : "0", | |
| 175 | 175 | fossil_all_reserved_names(0), blob_sql_text(&where)); |
| 176 | 176 | } |
| 177 | + blob_reset(&where); | |
| 177 | 178 | |
| 178 | 179 | /* Pre-create the "ok" temporary table so the checkin_mtime() SQL function |
| 179 | 180 | * does not lead to SQLITE_ABORT_ROLLBACK during execution of the OP_OpenRead |
| 180 | 181 | * SQLite opcode. checkin_mtime() calls mtime_of_manifest_file() which |
| 181 | 182 | * creates a temporary table if it doesn't already exist, thus invalidating |
| @@ -184,11 +185,10 @@ | ||
| 184 | 185 | |
| 185 | 186 | /* Append an ORDER BY clause then compile the query. */ |
| 186 | 187 | blob_append_sql(&sql, " ORDER BY pathname"); |
| 187 | 188 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 188 | 189 | blob_reset(&sql); |
| 189 | - blob_reset(&where); | |
| 190 | 190 | |
| 191 | 191 | /* Bind the checkout version ID to the query if needed. */ |
| 192 | 192 | if( (flags & C_ALL) && (flags & C_MTIME) ){ |
| 193 | 193 | db_bind_int(&q, ":vid", db_lget_int("checkout", 0)); |
| 194 | 194 | } |
| @@ -297,27 +297,23 @@ | ||
| 297 | 297 | /* If C_MERGE, put merge contributors at the end of the report. */ |
| 298 | 298 | if( flags & C_MERGE ){ |
| 299 | 299 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 300 | 300 | " WHERE id<=0"); |
| 301 | 301 | while( db_step(&q)==SQLITE_ROW ){ |
| 302 | - /* If C_COMMENT, precede each line with "# ". */ | |
| 303 | 302 | if( flags & C_COMMENT ){ |
| 304 | 303 | blob_append(report, "# ", 2); |
| 305 | 304 | } |
| 306 | - | |
| 307 | - /* If C_CLASSIFY, include the merge type. */ | |
| 308 | 305 | if( flags & C_CLASSIFY ){ |
| 309 | - const char *zClass = "MERGED_WITH"; | |
| 306 | + const char *zClass; | |
| 310 | 307 | 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; | |
| 314 | 312 | } |
| 315 | 313 | blob_appendf(report, "%-10s ", zClass); |
| 316 | 314 | } |
| 317 | - | |
| 318 | - /* Finish the line with the full SHA1 of the merge contributor. */ | |
| 319 | 315 | blob_append(report, db_column_text(&q, 0), -1); |
| 320 | 316 | blob_append(report, "\n", 1); |
| 321 | 317 | } |
| 322 | 318 | db_finalize(&q); |
| 323 | 319 | } |
| 324 | 320 |
| --- 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 |