Fossil SCM

New information about the git export shown by "fossil git status".

drh 2019-04-22 15:22 trunk
Commit a0a5be0e976c77cbcf86db31aaad4c3d797794f92b15e12f18ac6a68921f6bce
1 file changed +15
+15
--- src/export.c
+++ src/export.c
@@ -1528,10 +1528,11 @@
15281528
** Show the status of a "git export".
15291529
*/
15301530
void gitmirror_status_command(void){
15311531
char *zMirror;
15321532
char *z;
1533
+ int n, k;
15331534
db_find_and_open_repository(0, 0);
15341535
verify_all_options();
15351536
zMirror = db_get("last-git-export-repo", 0);
15361537
if( zMirror==0 ){
15371538
fossil_print("Git mirror: none\n");
@@ -1549,10 +1550,24 @@
15491550
}else{
15501551
UrlData url;
15511552
url_parse_local(z, 0, &url);
15521553
fossil_print("Autopush: %s\n", url.canonical);
15531554
}
1555
+ n = db_int(0,
1556
+ "SELECT count(*) FROM event"
1557
+ " WHERE type='ci'"
1558
+ " AND mtime>coalesce((SELECT value FROM mconfig"
1559
+ " WHERE key='start'),0.0)"
1560
+ );
1561
+ if( n==0 ){
1562
+ fossil_print("Status: up-to-date\n");
1563
+ }else{
1564
+ fossil_print("Status: %d check-ins awaiting export\n", n);
1565
+ }
1566
+ n = db_int(0, "SELECT count(*) FROM mmark WHERE isfile");
1567
+ k = db_int(0, "SELECT count(*) FROm mmark WHERE NOT isfile");
1568
+ fossil_print("Exported: %d check-ins and %d file blobs\n", k, n);
15541569
}
15551570
15561571
/*
15571572
** COMMAND: git
15581573
**
15591574
--- src/export.c
+++ src/export.c
@@ -1528,10 +1528,11 @@
1528 ** Show the status of a "git export".
1529 */
1530 void gitmirror_status_command(void){
1531 char *zMirror;
1532 char *z;
 
1533 db_find_and_open_repository(0, 0);
1534 verify_all_options();
1535 zMirror = db_get("last-git-export-repo", 0);
1536 if( zMirror==0 ){
1537 fossil_print("Git mirror: none\n");
@@ -1549,10 +1550,24 @@
1549 }else{
1550 UrlData url;
1551 url_parse_local(z, 0, &url);
1552 fossil_print("Autopush: %s\n", url.canonical);
1553 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1554 }
1555
1556 /*
1557 ** COMMAND: git
1558 **
1559
--- src/export.c
+++ src/export.c
@@ -1528,10 +1528,11 @@
1528 ** Show the status of a "git export".
1529 */
1530 void gitmirror_status_command(void){
1531 char *zMirror;
1532 char *z;
1533 int n, k;
1534 db_find_and_open_repository(0, 0);
1535 verify_all_options();
1536 zMirror = db_get("last-git-export-repo", 0);
1537 if( zMirror==0 ){
1538 fossil_print("Git mirror: none\n");
@@ -1549,10 +1550,24 @@
1550 }else{
1551 UrlData url;
1552 url_parse_local(z, 0, &url);
1553 fossil_print("Autopush: %s\n", url.canonical);
1554 }
1555 n = db_int(0,
1556 "SELECT count(*) FROM event"
1557 " WHERE type='ci'"
1558 " AND mtime>coalesce((SELECT value FROM mconfig"
1559 " WHERE key='start'),0.0)"
1560 );
1561 if( n==0 ){
1562 fossil_print("Status: up-to-date\n");
1563 }else{
1564 fossil_print("Status: %d check-ins awaiting export\n", n);
1565 }
1566 n = db_int(0, "SELECT count(*) FROM mmark WHERE isfile");
1567 k = db_int(0, "SELECT count(*) FROm mmark WHERE NOT isfile");
1568 fossil_print("Exported: %d check-ins and %d file blobs\n", k, n);
1569 }
1570
1571 /*
1572 ** COMMAND: git
1573 **
1574

Keyboard Shortcuts

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