Fossil SCM

More fixes to the synclog xfer protocol.

drh 2021-12-20 10:17 synclog
Commit 555e36595ff6d59142afda38ce1cc111f8a6e8836e1e48726b0f75391ece4149
2 files changed +5 -3 +1 -1
+5 -3
--- src/export.c
+++ src/export.c
@@ -1707,17 +1707,19 @@
17071707
17081708
/* Optionally do a "git push" */
17091709
zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
17101710
if( zPushUrl ){
17111711
char *zPushCmd;
1712
+ const char *zUrl;
17121713
UrlData url;
17131714
if( sqlite3_strglob("http*", zPushUrl)==0 ){
17141715
url_parse_local(zPushUrl, 0, &url);
1715
- zPushCmd = mprintf("git push --mirror %s", url.canonical);
1716
+ zUrl = url.canonical;
17161717
}else{
1717
- zPushCmd = mprintf("git push --mirror %s", zPushUrl);
1718
+ zUrl = zPushUrl;
17181719
}
1720
+ zPushCmd = mprintf("git push --mirror %s", url.canonical);
17191721
gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
17201722
fossil_free(zPushCmd);
17211723
zPushCmd = mprintf("git push --mirror %$", zPushUrl);
17221724
rc = fossil_system(zPushCmd);
17231725
if( rc ){
@@ -1725,11 +1727,11 @@
17251727
}else if( db_is_writeable("repository") ){
17261728
db_unprotect(PROTECT_CONFIG);
17271729
db_multi_exec("REPLACE INTO config(name,value,mtime)"
17281730
"VALUES('gitpush:%q',1,now())", zPushUrl);
17291731
db_protect_pop();
1730
- sync_log_entry("this", zPushUrl, 0, "git-push");
1732
+ sync_log_entry("this", zUrl, 0, "git-push");
17311733
}
17321734
fossil_free(zPushCmd);
17331735
}
17341736
}
17351737
17361738
--- src/export.c
+++ src/export.c
@@ -1707,17 +1707,19 @@
1707
1708 /* Optionally do a "git push" */
1709 zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
1710 if( zPushUrl ){
1711 char *zPushCmd;
 
1712 UrlData url;
1713 if( sqlite3_strglob("http*", zPushUrl)==0 ){
1714 url_parse_local(zPushUrl, 0, &url);
1715 zPushCmd = mprintf("git push --mirror %s", url.canonical);
1716 }else{
1717 zPushCmd = mprintf("git push --mirror %s", zPushUrl);
1718 }
 
1719 gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
1720 fossil_free(zPushCmd);
1721 zPushCmd = mprintf("git push --mirror %$", zPushUrl);
1722 rc = fossil_system(zPushCmd);
1723 if( rc ){
@@ -1725,11 +1727,11 @@
1725 }else if( db_is_writeable("repository") ){
1726 db_unprotect(PROTECT_CONFIG);
1727 db_multi_exec("REPLACE INTO config(name,value,mtime)"
1728 "VALUES('gitpush:%q',1,now())", zPushUrl);
1729 db_protect_pop();
1730 sync_log_entry("this", zPushUrl, 0, "git-push");
1731 }
1732 fossil_free(zPushCmd);
1733 }
1734 }
1735
1736
--- src/export.c
+++ src/export.c
@@ -1707,17 +1707,19 @@
1707
1708 /* Optionally do a "git push" */
1709 zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
1710 if( zPushUrl ){
1711 char *zPushCmd;
1712 const char *zUrl;
1713 UrlData url;
1714 if( sqlite3_strglob("http*", zPushUrl)==0 ){
1715 url_parse_local(zPushUrl, 0, &url);
1716 zUrl = url.canonical;
1717 }else{
1718 zUrl = zPushUrl;
1719 }
1720 zPushCmd = mprintf("git push --mirror %s", url.canonical);
1721 gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
1722 fossil_free(zPushCmd);
1723 zPushCmd = mprintf("git push --mirror %$", zPushUrl);
1724 rc = fossil_system(zPushCmd);
1725 if( rc ){
@@ -1725,11 +1727,11 @@
1727 }else if( db_is_writeable("repository") ){
1728 db_unprotect(PROTECT_CONFIG);
1729 db_multi_exec("REPLACE INTO config(name,value,mtime)"
1730 "VALUES('gitpush:%q',1,now())", zPushUrl);
1731 db_protect_pop();
1732 sync_log_entry("this", zUrl, 0, "git-push");
1733 }
1734 fossil_free(zPushCmd);
1735 }
1736 }
1737
1738
+1 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1758,11 +1758,11 @@
17581758
){
17591759
zClientUrl = 0;
17601760
}
17611761
}
17621762
db_prepare(&qSynclog,
1763
- "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog"
1763
+ "SELECT sfrom, sto, unixepoch(stime,'auto'), stype FROM synclog"
17641764
);
17651765
while( db_step(&qSynclog)==SQLITE_ROW ){
17661766
const char *zFrom = db_column_text(&qSynclog,0);
17671767
const char *zTo = db_column_text(&qSynclog,1);
17681768
const char *zTime = db_column_text(&qSynclog,2);
17691769
--- src/xfer.c
+++ src/xfer.c
@@ -1758,11 +1758,11 @@
1758 ){
1759 zClientUrl = 0;
1760 }
1761 }
1762 db_prepare(&qSynclog,
1763 "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog"
1764 );
1765 while( db_step(&qSynclog)==SQLITE_ROW ){
1766 const char *zFrom = db_column_text(&qSynclog,0);
1767 const char *zTo = db_column_text(&qSynclog,1);
1768 const char *zTime = db_column_text(&qSynclog,2);
1769
--- src/xfer.c
+++ src/xfer.c
@@ -1758,11 +1758,11 @@
1758 ){
1759 zClientUrl = 0;
1760 }
1761 }
1762 db_prepare(&qSynclog,
1763 "SELECT sfrom, sto, unixepoch(stime,'auto'), stype FROM synclog"
1764 );
1765 while( db_step(&qSynclog)==SQLITE_ROW ){
1766 const char *zFrom = db_column_text(&qSynclog,0);
1767 const char *zTo = db_column_text(&qSynclog,1);
1768 const char *zTime = db_column_text(&qSynclog,2);
1769

Keyboard Shortcuts

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