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.

drh 2014-12-01 17:17 UTC DBP-workflow
Commit 1c7dd7949e43001acd309506838bbc2ffa6b91b8
2 files changed +9 -11 +2 -1
+9 -11
--- src/name.c
+++ src/name.c
@@ -922,29 +922,27 @@
922922
int describe_artifacts_to_stdout(const char *zWhere, const char *zLabel){
923923
Stmt q;
924924
int cnt = 0;
925925
describe_artifacts(zWhere);
926926
db_prepare(&q,
927
- "SELECT rid, uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n"
927
+ "SELECT uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n"
928928
" FROM description\n"
929
- " ORDER BY rid;"
929
+ " ORDER BY ctime, type;"
930930
);
931931
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);
934933
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));
940937
}
941
- if( db_column_bytes(&q,2)>0
938
+ if( db_column_bytes(&q,1)>0
942939
&& fossil_strcmp(zType,"checkin")==0
943940
){
944
- fossil_print(" %s", db_column_text(&q,2));
941
+ fossil_print(" %s", db_column_text(&q,1));
945942
}
943
+ if( db_column_int(&q,4) ) fossil_print(" (unpublished)");
946944
fossil_print("\n");
947945
cnt++;
948946
}
949947
db_finalize(&q);
950948
db_multi_exec("DELETE FROM description;");
951949
--- 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 @@
348348
zTable = db_text(0,
349349
"SELECT name FROM sqlite_master /*scan*/"
350350
" WHERE type='table'"
351351
" AND name NOT IN ('blob','delta','rcvfrom','user',"
352352
"'config','shun','private','reportfmt',"
353
- "'concealed','accesslog','modreq')"
353
+ "'concealed','accesslog','modreq',"
354
+ "'purgeevent','purgeitem')"
354355
" AND name NOT GLOB 'sqlite_*'"
355356
" AND name NOT GLOB 'fx_*'"
356357
);
357358
if( zTable==0 ) break;
358359
db_multi_exec("DROP TABLE %Q", zTable);
359360
--- 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

Keyboard Shortcuts

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