Fossil SCM

Warn that unversioned content cannot be pushed when the server has sent "uv-pull-only" and any file is still queued to send. The warning was given only for files the server already held, never for new ones, which were left unsent without a word.

dmestas 2026-11-17 13:22 UTC small-fixes-2
Commit deee1bf4ca24e301032634f0bb8189f66e6dca50941a8cc81b460275408d8dea
1 file changed +24 -5
+24 -5
--- src/xfer.c
+++ src/xfer.c
@@ -2143,10 +2143,22 @@
21432143
** Floating-point absolute value
21442144
*/
21452145
static double fossil_fabs(double x){
21462146
return x>0.0 ? x : -x;
21472147
}
2148
+
2149
+/*
2150
+** Tell the user that unversioned content cannot be pushed because the
2151
+** server has sent the "uv-pull-only" pragma.
2152
+*/
2153
+static void uv_pull_only_warning(void){
2154
+ fossil_warning(
2155
+ "Warning: uv-pull-only \n"
2156
+ " Unable to push unversioned content because you lack\n"
2157
+ " sufficient permission on the server\n"
2158
+ );
2159
+}
21482160
21492161
/*
21502162
** Sync to the host identified in g.url.name and g.url.path. This
21512163
** routine is called by the client.
21522164
**
@@ -2776,15 +2788,11 @@
27762788
"UPDATE unversioned SET mtime=%lld WHERE name=%Q", mtime, zName
27772789
);
27782790
db_unset("uv-hash", 0);
27792791
}
27802792
if( iStatus>=4 && uvPullOnly==1 ){
2781
- fossil_warning(
2782
- "Warning: uv-pull-only \n"
2783
- " Unable to push unversioned content because you lack\n"
2784
- " sufficient permission on the server\n"
2785
- );
2793
+ uv_pull_only_warning();
27862794
uvPullOnly = 2;
27872795
}
27882796
if( iStatus<=3 || uvPullOnly ){
27892797
db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName);
27902798
}else if( iStatus==4 ){
@@ -3084,10 +3092,21 @@
30843092
}
30853093
}
30863094
nUncRcvd += blob_size(&recv);
30873095
blob_reset(&recv);
30883096
nCycle++;
3097
+
3098
+ /* A file that the server has never held is in no uvigot card, so the
3099
+ ** warning above is not given for it. Give it if anything is still
3100
+ ** queued to send to a server that takes no unversioned content. */
3101
+ if( uvPullOnly==1 && (syncFlags & SYNC_UV_REVERT)==0
3102
+ && db_exists("SELECT 1 FROM uv_tosend")
3103
+ ){
3104
+ uv_pull_only_warning();
3105
+ uvPullOnly = 2;
3106
+ db_multi_exec("DELETE FROM uv_tosend");
3107
+ }
30893108
30903109
/* Set go to 1 if we need to continue the sync/push/pull/clone for
30913110
** another round. Set go to 0 if it is time to quit. */
30923111
nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
30933112
if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
30943113
--- src/xfer.c
+++ src/xfer.c
@@ -2143,10 +2143,22 @@
2143 ** Floating-point absolute value
2144 */
2145 static double fossil_fabs(double x){
2146 return x>0.0 ? x : -x;
2147 }
 
 
 
 
 
 
 
 
 
 
 
 
2148
2149 /*
2150 ** Sync to the host identified in g.url.name and g.url.path. This
2151 ** routine is called by the client.
2152 **
@@ -2776,15 +2788,11 @@
2776 "UPDATE unversioned SET mtime=%lld WHERE name=%Q", mtime, zName
2777 );
2778 db_unset("uv-hash", 0);
2779 }
2780 if( iStatus>=4 && uvPullOnly==1 ){
2781 fossil_warning(
2782 "Warning: uv-pull-only \n"
2783 " Unable to push unversioned content because you lack\n"
2784 " sufficient permission on the server\n"
2785 );
2786 uvPullOnly = 2;
2787 }
2788 if( iStatus<=3 || uvPullOnly ){
2789 db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName);
2790 }else if( iStatus==4 ){
@@ -3084,10 +3092,21 @@
3084 }
3085 }
3086 nUncRcvd += blob_size(&recv);
3087 blob_reset(&recv);
3088 nCycle++;
 
 
 
 
 
 
 
 
 
 
 
3089
3090 /* Set go to 1 if we need to continue the sync/push/pull/clone for
3091 ** another round. Set go to 0 if it is time to quit. */
3092 nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
3093 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
3094
--- src/xfer.c
+++ src/xfer.c
@@ -2143,10 +2143,22 @@
2143 ** Floating-point absolute value
2144 */
2145 static double fossil_fabs(double x){
2146 return x>0.0 ? x : -x;
2147 }
2148
2149 /*
2150 ** Tell the user that unversioned content cannot be pushed because the
2151 ** server has sent the "uv-pull-only" pragma.
2152 */
2153 static void uv_pull_only_warning(void){
2154 fossil_warning(
2155 "Warning: uv-pull-only \n"
2156 " Unable to push unversioned content because you lack\n"
2157 " sufficient permission on the server\n"
2158 );
2159 }
2160
2161 /*
2162 ** Sync to the host identified in g.url.name and g.url.path. This
2163 ** routine is called by the client.
2164 **
@@ -2776,15 +2788,11 @@
2788 "UPDATE unversioned SET mtime=%lld WHERE name=%Q", mtime, zName
2789 );
2790 db_unset("uv-hash", 0);
2791 }
2792 if( iStatus>=4 && uvPullOnly==1 ){
2793 uv_pull_only_warning();
 
 
 
 
2794 uvPullOnly = 2;
2795 }
2796 if( iStatus<=3 || uvPullOnly ){
2797 db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName);
2798 }else if( iStatus==4 ){
@@ -3084,10 +3092,21 @@
3092 }
3093 }
3094 nUncRcvd += blob_size(&recv);
3095 blob_reset(&recv);
3096 nCycle++;
3097
3098 /* A file that the server has never held is in no uvigot card, so the
3099 ** warning above is not given for it. Give it if anything is still
3100 ** queued to send to a server that takes no unversioned content. */
3101 if( uvPullOnly==1 && (syncFlags & SYNC_UV_REVERT)==0
3102 && db_exists("SELECT 1 FROM uv_tosend")
3103 ){
3104 uv_pull_only_warning();
3105 uvPullOnly = 2;
3106 db_multi_exec("DELETE FROM uv_tosend");
3107 }
3108
3109 /* Set go to 1 if we need to continue the sync/push/pull/clone for
3110 ** another round. Set go to 0 if it is time to quit. */
3111 nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
3112 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
3113

Keyboard Shortcuts

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