Fossil SCM

Add "--describe" flag to the "version" command to provide context to the most recent major commit tagged with "version*".

danield 2022-03-30 15:08 trunk
Commit 4329553d517f7d13037c19bb590f7f42b98a459e2b9b57c7afa45e1cd090e054
+3 -2
--- src/add.c
+++ src/add.c
@@ -62,13 +62,14 @@
6262
const char *fname;
6363
int flg;
6464
}aManifestflags[] = {
6565
{ "manifest", MFESTFLG_RAW },
6666
{ "manifest.uuid", MFESTFLG_UUID },
67
- { "manifest.tags", MFESTFLG_TAGS }
67
+ { "manifest.tags", MFESTFLG_TAGS },
68
+ { "manifest.descr", MFESTFLG_DESCR }
6869
};
69
- static const char *azManifests[3];
70
+ static const char *azManifests[4];
7071
7172
/*
7273
** Names of repository files, if they exist in the checkout.
7374
*/
7475
static const char *azRepo[4] = { 0, 0, 0, 0 };
7576
--- src/add.c
+++ src/add.c
@@ -62,13 +62,14 @@
62 const char *fname;
63 int flg;
64 }aManifestflags[] = {
65 { "manifest", MFESTFLG_RAW },
66 { "manifest.uuid", MFESTFLG_UUID },
67 { "manifest.tags", MFESTFLG_TAGS }
 
68 };
69 static const char *azManifests[3];
70
71 /*
72 ** Names of repository files, if they exist in the checkout.
73 */
74 static const char *azRepo[4] = { 0, 0, 0, 0 };
75
--- src/add.c
+++ src/add.c
@@ -62,13 +62,14 @@
62 const char *fname;
63 int flg;
64 }aManifestflags[] = {
65 { "manifest", MFESTFLG_RAW },
66 { "manifest.uuid", MFESTFLG_UUID },
67 { "manifest.tags", MFESTFLG_TAGS },
68 { "manifest.descr", MFESTFLG_DESCR }
69 };
70 static const char *azManifests[4];
71
72 /*
73 ** Names of repository files, if they exist in the checkout.
74 */
75 static const char *azRepo[4] = { 0, 0, 0, 0 };
76
--- src/checkin.c
+++ src/checkin.c
@@ -2211,10 +2211,11 @@
22112211
int allowConflict = 0; /* Allow unresolve merge conflicts */
22122212
int allowEmpty = 0; /* Allow a commit with no changes */
22132213
int allowFork = 0; /* Allow the commit to fork */
22142214
int allowOlder = 0; /* Allow a commit older than its ancestor */
22152215
char *zManifestFile; /* Name of the manifest file */
2216
+ char *zDescrFile; /* Name of the description file */
22162217
int useCksum; /* True if checksums should be computed and verified */
22172218
int outputManifest; /* True to output "manifest" and "manifest.uuid" */
22182219
int dryRunFlag; /* True for a test run. Debugging only */
22192220
CheckinInfo sCiInfo; /* Information about this check-in */
22202221
const char *zComFile; /* Read commit message from this file */
@@ -2222,10 +2223,11 @@
22222223
const char *zTag; /* A single --tag argument */
22232224
ManifestFile *pFile; /* File structure in the manifest */
22242225
Manifest *pManifest; /* Manifest structure */
22252226
Blob manifest; /* Manifest in baseline form */
22262227
Blob muuid; /* Manifest uuid */
2228
+ Blob descr; /* Commit description */
22272229
Blob cksum1, cksum2; /* Before and after commit checksums */
22282230
Blob cksum1b; /* Checksum recorded in the manifest */
22292231
int szD; /* Size of the delta manifest */
22302232
int szB; /* Size of the baseline manifest */
22312233
int nConflict = 0; /* Number of unresolved merge conflicts */
@@ -2778,10 +2780,22 @@
27782780
blob_appendf(&muuid, "%s\n", zUuid);
27792781
blob_write_to_file(&muuid, zManifestFile);
27802782
free(zManifestFile);
27812783
blob_reset(&muuid);
27822784
}
2785
+
2786
+ if( outputManifest & MFESTFLG_DESCR ){
2787
+ CommitDescr cd;
2788
+ zDescrFile = mprintf("%smanifest.descr", g.zLocalRoot);
2789
+ blob_zero(&descr);
2790
+ describe_commit(zUuid, "version*", &cd);
2791
+ blob_appendf(&descr, "%s-%d-%10.10s%s\n", cd.zRelTagname, cd.nCommitsSince,
2792
+ cd.zCommitHash, cd.isDirty ? "-dirty" : "");
2793
+ blob_write_to_file(&descr, zDescrFile);
2794
+ free(zDescrFile);
2795
+ blob_reset(&descr);
2796
+ }
27832797
27842798
/* Update the vfile and vmerge tables */
27852799
db_multi_exec(
27862800
"DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
27872801
"DELETE FROM vmerge;"
27882802
--- src/checkin.c
+++ src/checkin.c
@@ -2211,10 +2211,11 @@
2211 int allowConflict = 0; /* Allow unresolve merge conflicts */
2212 int allowEmpty = 0; /* Allow a commit with no changes */
2213 int allowFork = 0; /* Allow the commit to fork */
2214 int allowOlder = 0; /* Allow a commit older than its ancestor */
2215 char *zManifestFile; /* Name of the manifest file */
 
2216 int useCksum; /* True if checksums should be computed and verified */
2217 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
2218 int dryRunFlag; /* True for a test run. Debugging only */
2219 CheckinInfo sCiInfo; /* Information about this check-in */
2220 const char *zComFile; /* Read commit message from this file */
@@ -2222,10 +2223,11 @@
2222 const char *zTag; /* A single --tag argument */
2223 ManifestFile *pFile; /* File structure in the manifest */
2224 Manifest *pManifest; /* Manifest structure */
2225 Blob manifest; /* Manifest in baseline form */
2226 Blob muuid; /* Manifest uuid */
 
2227 Blob cksum1, cksum2; /* Before and after commit checksums */
2228 Blob cksum1b; /* Checksum recorded in the manifest */
2229 int szD; /* Size of the delta manifest */
2230 int szB; /* Size of the baseline manifest */
2231 int nConflict = 0; /* Number of unresolved merge conflicts */
@@ -2778,10 +2780,22 @@
2778 blob_appendf(&muuid, "%s\n", zUuid);
2779 blob_write_to_file(&muuid, zManifestFile);
2780 free(zManifestFile);
2781 blob_reset(&muuid);
2782 }
 
 
 
 
 
 
 
 
 
 
 
 
2783
2784 /* Update the vfile and vmerge tables */
2785 db_multi_exec(
2786 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
2787 "DELETE FROM vmerge;"
2788
--- src/checkin.c
+++ src/checkin.c
@@ -2211,10 +2211,11 @@
2211 int allowConflict = 0; /* Allow unresolve merge conflicts */
2212 int allowEmpty = 0; /* Allow a commit with no changes */
2213 int allowFork = 0; /* Allow the commit to fork */
2214 int allowOlder = 0; /* Allow a commit older than its ancestor */
2215 char *zManifestFile; /* Name of the manifest file */
2216 char *zDescrFile; /* Name of the description file */
2217 int useCksum; /* True if checksums should be computed and verified */
2218 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
2219 int dryRunFlag; /* True for a test run. Debugging only */
2220 CheckinInfo sCiInfo; /* Information about this check-in */
2221 const char *zComFile; /* Read commit message from this file */
@@ -2222,10 +2223,11 @@
2223 const char *zTag; /* A single --tag argument */
2224 ManifestFile *pFile; /* File structure in the manifest */
2225 Manifest *pManifest; /* Manifest structure */
2226 Blob manifest; /* Manifest in baseline form */
2227 Blob muuid; /* Manifest uuid */
2228 Blob descr; /* Commit description */
2229 Blob cksum1, cksum2; /* Before and after commit checksums */
2230 Blob cksum1b; /* Checksum recorded in the manifest */
2231 int szD; /* Size of the delta manifest */
2232 int szB; /* Size of the baseline manifest */
2233 int nConflict = 0; /* Number of unresolved merge conflicts */
@@ -2778,10 +2780,22 @@
2780 blob_appendf(&muuid, "%s\n", zUuid);
2781 blob_write_to_file(&muuid, zManifestFile);
2782 free(zManifestFile);
2783 blob_reset(&muuid);
2784 }
2785
2786 if( outputManifest & MFESTFLG_DESCR ){
2787 CommitDescr cd;
2788 zDescrFile = mprintf("%smanifest.descr", g.zLocalRoot);
2789 blob_zero(&descr);
2790 describe_commit(zUuid, "version*", &cd);
2791 blob_appendf(&descr, "%s-%d-%10.10s%s\n", cd.zRelTagname, cd.nCommitsSince,
2792 cd.zCommitHash, cd.isDirty ? "-dirty" : "");
2793 blob_write_to_file(&descr, zDescrFile);
2794 free(zDescrFile);
2795 blob_reset(&descr);
2796 }
2797
2798 /* Update the vfile and vmerge tables */
2799 db_multi_exec(
2800 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
2801 "DELETE FROM vmerge;"
2802
+19 -1
--- src/checkout.c
+++ src/checkout.c
@@ -173,10 +173,11 @@
173173
*/
174174
void manifest_to_disk(int vid){
175175
char *zManFile;
176176
Blob manifest;
177177
Blob taglist;
178
+ Blob descr;
178179
int flg;
179180
180181
flg = db_get_manifest_setting();
181182
182183
if( flg & MFESTFLG_RAW ){
@@ -219,10 +220,27 @@
219220
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
220221
zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
221222
file_delete(zManFile);
222223
free(zManFile);
223224
}
225
+ }
226
+ if( flg & MFESTFLG_DESCR ){
227
+ CommitDescr cd;
228
+ blob_zero(&descr);
229
+ zManFile = mprintf("%smanifest.descr", g.zLocalRoot);
230
+ describe_commit(rid_to_uuid(vid), "version*", &cd);
231
+ blob_appendf(&descr, "%s-%d-%10.10s%s\n", cd.zRelTagname, cd.nCommitsSince,
232
+ cd.zCommitHash, cd.isDirty ? "-dirty" : "");
233
+ blob_write_to_file(&descr, zManFile);
234
+ free(zManFile);
235
+ blob_reset(&descr);
236
+ }else{
237
+ if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.descr'") ){
238
+ zManFile = mprintf("%smanifest.descr", g.zLocalRoot);
239
+ file_delete(zManFile);
240
+ free(zManFile);
241
+ }
224242
}
225243
}
226244
227245
/*
228246
** Find the branch name and all symbolic tags for a particular check-in
@@ -352,13 +370,13 @@
352370
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
353371
if( !keepFlag ){
354372
vfile_to_disk(vid, 0, !g.fQuiet, promptFlag);
355373
}
356374
checkout_set_all_exe(vid);
375
+ db_set_checkout(vid);
357376
manifest_to_disk(vid);
358377
ensure_empty_dirs_created(0);
359
- db_set_checkout(vid);
360378
undo_reset();
361379
db_multi_exec("DELETE FROM vmerge");
362380
if( !keepFlag && db_get_boolean("repo-cksum",1) ){
363381
vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
364382
vfile_aggregate_checksum_disk(vid, &cksum2);
365383
--- src/checkout.c
+++ src/checkout.c
@@ -173,10 +173,11 @@
173 */
174 void manifest_to_disk(int vid){
175 char *zManFile;
176 Blob manifest;
177 Blob taglist;
 
178 int flg;
179
180 flg = db_get_manifest_setting();
181
182 if( flg & MFESTFLG_RAW ){
@@ -219,10 +220,27 @@
219 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
220 zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
221 file_delete(zManFile);
222 free(zManFile);
223 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224 }
225 }
226
227 /*
228 ** Find the branch name and all symbolic tags for a particular check-in
@@ -352,13 +370,13 @@
352 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
353 if( !keepFlag ){
354 vfile_to_disk(vid, 0, !g.fQuiet, promptFlag);
355 }
356 checkout_set_all_exe(vid);
 
357 manifest_to_disk(vid);
358 ensure_empty_dirs_created(0);
359 db_set_checkout(vid);
360 undo_reset();
361 db_multi_exec("DELETE FROM vmerge");
362 if( !keepFlag && db_get_boolean("repo-cksum",1) ){
363 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
364 vfile_aggregate_checksum_disk(vid, &cksum2);
365
--- src/checkout.c
+++ src/checkout.c
@@ -173,10 +173,11 @@
173 */
174 void manifest_to_disk(int vid){
175 char *zManFile;
176 Blob manifest;
177 Blob taglist;
178 Blob descr;
179 int flg;
180
181 flg = db_get_manifest_setting();
182
183 if( flg & MFESTFLG_RAW ){
@@ -219,10 +220,27 @@
220 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
221 zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
222 file_delete(zManFile);
223 free(zManFile);
224 }
225 }
226 if( flg & MFESTFLG_DESCR ){
227 CommitDescr cd;
228 blob_zero(&descr);
229 zManFile = mprintf("%smanifest.descr", g.zLocalRoot);
230 describe_commit(rid_to_uuid(vid), "version*", &cd);
231 blob_appendf(&descr, "%s-%d-%10.10s%s\n", cd.zRelTagname, cd.nCommitsSince,
232 cd.zCommitHash, cd.isDirty ? "-dirty" : "");
233 blob_write_to_file(&descr, zManFile);
234 free(zManFile);
235 blob_reset(&descr);
236 }else{
237 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.descr'") ){
238 zManFile = mprintf("%smanifest.descr", g.zLocalRoot);
239 file_delete(zManFile);
240 free(zManFile);
241 }
242 }
243 }
244
245 /*
246 ** Find the branch name and all symbolic tags for a particular check-in
@@ -352,13 +370,13 @@
370 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
371 if( !keepFlag ){
372 vfile_to_disk(vid, 0, !g.fQuiet, promptFlag);
373 }
374 checkout_set_all_exe(vid);
375 db_set_checkout(vid);
376 manifest_to_disk(vid);
377 ensure_empty_dirs_created(0);
 
378 undo_reset();
379 db_multi_exec("DELETE FROM vmerge");
380 if( !keepFlag && db_get_boolean("repo-cksum",1) ){
381 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
382 vfile_aggregate_checksum_disk(vid, &cksum2);
383
+6 -3
--- src/db.c
+++ src/db.c
@@ -3485,10 +3485,11 @@
34853485
#if INTERFACE
34863486
/* Manifest generation flags */
34873487
#define MFESTFLG_RAW 0x01
34883488
#define MFESTFLG_UUID 0x02
34893489
#define MFESTFLG_TAGS 0x04
3490
+#define MFESTFLG_DESCR 0x08
34903491
#endif /* INTERFACE */
34913492
34923493
/*
34933494
** Get the manifest setting. For backwards compatibility first check if the
34943495
** value is a boolean. If it's not a boolean, treat each character as a flag
@@ -3500,18 +3501,19 @@
35003501
int flg;
35013502
char *zVal = db_get("manifest", 0);
35023503
if( zVal==0 || is_false(zVal) ){
35033504
return 0;
35043505
}else if( is_truth(zVal) ){
3505
- return MFESTFLG_RAW|MFESTFLG_UUID;
3506
+ return MFESTFLG_RAW|MFESTFLG_UUID|MFESTFLG_DESCR;
35063507
}
35073508
flg = 0;
35083509
while( *zVal ){
35093510
switch( *zVal ){
35103511
case 'r': flg |= MFESTFLG_RAW; break;
35113512
case 'u': flg |= MFESTFLG_UUID; break;
35123513
case 't': flg |= MFESTFLG_TAGS; break;
3514
+ case 'd': flg |= MFESTFLG_DESCR; break;
35133515
}
35143516
zVal++;
35153517
}
35163518
return flg;
35173519
}
@@ -4257,12 +4259,13 @@
42574259
** SETTING: manifest width=5 versionable
42584260
** If enabled, automatically create files "manifest" and "manifest.uuid"
42594261
** in every checkout.
42604262
**
42614263
** Optionally use combinations of characters 'r' for "manifest",
4262
-** 'u' for "manifest.uuid" and 't' for "manifest.tags". The SQLite
4263
-** and Fossil repositories both require manifests.
4264
+** 'u' for "manifest.uuid", 't' for "manifest.tags", and 'd'
4265
+** for "manifest.descr". The SQLite and Fossil repositories both
4266
+** require manifests.
42644267
*/
42654268
/*
42664269
** SETTING: max-loadavg width=25 default=0.0
42674270
** Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
42684271
** are disallowed if the system load average goes above this
42694272
--- src/db.c
+++ src/db.c
@@ -3485,10 +3485,11 @@
3485 #if INTERFACE
3486 /* Manifest generation flags */
3487 #define MFESTFLG_RAW 0x01
3488 #define MFESTFLG_UUID 0x02
3489 #define MFESTFLG_TAGS 0x04
 
3490 #endif /* INTERFACE */
3491
3492 /*
3493 ** Get the manifest setting. For backwards compatibility first check if the
3494 ** value is a boolean. If it's not a boolean, treat each character as a flag
@@ -3500,18 +3501,19 @@
3500 int flg;
3501 char *zVal = db_get("manifest", 0);
3502 if( zVal==0 || is_false(zVal) ){
3503 return 0;
3504 }else if( is_truth(zVal) ){
3505 return MFESTFLG_RAW|MFESTFLG_UUID;
3506 }
3507 flg = 0;
3508 while( *zVal ){
3509 switch( *zVal ){
3510 case 'r': flg |= MFESTFLG_RAW; break;
3511 case 'u': flg |= MFESTFLG_UUID; break;
3512 case 't': flg |= MFESTFLG_TAGS; break;
 
3513 }
3514 zVal++;
3515 }
3516 return flg;
3517 }
@@ -4257,12 +4259,13 @@
4257 ** SETTING: manifest width=5 versionable
4258 ** If enabled, automatically create files "manifest" and "manifest.uuid"
4259 ** in every checkout.
4260 **
4261 ** Optionally use combinations of characters 'r' for "manifest",
4262 ** 'u' for "manifest.uuid" and 't' for "manifest.tags". The SQLite
4263 ** and Fossil repositories both require manifests.
 
4264 */
4265 /*
4266 ** SETTING: max-loadavg width=25 default=0.0
4267 ** Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
4268 ** are disallowed if the system load average goes above this
4269
--- src/db.c
+++ src/db.c
@@ -3485,10 +3485,11 @@
3485 #if INTERFACE
3486 /* Manifest generation flags */
3487 #define MFESTFLG_RAW 0x01
3488 #define MFESTFLG_UUID 0x02
3489 #define MFESTFLG_TAGS 0x04
3490 #define MFESTFLG_DESCR 0x08
3491 #endif /* INTERFACE */
3492
3493 /*
3494 ** Get the manifest setting. For backwards compatibility first check if the
3495 ** value is a boolean. If it's not a boolean, treat each character as a flag
@@ -3500,18 +3501,19 @@
3501 int flg;
3502 char *zVal = db_get("manifest", 0);
3503 if( zVal==0 || is_false(zVal) ){
3504 return 0;
3505 }else if( is_truth(zVal) ){
3506 return MFESTFLG_RAW|MFESTFLG_UUID|MFESTFLG_DESCR;
3507 }
3508 flg = 0;
3509 while( *zVal ){
3510 switch( *zVal ){
3511 case 'r': flg |= MFESTFLG_RAW; break;
3512 case 'u': flg |= MFESTFLG_UUID; break;
3513 case 't': flg |= MFESTFLG_TAGS; break;
3514 case 'd': flg |= MFESTFLG_DESCR; break;
3515 }
3516 zVal++;
3517 }
3518 return flg;
3519 }
@@ -4257,12 +4259,13 @@
4259 ** SETTING: manifest width=5 versionable
4260 ** If enabled, automatically create files "manifest" and "manifest.uuid"
4261 ** in every checkout.
4262 **
4263 ** Optionally use combinations of characters 'r' for "manifest",
4264 ** 'u' for "manifest.uuid", 't' for "manifest.tags", and 'd'
4265 ** for "manifest.descr". The SQLite and Fossil repositories both
4266 ** require manifests.
4267 */
4268 /*
4269 ** SETTING: max-loadavg width=25 default=0.0
4270 ** Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
4271 ** are disallowed if the system load average goes above this
4272
+11
--- src/export.c
+++ src/export.c
@@ -1288,10 +1288,21 @@
12881288
blob_init(&tagslist, 0, 0);
12891289
get_checkin_taglist(rid, &tagslist);
12901290
fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
12911291
blob_strlen(&tagslist), blob_str(&tagslist));
12921292
blob_reset(&tagslist);
1293
+ }
1294
+ if( fManifest & MFESTFLG_DESCR ){
1295
+ CommitDescr cd;
1296
+ Blob descr;
1297
+ blob_init(&descr, 0, 0);
1298
+ describe_commit(rid_to_uuid(rid), "version*", &cd);
1299
+ blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
1300
+ cd.nCommitsSince, cd.zCommitHash);
1301
+ fprintf(xCmd,"M 100644 inline manifest.descr\ndata %d\n%s\n",
1302
+ blob_strlen(&descr), blob_str(&descr));
1303
+ blob_reset(&descr);
12931304
}
12941305
12951306
/* The check-in is finished, so decrement the counter */
12961307
(*pnLimit)--;
12971308
return 0;
12981309
--- src/export.c
+++ src/export.c
@@ -1288,10 +1288,21 @@
1288 blob_init(&tagslist, 0, 0);
1289 get_checkin_taglist(rid, &tagslist);
1290 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1291 blob_strlen(&tagslist), blob_str(&tagslist));
1292 blob_reset(&tagslist);
 
 
 
 
 
 
 
 
 
 
 
1293 }
1294
1295 /* The check-in is finished, so decrement the counter */
1296 (*pnLimit)--;
1297 return 0;
1298
--- src/export.c
+++ src/export.c
@@ -1288,10 +1288,21 @@
1288 blob_init(&tagslist, 0, 0);
1289 get_checkin_taglist(rid, &tagslist);
1290 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1291 blob_strlen(&tagslist), blob_str(&tagslist));
1292 blob_reset(&tagslist);
1293 }
1294 if( fManifest & MFESTFLG_DESCR ){
1295 CommitDescr cd;
1296 Blob descr;
1297 blob_init(&descr, 0, 0);
1298 describe_commit(rid_to_uuid(rid), "version*", &cd);
1299 blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
1300 cd.nCommitsSince, cd.zCommitHash);
1301 fprintf(xCmd,"M 100644 inline manifest.descr\ndata %d\n%s\n",
1302 blob_strlen(&descr), blob_str(&descr));
1303 blob_reset(&descr);
1304 }
1305
1306 /* The check-in is finished, so decrement the counter */
1307 (*pnLimit)--;
1308 return 0;
1309
+1 -1
--- src/info.c
+++ src/info.c
@@ -247,11 +247,11 @@
247247
db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/"));
248248
}
249249
if( verboseFlag || !g.repositoryOpen ){
250250
Blob vx;
251251
char *z;
252
- fossil_version_blob(&vx, 0);
252
+ fossil_version_blob(&vx, 0, 0);
253253
z = strstr(blob_str(&vx), "version");
254254
if( z ){
255255
z += 8;
256256
}else{
257257
z = blob_str(&vx);
258258
--- src/info.c
+++ src/info.c
@@ -247,11 +247,11 @@
247 db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/"));
248 }
249 if( verboseFlag || !g.repositoryOpen ){
250 Blob vx;
251 char *z;
252 fossil_version_blob(&vx, 0);
253 z = strstr(blob_str(&vx), "version");
254 if( z ){
255 z += 8;
256 }else{
257 z = blob_str(&vx);
258
--- src/info.c
+++ src/info.c
@@ -247,11 +247,11 @@
247 db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/"));
248 }
249 if( verboseFlag || !g.repositoryOpen ){
250 Blob vx;
251 char *z;
252 fossil_version_blob(&vx, 0, 0);
253 z = strstr(blob_str(&vx), "version");
254 if( z ){
255 z += 8;
256 }else{
257 z = blob_str(&vx);
258
+32 -5
--- src/main.c
+++ src/main.c
@@ -1162,28 +1162,45 @@
11621162
const char *get_version(){
11631163
static const char version[] = RELEASE_VERSION " " MANIFEST_VERSION " "
11641164
MANIFEST_DATE " UTC";
11651165
return version;
11661166
}
1167
+
1168
+/*
1169
+** This function returns a human readable version string based on 'describe'.
1170
+*/
1171
+const char *get_describe_version(){
1172
+#ifndef MANIFEST_DESCRIPTION
1173
+#define MANIFEST_DESCRIPTION MANIFEST_VERSION
1174
+#endif
1175
+#ifndef DESCRIPTION_DATE
1176
+#define DESCRIPTION_DATE MANIFEST_DATE
1177
+#endif
1178
+ static const char version[] = RELEASE_VERSION " " MANIFEST_DESCRIPTION " "
1179
+ DESCRIPTION_DATE " UTC";
1180
+ return version;
1181
+}
11671182
11681183
/*
11691184
** This function populates a blob with version information. It is used by
11701185
** the "version" command and "test-version" web page. It assumes the blob
11711186
** passed to it is uninitialized; otherwise, it will leak memory.
11721187
*/
11731188
void fossil_version_blob(
11741189
Blob *pOut, /* Write the manifest here */
1175
- int bVerbose /* Non-zero for full information. */
1190
+ int bVerbose, /* Non-zero for full information. */
1191
+ int bDescribe /* Non-zero for describe information. */
11761192
){
11771193
#if defined(FOSSIL_ENABLE_TCL)
11781194
int rc;
11791195
const char *zRc;
11801196
#endif
11811197
Stmt q;
11821198
size_t pageSize = 0;
11831199
blob_zero(pOut);
1184
- blob_appendf(pOut, "This is fossil version %s\n", get_version());
1200
+ blob_appendf(pOut, "This is fossil version %s\n",
1201
+ bDescribe ? get_describe_version() : get_version());
11851202
if( !bVerbose ) return;
11861203
blob_appendf(pOut, "Compiled on %s %s using %s (%d-bit)\n",
11871204
__DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
11881205
blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
11891206
fossil_get_page_size(&pageSize);
@@ -1285,24 +1302,32 @@
12851302
12861303
12871304
/*
12881305
** COMMAND: version
12891306
**
1290
-** Usage: %fossil version ?-v|--verbose?
1307
+** Usage: %fossil version ?-v|--verbose? ?-d|--describe?
12911308
**
12921309
** Print the source code version number for the fossil executable.
12931310
** If the verbose option is specified, additional details will
12941311
** be output about what optional features this binary was compiled
12951312
** with
1313
+**
1314
+** Options:
1315
+**
1316
+** -d|--describe Show an extended description based on the latest
1317
+** tagged source code commit
1318
+** -v|--verbose Show additional details will about what optional
1319
+** features this binary was compiled with
12961320
*/
12971321
void version_cmd(void){
12981322
Blob versionInfo;
12991323
int verboseFlag = find_option("verbose","v",0)!=0;
1324
+ int describeFlag = find_option("describe","d",0)!=0;
13001325
13011326
/* We should be done with options.. */
13021327
verify_all_options();
1303
- fossil_version_blob(&versionInfo, verboseFlag);
1328
+ fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
13041329
fossil_print("%s", blob_str(&versionInfo));
13051330
}
13061331
13071332
13081333
/*
@@ -1315,17 +1340,19 @@
13151340
** verbose Show details
13161341
*/
13171342
void test_version_page(void){
13181343
Blob versionInfo;
13191344
int verboseFlag;
1345
+ int describeFlag;
13201346
13211347
login_check_credentials();
13221348
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
13231349
verboseFlag = PD("verbose", 0) != 0;
1350
+ describeFlag = PD("describe", 0) != 0;
13241351
style_header("Version Information");
13251352
style_submenu_element("Stat", "stat");
1326
- fossil_version_blob(&versionInfo, verboseFlag);
1353
+ fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
13271354
@ <pre>
13281355
@ %h(blob_str(&versionInfo))
13291356
@ </pre>
13301357
style_finish_page();
13311358
}
13321359
--- src/main.c
+++ src/main.c
@@ -1162,28 +1162,45 @@
1162 const char *get_version(){
1163 static const char version[] = RELEASE_VERSION " " MANIFEST_VERSION " "
1164 MANIFEST_DATE " UTC";
1165 return version;
1166 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1167
1168 /*
1169 ** This function populates a blob with version information. It is used by
1170 ** the "version" command and "test-version" web page. It assumes the blob
1171 ** passed to it is uninitialized; otherwise, it will leak memory.
1172 */
1173 void fossil_version_blob(
1174 Blob *pOut, /* Write the manifest here */
1175 int bVerbose /* Non-zero for full information. */
 
1176 ){
1177 #if defined(FOSSIL_ENABLE_TCL)
1178 int rc;
1179 const char *zRc;
1180 #endif
1181 Stmt q;
1182 size_t pageSize = 0;
1183 blob_zero(pOut);
1184 blob_appendf(pOut, "This is fossil version %s\n", get_version());
 
1185 if( !bVerbose ) return;
1186 blob_appendf(pOut, "Compiled on %s %s using %s (%d-bit)\n",
1187 __DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
1188 blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
1189 fossil_get_page_size(&pageSize);
@@ -1285,24 +1302,32 @@
1285
1286
1287 /*
1288 ** COMMAND: version
1289 **
1290 ** Usage: %fossil version ?-v|--verbose?
1291 **
1292 ** Print the source code version number for the fossil executable.
1293 ** If the verbose option is specified, additional details will
1294 ** be output about what optional features this binary was compiled
1295 ** with
 
 
 
 
 
 
 
1296 */
1297 void version_cmd(void){
1298 Blob versionInfo;
1299 int verboseFlag = find_option("verbose","v",0)!=0;
 
1300
1301 /* We should be done with options.. */
1302 verify_all_options();
1303 fossil_version_blob(&versionInfo, verboseFlag);
1304 fossil_print("%s", blob_str(&versionInfo));
1305 }
1306
1307
1308 /*
@@ -1315,17 +1340,19 @@
1315 ** verbose Show details
1316 */
1317 void test_version_page(void){
1318 Blob versionInfo;
1319 int verboseFlag;
 
1320
1321 login_check_credentials();
1322 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1323 verboseFlag = PD("verbose", 0) != 0;
 
1324 style_header("Version Information");
1325 style_submenu_element("Stat", "stat");
1326 fossil_version_blob(&versionInfo, verboseFlag);
1327 @ <pre>
1328 @ %h(blob_str(&versionInfo))
1329 @ </pre>
1330 style_finish_page();
1331 }
1332
--- src/main.c
+++ src/main.c
@@ -1162,28 +1162,45 @@
1162 const char *get_version(){
1163 static const char version[] = RELEASE_VERSION " " MANIFEST_VERSION " "
1164 MANIFEST_DATE " UTC";
1165 return version;
1166 }
1167
1168 /*
1169 ** This function returns a human readable version string based on 'describe'.
1170 */
1171 const char *get_describe_version(){
1172 #ifndef MANIFEST_DESCRIPTION
1173 #define MANIFEST_DESCRIPTION MANIFEST_VERSION
1174 #endif
1175 #ifndef DESCRIPTION_DATE
1176 #define DESCRIPTION_DATE MANIFEST_DATE
1177 #endif
1178 static const char version[] = RELEASE_VERSION " " MANIFEST_DESCRIPTION " "
1179 DESCRIPTION_DATE " UTC";
1180 return version;
1181 }
1182
1183 /*
1184 ** This function populates a blob with version information. It is used by
1185 ** the "version" command and "test-version" web page. It assumes the blob
1186 ** passed to it is uninitialized; otherwise, it will leak memory.
1187 */
1188 void fossil_version_blob(
1189 Blob *pOut, /* Write the manifest here */
1190 int bVerbose, /* Non-zero for full information. */
1191 int bDescribe /* Non-zero for describe information. */
1192 ){
1193 #if defined(FOSSIL_ENABLE_TCL)
1194 int rc;
1195 const char *zRc;
1196 #endif
1197 Stmt q;
1198 size_t pageSize = 0;
1199 blob_zero(pOut);
1200 blob_appendf(pOut, "This is fossil version %s\n",
1201 bDescribe ? get_describe_version() : get_version());
1202 if( !bVerbose ) return;
1203 blob_appendf(pOut, "Compiled on %s %s using %s (%d-bit)\n",
1204 __DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
1205 blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
1206 fossil_get_page_size(&pageSize);
@@ -1285,24 +1302,32 @@
1302
1303
1304 /*
1305 ** COMMAND: version
1306 **
1307 ** Usage: %fossil version ?-v|--verbose? ?-d|--describe?
1308 **
1309 ** Print the source code version number for the fossil executable.
1310 ** If the verbose option is specified, additional details will
1311 ** be output about what optional features this binary was compiled
1312 ** with
1313 **
1314 ** Options:
1315 **
1316 ** -d|--describe Show an extended description based on the latest
1317 ** tagged source code commit
1318 ** -v|--verbose Show additional details will about what optional
1319 ** features this binary was compiled with
1320 */
1321 void version_cmd(void){
1322 Blob versionInfo;
1323 int verboseFlag = find_option("verbose","v",0)!=0;
1324 int describeFlag = find_option("describe","d",0)!=0;
1325
1326 /* We should be done with options.. */
1327 verify_all_options();
1328 fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
1329 fossil_print("%s", blob_str(&versionInfo));
1330 }
1331
1332
1333 /*
@@ -1315,17 +1340,19 @@
1340 ** verbose Show details
1341 */
1342 void test_version_page(void){
1343 Blob versionInfo;
1344 int verboseFlag;
1345 int describeFlag;
1346
1347 login_check_credentials();
1348 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1349 verboseFlag = PD("verbose", 0) != 0;
1350 describeFlag = PD("describe", 0) != 0;
1351 style_header("Version Information");
1352 style_submenu_element("Stat", "stat");
1353 fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
1354 @ <pre>
1355 @ %h(blob_str(&versionInfo))
1356 @ </pre>
1357 style_finish_page();
1358 }
1359
+3 -2
--- src/main.mk
+++ src/main.mk
@@ -614,14 +614,15 @@
614614
# the run to just those test cases.
615615
#
616616
test: $(OBJDIR) $(APPNAME)
617617
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
618618
619
-$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(OBJDIR)/mkversion $(OBJDIR)/phony.h
619
+$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr $(OBJDIR)/mkversion $(OBJDIR)/phony.h
620620
$(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid \
621621
$(SRCDIR)/../manifest \
622
- $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
622
+ $(SRCDIR)/../VERSION \
623
+ $(SRCDIR)/../manifest.descr >$(OBJDIR)/VERSION.h
623624
624625
$(OBJDIR)/phony.h:
625626
# Force rebuild of VERSION.h every time we run "make"
626627
627628
# Setup the options used to compile the included SQLite library.
628629
--- src/main.mk
+++ src/main.mk
@@ -614,14 +614,15 @@
614 # the run to just those test cases.
615 #
616 test: $(OBJDIR) $(APPNAME)
617 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
618
619 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(OBJDIR)/mkversion $(OBJDIR)/phony.h
620 $(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid \
621 $(SRCDIR)/../manifest \
622 $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
 
623
624 $(OBJDIR)/phony.h:
625 # Force rebuild of VERSION.h every time we run "make"
626
627 # Setup the options used to compile the included SQLite library.
628
--- src/main.mk
+++ src/main.mk
@@ -614,14 +614,15 @@
614 # the run to just those test cases.
615 #
616 test: $(OBJDIR) $(APPNAME)
617 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
618
619 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr $(OBJDIR)/mkversion $(OBJDIR)/phony.h
620 $(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid \
621 $(SRCDIR)/../manifest \
622 $(SRCDIR)/../VERSION \
623 $(SRCDIR)/../manifest.descr >$(OBJDIR)/VERSION.h
624
625 $(OBJDIR)/phony.h:
626 # Force rebuild of VERSION.h every time we run "make"
627
628 # Setup the options used to compile the included SQLite library.
629
+22 -2
--- src/tar.c
+++ src/tar.c
@@ -516,12 +516,16 @@
516516
if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
517517
&& !glob_match(pExclude, "manifest.tags")
518518
&& (flg & MFESTFLG_TAGS) ){
519519
eflg |= MFESTFLG_TAGS;
520520
}
521
-
522
- if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
521
+ if( (pInclude==0 || glob_match(pInclude, "manifest.descr"))
522
+ && !glob_match(pExclude, "manifest.descr")
523
+ && (flg & MFESTFLG_DESCR) ){
524
+ eflg |= MFESTFLG_DESCR;
525
+ }
526
+ if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID|MFESTFLG_DESCR) ){
523527
if( eflg & MFESTFLG_RAW ){
524528
blob_append(&filename, "manifest", -1);
525529
zName = blob_str(&filename);
526530
if( listFlag ) fossil_print("%s\n", zName);
527531
if( pTar ){
@@ -550,10 +554,26 @@
550554
blob_zero(&tagslist);
551555
get_checkin_taglist(rid, &tagslist);
552556
tar_add_file(zName, &tagslist, 0, mTime);
553557
blob_reset(&tagslist);
554558
}
559
+ }
560
+ if( eflg & MFESTFLG_DESCR ){
561
+ blob_resize(&filename, nPrefix);
562
+ blob_append(&filename, "manifest.descr", -1);
563
+ zName = blob_str(&filename);
564
+ if( listFlag ) fossil_print("%s\n", zName);
565
+ if( pTar ){
566
+ CommitDescr cd;
567
+ Blob descr;
568
+ blob_zero(&descr);
569
+ describe_commit(rid_to_uuid(rid), "version*", &cd);
570
+ blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
571
+ cd.nCommitsSince, cd.zCommitHash);
572
+ tar_add_file(zName, &descr, 0, mTime);
573
+ blob_reset(&descr);
574
+ }
555575
}
556576
}
557577
manifest_file_rewind(pManifest);
558578
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
559579
int fid;
560580
--- src/tar.c
+++ src/tar.c
@@ -516,12 +516,16 @@
516 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
517 && !glob_match(pExclude, "manifest.tags")
518 && (flg & MFESTFLG_TAGS) ){
519 eflg |= MFESTFLG_TAGS;
520 }
521
522 if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
 
 
 
 
523 if( eflg & MFESTFLG_RAW ){
524 blob_append(&filename, "manifest", -1);
525 zName = blob_str(&filename);
526 if( listFlag ) fossil_print("%s\n", zName);
527 if( pTar ){
@@ -550,10 +554,26 @@
550 blob_zero(&tagslist);
551 get_checkin_taglist(rid, &tagslist);
552 tar_add_file(zName, &tagslist, 0, mTime);
553 blob_reset(&tagslist);
554 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555 }
556 }
557 manifest_file_rewind(pManifest);
558 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
559 int fid;
560
--- src/tar.c
+++ src/tar.c
@@ -516,12 +516,16 @@
516 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
517 && !glob_match(pExclude, "manifest.tags")
518 && (flg & MFESTFLG_TAGS) ){
519 eflg |= MFESTFLG_TAGS;
520 }
521 if( (pInclude==0 || glob_match(pInclude, "manifest.descr"))
522 && !glob_match(pExclude, "manifest.descr")
523 && (flg & MFESTFLG_DESCR) ){
524 eflg |= MFESTFLG_DESCR;
525 }
526 if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID|MFESTFLG_DESCR) ){
527 if( eflg & MFESTFLG_RAW ){
528 blob_append(&filename, "manifest", -1);
529 zName = blob_str(&filename);
530 if( listFlag ) fossil_print("%s\n", zName);
531 if( pTar ){
@@ -550,10 +554,26 @@
554 blob_zero(&tagslist);
555 get_checkin_taglist(rid, &tagslist);
556 tar_add_file(zName, &tagslist, 0, mTime);
557 blob_reset(&tagslist);
558 }
559 }
560 if( eflg & MFESTFLG_DESCR ){
561 blob_resize(&filename, nPrefix);
562 blob_append(&filename, "manifest.descr", -1);
563 zName = blob_str(&filename);
564 if( listFlag ) fossil_print("%s\n", zName);
565 if( pTar ){
566 CommitDescr cd;
567 Blob descr;
568 blob_zero(&descr);
569 describe_commit(rid_to_uuid(rid), "version*", &cd);
570 blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
571 cd.nCommitsSince, cd.zCommitHash);
572 tar_add_file(zName, &descr, 0, mTime);
573 blob_reset(&descr);
574 }
575 }
576 }
577 manifest_file_rewind(pManifest);
578 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
579 int fid;
580
+1 -1
--- src/update.c
+++ src/update.c
@@ -626,12 +626,12 @@
626626
fossil_free(zPwd);
627627
if( g.argc<=3 ){
628628
/* All files updated. Shift the current checkout to the target. */
629629
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
630630
checkout_set_all_exe(tid);
631
- manifest_to_disk(tid);
632631
db_set_checkout(tid);
632
+ manifest_to_disk(tid);
633633
}else{
634634
/* A subset of files have been checked out. Keep the current
635635
** checkout unchanged. */
636636
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
637637
}
638638
--- src/update.c
+++ src/update.c
@@ -626,12 +626,12 @@
626 fossil_free(zPwd);
627 if( g.argc<=3 ){
628 /* All files updated. Shift the current checkout to the target. */
629 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
630 checkout_set_all_exe(tid);
631 manifest_to_disk(tid);
632 db_set_checkout(tid);
 
633 }else{
634 /* A subset of files have been checked out. Keep the current
635 ** checkout unchanged. */
636 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
637 }
638
--- src/update.c
+++ src/update.c
@@ -626,12 +626,12 @@
626 fossil_free(zPwd);
627 if( g.argc<=3 ){
628 /* All files updated. Shift the current checkout to the target. */
629 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
630 checkout_set_all_exe(tid);
 
631 db_set_checkout(tid);
632 manifest_to_disk(tid);
633 }else{
634 /* A subset of files have been checked out. Keep the current
635 ** checkout unchanged. */
636 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
637 }
638
+22 -1
--- src/zip.c
+++ src/zip.c
@@ -670,11 +670,15 @@
670670
if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
671671
&& !glob_match(pExclude, "manifest.tags")
672672
&& (flg & MFESTFLG_TAGS) ){
673673
eflg |= MFESTFLG_TAGS;
674674
}
675
-
675
+ if( (pInclude==0 || glob_match(pInclude, "manifest.descr"))
676
+ && !glob_match(pExclude, "manifest.descr")
677
+ && (flg & MFESTFLG_DESCR) ){
678
+ eflg |= MFESTFLG_DESCR;
679
+ }
676680
if( eflg & MFESTFLG_RAW ){
677681
blob_append(&filename, "manifest", -1);
678682
zName = blob_str(&filename);
679683
if( listFlag ) fossil_print("%s\n", zName);
680684
if( pZip ){
@@ -704,10 +708,27 @@
704708
get_checkin_taglist(rid, &tagslist);
705709
zip_add_folders(&sArchive, zName);
706710
zip_add_file(&sArchive, zName, &tagslist, 0);
707711
blob_reset(&tagslist);
708712
}
713
+ }
714
+ if( eflg & MFESTFLG_DESCR ){
715
+ blob_resize(&filename, nPrefix);
716
+ blob_append(&filename, "manifest.descr", -1);
717
+ zName = blob_str(&filename);
718
+ if( listFlag ) fossil_print("%s\n", zName);
719
+ if( pZip ){
720
+ CommitDescr cd;
721
+ Blob descr;
722
+ blob_zero(&descr);
723
+ describe_commit(rid_to_uuid(rid), "version*", &cd);
724
+ blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
725
+ cd.nCommitsSince, cd.zCommitHash);
726
+ zip_add_folders(&sArchive, zName);
727
+ zip_add_file(&sArchive, zName, &descr, 0);
728
+ blob_reset(&descr);
729
+ }
709730
}
710731
}
711732
manifest_file_rewind(pManifest);
712733
if( pZip ) zip_add_file(&sArchive, "", 0, 0);
713734
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
714735
--- src/zip.c
+++ src/zip.c
@@ -670,11 +670,15 @@
670 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
671 && !glob_match(pExclude, "manifest.tags")
672 && (flg & MFESTFLG_TAGS) ){
673 eflg |= MFESTFLG_TAGS;
674 }
675
 
 
 
 
676 if( eflg & MFESTFLG_RAW ){
677 blob_append(&filename, "manifest", -1);
678 zName = blob_str(&filename);
679 if( listFlag ) fossil_print("%s\n", zName);
680 if( pZip ){
@@ -704,10 +708,27 @@
704 get_checkin_taglist(rid, &tagslist);
705 zip_add_folders(&sArchive, zName);
706 zip_add_file(&sArchive, zName, &tagslist, 0);
707 blob_reset(&tagslist);
708 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709 }
710 }
711 manifest_file_rewind(pManifest);
712 if( pZip ) zip_add_file(&sArchive, "", 0, 0);
713 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
714
--- src/zip.c
+++ src/zip.c
@@ -670,11 +670,15 @@
670 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
671 && !glob_match(pExclude, "manifest.tags")
672 && (flg & MFESTFLG_TAGS) ){
673 eflg |= MFESTFLG_TAGS;
674 }
675 if( (pInclude==0 || glob_match(pInclude, "manifest.descr"))
676 && !glob_match(pExclude, "manifest.descr")
677 && (flg & MFESTFLG_DESCR) ){
678 eflg |= MFESTFLG_DESCR;
679 }
680 if( eflg & MFESTFLG_RAW ){
681 blob_append(&filename, "manifest", -1);
682 zName = blob_str(&filename);
683 if( listFlag ) fossil_print("%s\n", zName);
684 if( pZip ){
@@ -704,10 +708,27 @@
708 get_checkin_taglist(rid, &tagslist);
709 zip_add_folders(&sArchive, zName);
710 zip_add_file(&sArchive, zName, &tagslist, 0);
711 blob_reset(&tagslist);
712 }
713 }
714 if( eflg & MFESTFLG_DESCR ){
715 blob_resize(&filename, nPrefix);
716 blob_append(&filename, "manifest.descr", -1);
717 zName = blob_str(&filename);
718 if( listFlag ) fossil_print("%s\n", zName);
719 if( pZip ){
720 CommitDescr cd;
721 Blob descr;
722 blob_zero(&descr);
723 describe_commit(rid_to_uuid(rid), "version*", &cd);
724 blob_appendf(&descr, "%s-%d-%10.10s\n", cd.zRelTagname,
725 cd.nCommitsSince, cd.zCommitHash);
726 zip_add_folders(&sArchive, zName);
727 zip_add_file(&sArchive, zName, &descr, 0);
728 blob_reset(&descr);
729 }
730 }
731 }
732 manifest_file_rewind(pManifest);
733 if( pZip ) zip_add_file(&sArchive, "", 0, 0);
734 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
735
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -401,14 +401,15 @@
401401
# the run to just those test cases.
402402
#
403403
test: $(OBJDIR) $(APPNAME)
404404
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
405405
406
-$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(OBJDIR)/mkversion $(OBJDIR)/phony.h
406
+$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr $(OBJDIR)/mkversion $(OBJDIR)/phony.h
407407
$(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid <<<NEXT_LINE>>>
408408
$(SRCDIR)/../manifest <<<NEXT_LINE>>>
409
- $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
409
+ $(SRCDIR)/../VERSION <<<NEXT_LINE>>>
410
+ $(SRCDIR)/../manifest.descr >$(OBJDIR)/VERSION.h
410411
411412
$(OBJDIR)/phony.h:
412413
# Force rebuild of VERSION.h every time we run "make"
413414
414415
# Setup the options used to compile the included SQLite library.
@@ -1087,12 +1088,12 @@
10871088
# build is done from, i.e. the checkout belongs to. Do not sync/push
10881089
# the repository after running the tests.
10891090
test: $(OBJDIR) $(APPNAME)
10901091
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
10911092
1092
-$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1093
- $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1093
+$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1094
+ $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
10941095
10951096
$(OBJDIR)/phony.h:
10961097
# Force rebuild of VERSION.h every time "make" is run
10971098
10981099
# The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
@@ -1392,11 +1393,11 @@
13921393
$(TCC) -o$@ -c $**
13931394
13941395
$(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
13951396
cp $@ $@
13961397
1397
-VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
1398
+VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION $B\manifest.descr
13981399
+$** > $@
13991400
14001401
page_index.h: mkindex$E $(SRC)
14011402
+$** > $@
14021403
@@ -1950,12 +1951,12 @@
19501951
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
19511952
19521953
"$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
19531954
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
19541955
1955
-"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1956
- "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1956
+"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" "$(B)\phony.h"
1957
+ "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" > $@
19571958
19581959
"$(B)\phony.h" :
19591960
rem Force rebuild of VERSION.h whenever nmake is run
19601961
19611962
"$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
19621963
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -401,14 +401,15 @@
401 # the run to just those test cases.
402 #
403 test: $(OBJDIR) $(APPNAME)
404 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
405
406 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(OBJDIR)/mkversion $(OBJDIR)/phony.h
407 $(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid <<<NEXT_LINE>>>
408 $(SRCDIR)/../manifest <<<NEXT_LINE>>>
409 $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
 
410
411 $(OBJDIR)/phony.h:
412 # Force rebuild of VERSION.h every time we run "make"
413
414 # Setup the options used to compile the included SQLite library.
@@ -1087,12 +1088,12 @@
1087 # build is done from, i.e. the checkout belongs to. Do not sync/push
1088 # the repository after running the tests.
1089 test: $(OBJDIR) $(APPNAME)
1090 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1091
1092 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1093 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1094
1095 $(OBJDIR)/phony.h:
1096 # Force rebuild of VERSION.h every time "make" is run
1097
1098 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
@@ -1392,11 +1393,11 @@
1392 $(TCC) -o$@ -c $**
1393
1394 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
1395 cp $@ $@
1396
1397 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
1398 +$** > $@
1399
1400 page_index.h: mkindex$E $(SRC)
1401 +$** > $@
1402
@@ -1950,12 +1951,12 @@
1950 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1951
1952 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1953 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1954
1955 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1956 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1957
1958 "$(B)\phony.h" :
1959 rem Force rebuild of VERSION.h whenever nmake is run
1960
1961 "$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
1962
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -401,14 +401,15 @@
401 # the run to just those test cases.
402 #
403 test: $(OBJDIR) $(APPNAME)
404 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) $(TESTFLAGS)
405
406 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr $(OBJDIR)/mkversion $(OBJDIR)/phony.h
407 $(OBJDIR)/mkversion $(SRCDIR)/../manifest.uuid <<<NEXT_LINE>>>
408 $(SRCDIR)/../manifest <<<NEXT_LINE>>>
409 $(SRCDIR)/../VERSION <<<NEXT_LINE>>>
410 $(SRCDIR)/../manifest.descr >$(OBJDIR)/VERSION.h
411
412 $(OBJDIR)/phony.h:
413 # Force rebuild of VERSION.h every time we run "make"
414
415 # Setup the options used to compile the included SQLite library.
@@ -1087,12 +1088,12 @@
1088 # build is done from, i.e. the checkout belongs to. Do not sync/push
1089 # the repository after running the tests.
1090 test: $(OBJDIR) $(APPNAME)
1091 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1092
1093 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1094 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
1095
1096 $(OBJDIR)/phony.h:
1097 # Force rebuild of VERSION.h every time "make" is run
1098
1099 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
@@ -1392,11 +1393,11 @@
1393 $(TCC) -o$@ -c $**
1394
1395 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
1396 cp $@ $@
1397
1398 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION $B\manifest.descr
1399 +$** > $@
1400
1401 page_index.h: mkindex$E $(SRC)
1402 +$** > $@
1403
@@ -1950,12 +1951,12 @@
1951 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1952
1953 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1954 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1955
1956 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" "$(B)\phony.h"
1957 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" > $@
1958
1959 "$(B)\phony.h" :
1960 rem Force rebuild of VERSION.h whenever nmake is run
1961
1962 "$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
1963
--- tools/mkversion.c
+++ tools/mkversion.c
@@ -1,21 +1,26 @@
11
/*
22
** This C program generates the "VERSION.h" header file from information
3
-** extracted out of the "manifest", "manifest.uuid", and "VERSION" files.
4
-** Call this program with three arguments:
3
+** extracted out of the "manifest", "manifest.uuid", "VERSION", and
4
+** optionally "manifest.descr" files.
5
+** Call this program with three or four arguments:
56
**
6
-** ./a.out manifest.uuid manifest VERSION
7
+** ./a.out manifest.uuid manifest VERSION ?manifest.descr?
78
**
8
-** Note that the manifest.uuid and manifest files are generated by Fossil.
9
+** Note that the manifest.uuid, manifest, and manifest.descr files are
10
+** generated by Fossil.
911
**
1012
** The output becomes the "VERSION.h" file. The output is a C-language
1113
** header that contains #defines for various properties of the build:
1214
**
1315
** MANIFEST_UUID These values are text strings that
1416
** MANIFEST_VERSION identify the Fossil check-in to which
1517
** the source tree belongs. They do not
1618
** take into account any uncommitted edits.
19
+** MANIFEST_DESCRIPTION This value gives a description relative to
20
+** the youngest tagged ancestor and takes into
21
+** account possilbe uncommitted edits.
1722
**
1823
** FOSSIL_BUILD_HASH A hexadecimal string that is a strong hash
1924
** of the MANIFEST_UUID together with the
2025
** current time of the build. We normally want
2126
** this to be different on each build, as the
@@ -26,10 +31,11 @@
2631
**
2732
** MANIFEST_DATE The date/time of the source-code check-in
2833
** MANIFEST_YEAR in various formats.
2934
** MANIFEST_NUMERIC_DATE
3035
** MANIFEST_NUMERIC_TIME
36
+** DESCRIPTION_DATE
3137
**
3238
** RELEASE_VERSION The version number (from the VERSION source
3339
** RELEASE_VERSION_NUMBER file) in various format.
3440
** RELEASE_RESOURCE_VERSION
3541
**
@@ -93,12 +99,12 @@
9399
int j = 0, x = 0, d = 0;
94100
size_t n;
95101
int vn[3];
96102
char b[1000];
97103
char vx[1000];
98
- if( argc!=4 ){
99
- fprintf(stderr, "Usage: %s manifest.uuid manifest VERSION\n", argv[0]);
104
+ if( argc!=4 && argc!=5 ){
105
+ fprintf(stderr, "Usage: %s manifest.uuid manifest VERSION [manifest.descr]\n", argv[0]);
100106
exit(1);
101107
}
102108
memset(b,0,sizeof(b));
103109
memset(vx,0,sizeof(vx));
104110
u = open_for_reading(argv[1]);
@@ -190,10 +196,28 @@
190196
}
191197
}
192198
printf("#define RELEASE_RESOURCE_VERSION %s", vx);
193199
while( d<3 ){ printf(",0"); d++; }
194200
printf("\n");
201
+ FILE *dd = fopen(argv[4], "r");
202
+ if( dd!=0 ){
203
+ if( fgets(b, sizeof(b)-1,dd) ){
204
+ for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
205
+ *z = 0;
206
+ printf("#define MANIFEST_DESCRIPTION \"[%s]\"\n",b);
207
+ if( strstr(b, "dirty") ){
208
+ /* If dirty, use current time. Another option would be
209
+ to use the latest mtime among the modified files. */
210
+ time_t now = time(0);
211
+ struct tm* tm_now = gmtime(&now);
212
+ char zNow[20];
213
+ strftime(zNow, sizeof(zNow), "%Y-%m-%d %H:%M:%S", tm_now);
214
+ printf("#define DESCRIPTION_DATE \"%s\"\n", zNow);
215
+ }
216
+ }
217
+ fclose(dd);
218
+ }
195219
#if defined(__DMC__) /* e.g. 0x857 */
196220
d = (__DMC__ & 0xF00) >> 8; /* major */
197221
x = (__DMC__ & 0x0F0) >> 4; /* minor */
198222
i = (__DMC__ & 0x00F); /* revision */
199223
printf("#define COMPILER_VERSION \"%d.%d.%d\"\n", d, x, i);
200224
--- tools/mkversion.c
+++ tools/mkversion.c
@@ -1,21 +1,26 @@
1 /*
2 ** This C program generates the "VERSION.h" header file from information
3 ** extracted out of the "manifest", "manifest.uuid", and "VERSION" files.
4 ** Call this program with three arguments:
 
5 **
6 ** ./a.out manifest.uuid manifest VERSION
7 **
8 ** Note that the manifest.uuid and manifest files are generated by Fossil.
 
9 **
10 ** The output becomes the "VERSION.h" file. The output is a C-language
11 ** header that contains #defines for various properties of the build:
12 **
13 ** MANIFEST_UUID These values are text strings that
14 ** MANIFEST_VERSION identify the Fossil check-in to which
15 ** the source tree belongs. They do not
16 ** take into account any uncommitted edits.
 
 
 
17 **
18 ** FOSSIL_BUILD_HASH A hexadecimal string that is a strong hash
19 ** of the MANIFEST_UUID together with the
20 ** current time of the build. We normally want
21 ** this to be different on each build, as the
@@ -26,10 +31,11 @@
26 **
27 ** MANIFEST_DATE The date/time of the source-code check-in
28 ** MANIFEST_YEAR in various formats.
29 ** MANIFEST_NUMERIC_DATE
30 ** MANIFEST_NUMERIC_TIME
 
31 **
32 ** RELEASE_VERSION The version number (from the VERSION source
33 ** RELEASE_VERSION_NUMBER file) in various format.
34 ** RELEASE_RESOURCE_VERSION
35 **
@@ -93,12 +99,12 @@
93 int j = 0, x = 0, d = 0;
94 size_t n;
95 int vn[3];
96 char b[1000];
97 char vx[1000];
98 if( argc!=4 ){
99 fprintf(stderr, "Usage: %s manifest.uuid manifest VERSION\n", argv[0]);
100 exit(1);
101 }
102 memset(b,0,sizeof(b));
103 memset(vx,0,sizeof(vx));
104 u = open_for_reading(argv[1]);
@@ -190,10 +196,28 @@
190 }
191 }
192 printf("#define RELEASE_RESOURCE_VERSION %s", vx);
193 while( d<3 ){ printf(",0"); d++; }
194 printf("\n");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195 #if defined(__DMC__) /* e.g. 0x857 */
196 d = (__DMC__ & 0xF00) >> 8; /* major */
197 x = (__DMC__ & 0x0F0) >> 4; /* minor */
198 i = (__DMC__ & 0x00F); /* revision */
199 printf("#define COMPILER_VERSION \"%d.%d.%d\"\n", d, x, i);
200
--- tools/mkversion.c
+++ tools/mkversion.c
@@ -1,21 +1,26 @@
1 /*
2 ** This C program generates the "VERSION.h" header file from information
3 ** extracted out of the "manifest", "manifest.uuid", "VERSION", and
4 ** optionally "manifest.descr" files.
5 ** Call this program with three or four arguments:
6 **
7 ** ./a.out manifest.uuid manifest VERSION ?manifest.descr?
8 **
9 ** Note that the manifest.uuid, manifest, and manifest.descr files are
10 ** generated by Fossil.
11 **
12 ** The output becomes the "VERSION.h" file. The output is a C-language
13 ** header that contains #defines for various properties of the build:
14 **
15 ** MANIFEST_UUID These values are text strings that
16 ** MANIFEST_VERSION identify the Fossil check-in to which
17 ** the source tree belongs. They do not
18 ** take into account any uncommitted edits.
19 ** MANIFEST_DESCRIPTION This value gives a description relative to
20 ** the youngest tagged ancestor and takes into
21 ** account possilbe uncommitted edits.
22 **
23 ** FOSSIL_BUILD_HASH A hexadecimal string that is a strong hash
24 ** of the MANIFEST_UUID together with the
25 ** current time of the build. We normally want
26 ** this to be different on each build, as the
@@ -26,10 +31,11 @@
31 **
32 ** MANIFEST_DATE The date/time of the source-code check-in
33 ** MANIFEST_YEAR in various formats.
34 ** MANIFEST_NUMERIC_DATE
35 ** MANIFEST_NUMERIC_TIME
36 ** DESCRIPTION_DATE
37 **
38 ** RELEASE_VERSION The version number (from the VERSION source
39 ** RELEASE_VERSION_NUMBER file) in various format.
40 ** RELEASE_RESOURCE_VERSION
41 **
@@ -93,12 +99,12 @@
99 int j = 0, x = 0, d = 0;
100 size_t n;
101 int vn[3];
102 char b[1000];
103 char vx[1000];
104 if( argc!=4 && argc!=5 ){
105 fprintf(stderr, "Usage: %s manifest.uuid manifest VERSION [manifest.descr]\n", argv[0]);
106 exit(1);
107 }
108 memset(b,0,sizeof(b));
109 memset(vx,0,sizeof(vx));
110 u = open_for_reading(argv[1]);
@@ -190,10 +196,28 @@
196 }
197 }
198 printf("#define RELEASE_RESOURCE_VERSION %s", vx);
199 while( d<3 ){ printf(",0"); d++; }
200 printf("\n");
201 FILE *dd = fopen(argv[4], "r");
202 if( dd!=0 ){
203 if( fgets(b, sizeof(b)-1,dd) ){
204 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
205 *z = 0;
206 printf("#define MANIFEST_DESCRIPTION \"[%s]\"\n",b);
207 if( strstr(b, "dirty") ){
208 /* If dirty, use current time. Another option would be
209 to use the latest mtime among the modified files. */
210 time_t now = time(0);
211 struct tm* tm_now = gmtime(&now);
212 char zNow[20];
213 strftime(zNow, sizeof(zNow), "%Y-%m-%d %H:%M:%S", tm_now);
214 printf("#define DESCRIPTION_DATE \"%s\"\n", zNow);
215 }
216 }
217 fclose(dd);
218 }
219 #if defined(__DMC__) /* e.g. 0x857 */
220 d = (__DMC__ & 0xF00) >> 8; /* major */
221 x = (__DMC__ & 0x0F0) >> 4; /* minor */
222 i = (__DMC__ & 0x00F); /* revision */
223 printf("#define COMPILER_VERSION \"%d.%d.%d\"\n", d, x, i);
224
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -91,11 +91,11 @@
9191
$(TCC) -o$@ -c $**
9292
9393
$(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
9494
cp $@ $@
9595
96
-VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
96
+VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION $B\manifest.descr
9797
+$** > $@
9898
9999
page_index.h: mkindex$E $(SRC)
100100
+$** > $@
101101
102102
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -91,11 +91,11 @@
91 $(TCC) -o$@ -c $**
92
93 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
94 cp $@ $@
95
96 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
97 +$** > $@
98
99 page_index.h: mkindex$E $(SRC)
100 +$** > $@
101
102
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -91,11 +91,11 @@
91 $(TCC) -o$@ -c $**
92
93 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR_extsrc)\cson_amalgamation.h
94 cp $@ $@
95
96 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION $B\manifest.descr
97 +$** > $@
98
99 page_index.h: mkindex$E $(SRC)
100 +$** > $@
101
102
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1049,12 +1049,12 @@
10491049
# build is done from, i.e. the checkout belongs to. Do not sync/push
10501050
# the repository after running the tests.
10511051
test: $(OBJDIR) $(APPNAME)
10521052
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
10531053
1054
-$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1055
- $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1054
+$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1055
+ $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
10561056
10571057
$(OBJDIR)/phony.h:
10581058
# Force rebuild of VERSION.h every time "make" is run
10591059
10601060
# The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
10611061
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1049,12 +1049,12 @@
1049 # build is done from, i.e. the checkout belongs to. Do not sync/push
1050 # the repository after running the tests.
1051 test: $(OBJDIR) $(APPNAME)
1052 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1053
1054 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1055 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1056
1057 $(OBJDIR)/phony.h:
1058 # Force rebuild of VERSION.h every time "make" is run
1059
1060 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
1061
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1049,12 +1049,12 @@
1049 # build is done from, i.e. the checkout belongs to. Do not sync/push
1050 # the repository after running the tests.
1051 test: $(OBJDIR) $(APPNAME)
1052 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1053
1054 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1055 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
1056
1057 $(OBJDIR)/phony.h:
1058 # Force rebuild of VERSION.h every time "make" is run
1059
1060 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
1061
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1049,12 +1049,12 @@
10491049
# build is done from, i.e. the checkout belongs to. Do not sync/push
10501050
# the repository after running the tests.
10511051
test: $(OBJDIR) $(APPNAME)
10521052
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
10531053
1054
-$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1055
- $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1054
+$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1055
+ $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
10561056
10571057
$(OBJDIR)/phony.h:
10581058
# Force rebuild of VERSION.h every time "make" is run
10591059
10601060
# The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
10611061
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1049,12 +1049,12 @@
1049 # build is done from, i.e. the checkout belongs to. Do not sync/push
1050 # the repository after running the tests.
1051 test: $(OBJDIR) $(APPNAME)
1052 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1053
1054 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(OBJDIR)/phony.h
1055 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$@
1056
1057 $(OBJDIR)/phony.h:
1058 # Force rebuild of VERSION.h every time "make" is run
1059
1060 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
1061
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1049,12 +1049,12 @@
1049 # build is done from, i.e. the checkout belongs to. Do not sync/push
1050 # the repository after running the tests.
1051 test: $(OBJDIR) $(APPNAME)
1052 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
1053
1054 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(MKVERSION) $(SRCDIR)/../manifest.descr $(OBJDIR)/phony.h
1055 $(MKVERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION $(SRCDIR)/../manifest.descr >$@
1056
1057 $(OBJDIR)/phony.h:
1058 # Force rebuild of VERSION.h every time "make" is run
1059
1060 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
1061
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -1062,12 +1062,12 @@
10621062
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
10631063
10641064
"$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
10651065
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
10661066
1067
-"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1068
- "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1067
+"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" "$(B)\phony.h"
1068
+ "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" > $@
10691069
10701070
"$(B)\phony.h" :
10711071
rem Force rebuild of VERSION.h whenever nmake is run
10721072
10731073
"$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
10741074
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -1062,12 +1062,12 @@
1062 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1063
1064 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1065 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1066
1067 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1068 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1069
1070 "$(B)\phony.h" :
1071 rem Force rebuild of VERSION.h whenever nmake is run
1072
1073 "$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
1074
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -1062,12 +1062,12 @@
1062 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1063
1064 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1065 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1066
1067 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" "$(B)\phony.h"
1068 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\manifest.descr" > $@
1069
1070 "$(B)\phony.h" :
1071 rem Force rebuild of VERSION.h whenever nmake is run
1072
1073 "$(OX)\cson_amalgamation$O" : "$(SRCDIR_extsrc)\cson_amalgamation.c"
1074

Keyboard Shortcuts

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