Fossil SCM
More fixes to the synclog xfer protocol.
Commit
555e36595ff6d59142afda38ce1cc111f8a6e8836e1e48726b0f75391ece4149
Parent
3ef61c4782c47b3…
2 files changed
+5
-3
+1
-1
+5
-3
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1707,17 +1707,19 @@ | ||
| 1707 | 1707 | |
| 1708 | 1708 | /* Optionally do a "git push" */ |
| 1709 | 1709 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1710 | 1710 | if( zPushUrl ){ |
| 1711 | 1711 | char *zPushCmd; |
| 1712 | + const char *zUrl; | |
| 1712 | 1713 | UrlData url; |
| 1713 | 1714 | if( sqlite3_strglob("http*", zPushUrl)==0 ){ |
| 1714 | 1715 | url_parse_local(zPushUrl, 0, &url); |
| 1715 | - zPushCmd = mprintf("git push --mirror %s", url.canonical); | |
| 1716 | + zUrl = url.canonical; | |
| 1716 | 1717 | }else{ |
| 1717 | - zPushCmd = mprintf("git push --mirror %s", zPushUrl); | |
| 1718 | + zUrl = zPushUrl; | |
| 1718 | 1719 | } |
| 1720 | + zPushCmd = mprintf("git push --mirror %s", url.canonical); | |
| 1719 | 1721 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1720 | 1722 | fossil_free(zPushCmd); |
| 1721 | 1723 | zPushCmd = mprintf("git push --mirror %$", zPushUrl); |
| 1722 | 1724 | rc = fossil_system(zPushCmd); |
| 1723 | 1725 | if( rc ){ |
| @@ -1725,11 +1727,11 @@ | ||
| 1725 | 1727 | }else if( db_is_writeable("repository") ){ |
| 1726 | 1728 | db_unprotect(PROTECT_CONFIG); |
| 1727 | 1729 | db_multi_exec("REPLACE INTO config(name,value,mtime)" |
| 1728 | 1730 | "VALUES('gitpush:%q',1,now())", zPushUrl); |
| 1729 | 1731 | db_protect_pop(); |
| 1730 | - sync_log_entry("this", zPushUrl, 0, "git-push"); | |
| 1732 | + sync_log_entry("this", zUrl, 0, "git-push"); | |
| 1731 | 1733 | } |
| 1732 | 1734 | fossil_free(zPushCmd); |
| 1733 | 1735 | } |
| 1734 | 1736 | } |
| 1735 | 1737 | |
| 1736 | 1738 |
| --- 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 @@ | ||
| 1758 | 1758 | ){ |
| 1759 | 1759 | zClientUrl = 0; |
| 1760 | 1760 | } |
| 1761 | 1761 | } |
| 1762 | 1762 | db_prepare(&qSynclog, |
| 1763 | - "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog" | |
| 1763 | + "SELECT sfrom, sto, unixepoch(stime,'auto'), stype FROM synclog" | |
| 1764 | 1764 | ); |
| 1765 | 1765 | while( db_step(&qSynclog)==SQLITE_ROW ){ |
| 1766 | 1766 | const char *zFrom = db_column_text(&qSynclog,0); |
| 1767 | 1767 | const char *zTo = db_column_text(&qSynclog,1); |
| 1768 | 1768 | const char *zTime = db_column_text(&qSynclog,2); |
| 1769 | 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), 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 |