Fossil SCM
Change output formatting of describe_artifact_to_stdout() to omit the RID. Make sure the purgeevent and purgeitem tables are not deleted by a rebuild.
Commit
1c7dd7949e43001acd309506838bbc2ffa6b91b8
Parent
dd5635561a77e7f…
2 files changed
+9
-11
+2
-1
+9
-11
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -922,29 +922,27 @@ | ||
| 922 | 922 | int describe_artifacts_to_stdout(const char *zWhere, const char *zLabel){ |
| 923 | 923 | Stmt q; |
| 924 | 924 | int cnt = 0; |
| 925 | 925 | describe_artifacts(zWhere); |
| 926 | 926 | db_prepare(&q, |
| 927 | - "SELECT rid, uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n" | |
| 927 | + "SELECT uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n" | |
| 928 | 928 | " FROM description\n" |
| 929 | - " ORDER BY rid;" | |
| 929 | + " ORDER BY ctime, type;" | |
| 930 | 930 | ); |
| 931 | 931 | while( db_step(&q)==SQLITE_ROW ){ |
| 932 | - const char *zType = db_column_text(&q,3); | |
| 933 | - const char *zPrivate = db_column_int(&q,5) ? "(U) " : ""; | |
| 932 | + const char *zType = db_column_text(&q,2); | |
| 934 | 933 | if( zLabel ){ fossil_print("%s\n", zLabel); zLabel = 0; } |
| 935 | - fossil_print("%6d %.16s %s%s", | |
| 936 | - db_column_int(&q,0), db_column_text(&q,1), zPrivate, | |
| 937 | - db_column_text(&q,3)); | |
| 938 | - if( db_column_bytes(&q,4)>0 ){ | |
| 939 | - fossil_print(" %s", db_column_text(&q,4)); | |
| 934 | + fossil_print(" %.16s %s", db_column_text(&q,0), db_column_text(&q,2)); | |
| 935 | + if( db_column_bytes(&q,3)>0 ){ | |
| 936 | + fossil_print(" %s", db_column_text(&q,3)); | |
| 940 | 937 | } |
| 941 | - if( db_column_bytes(&q,2)>0 | |
| 938 | + if( db_column_bytes(&q,1)>0 | |
| 942 | 939 | && fossil_strcmp(zType,"checkin")==0 |
| 943 | 940 | ){ |
| 944 | - fossil_print(" %s", db_column_text(&q,2)); | |
| 941 | + fossil_print(" %s", db_column_text(&q,1)); | |
| 945 | 942 | } |
| 943 | + if( db_column_int(&q,4) ) fossil_print(" (unpublished)"); | |
| 946 | 944 | fossil_print("\n"); |
| 947 | 945 | cnt++; |
| 948 | 946 | } |
| 949 | 947 | db_finalize(&q); |
| 950 | 948 | db_multi_exec("DELETE FROM description;"); |
| 951 | 949 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -922,29 +922,27 @@ | |
| 922 | int describe_artifacts_to_stdout(const char *zWhere, const char *zLabel){ |
| 923 | Stmt q; |
| 924 | int cnt = 0; |
| 925 | describe_artifacts(zWhere); |
| 926 | db_prepare(&q, |
| 927 | "SELECT rid, uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n" |
| 928 | " FROM description\n" |
| 929 | " ORDER BY rid;" |
| 930 | ); |
| 931 | while( db_step(&q)==SQLITE_ROW ){ |
| 932 | const char *zType = db_column_text(&q,3); |
| 933 | const char *zPrivate = db_column_int(&q,5) ? "(U) " : ""; |
| 934 | if( zLabel ){ fossil_print("%s\n", zLabel); zLabel = 0; } |
| 935 | fossil_print("%6d %.16s %s%s", |
| 936 | db_column_int(&q,0), db_column_text(&q,1), zPrivate, |
| 937 | db_column_text(&q,3)); |
| 938 | if( db_column_bytes(&q,4)>0 ){ |
| 939 | fossil_print(" %s", db_column_text(&q,4)); |
| 940 | } |
| 941 | if( db_column_bytes(&q,2)>0 |
| 942 | && fossil_strcmp(zType,"checkin")==0 |
| 943 | ){ |
| 944 | fossil_print(" %s", db_column_text(&q,2)); |
| 945 | } |
| 946 | fossil_print("\n"); |
| 947 | cnt++; |
| 948 | } |
| 949 | db_finalize(&q); |
| 950 | db_multi_exec("DELETE FROM description;"); |
| 951 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -922,29 +922,27 @@ | |
| 922 | int describe_artifacts_to_stdout(const char *zWhere, const char *zLabel){ |
| 923 | Stmt q; |
| 924 | int cnt = 0; |
| 925 | describe_artifacts(zWhere); |
| 926 | db_prepare(&q, |
| 927 | "SELECT uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n" |
| 928 | " FROM description\n" |
| 929 | " ORDER BY ctime, type;" |
| 930 | ); |
| 931 | while( db_step(&q)==SQLITE_ROW ){ |
| 932 | const char *zType = db_column_text(&q,2); |
| 933 | if( zLabel ){ fossil_print("%s\n", zLabel); zLabel = 0; } |
| 934 | fossil_print(" %.16s %s", db_column_text(&q,0), db_column_text(&q,2)); |
| 935 | if( db_column_bytes(&q,3)>0 ){ |
| 936 | fossil_print(" %s", db_column_text(&q,3)); |
| 937 | } |
| 938 | if( db_column_bytes(&q,1)>0 |
| 939 | && fossil_strcmp(zType,"checkin")==0 |
| 940 | ){ |
| 941 | fossil_print(" %s", db_column_text(&q,1)); |
| 942 | } |
| 943 | if( db_column_int(&q,4) ) fossil_print(" (unpublished)"); |
| 944 | fossil_print("\n"); |
| 945 | cnt++; |
| 946 | } |
| 947 | db_finalize(&q); |
| 948 | db_multi_exec("DELETE FROM description;"); |
| 949 |
+2
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -348,11 +348,12 @@ | ||
| 348 | 348 | zTable = db_text(0, |
| 349 | 349 | "SELECT name FROM sqlite_master /*scan*/" |
| 350 | 350 | " WHERE type='table'" |
| 351 | 351 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 352 | 352 | "'config','shun','private','reportfmt'," |
| 353 | - "'concealed','accesslog','modreq')" | |
| 353 | + "'concealed','accesslog','modreq'," | |
| 354 | + "'purgeevent','purgeitem')" | |
| 354 | 355 | " AND name NOT GLOB 'sqlite_*'" |
| 355 | 356 | " AND name NOT GLOB 'fx_*'" |
| 356 | 357 | ); |
| 357 | 358 | if( zTable==0 ) break; |
| 358 | 359 | db_multi_exec("DROP TABLE %Q", zTable); |
| 359 | 360 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -348,11 +348,12 @@ | |
| 348 | zTable = db_text(0, |
| 349 | "SELECT name FROM sqlite_master /*scan*/" |
| 350 | " WHERE type='table'" |
| 351 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 352 | "'config','shun','private','reportfmt'," |
| 353 | "'concealed','accesslog','modreq')" |
| 354 | " AND name NOT GLOB 'sqlite_*'" |
| 355 | " AND name NOT GLOB 'fx_*'" |
| 356 | ); |
| 357 | if( zTable==0 ) break; |
| 358 | db_multi_exec("DROP TABLE %Q", zTable); |
| 359 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -348,11 +348,12 @@ | |
| 348 | zTable = db_text(0, |
| 349 | "SELECT name FROM sqlite_master /*scan*/" |
| 350 | " WHERE type='table'" |
| 351 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 352 | "'config','shun','private','reportfmt'," |
| 353 | "'concealed','accesslog','modreq'," |
| 354 | "'purgeevent','purgeitem')" |
| 355 | " AND name NOT GLOB 'sqlite_*'" |
| 356 | " AND name NOT GLOB 'fx_*'" |
| 357 | ); |
| 358 | if( zTable==0 ) break; |
| 359 | db_multi_exec("DROP TABLE %Q", zTable); |
| 360 |