Fossil SCM

Fix typos in the sync document. Make "uv" an alias for "unversioned". Prohibit unversioned filename that contain whitespace since the sync protocol cannot currently handle such files.

drh 2016-10-04 20:25 trunk
Commit 85f957c3e57b99b1408d6135a3dc0f0adebd5099
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190190
}
191191
return syncFlags;
192192
}
193193
194194
/*
195
+** Return true if the zName contains any whitespace
196
+*/
197
+static int contains_whitespace(const char *zName){
198
+ while( zName[0] ){
199
+ if( fossil_isspace(zName[0]) ) return 1;
200
+ zName++;
201
+ }
202
+ return 0;
203
+}
204
+
205
+/*
206
+** COMMAND: uv*
195207
** COMMAND: unversioned
196208
**
197209
** Usage: %fossil unversioned SUBCOMMAND ARGS...
210
+** or: %fossil uv SUBCOMMAND ARGS..
198211
**
199212
** Unversioned files (UV-files) are artifacts that are synced and are available
200213
** for download but which do not preserve history. Only the most recent version
201214
** of each UV-file is retained. Changes to an UV-file are permanent and cannot
202215
** be undone, so use appropriate caution with this command.
@@ -271,10 +284,13 @@
271284
for(i=3; i<g.argc; i++){
272285
zIn = zAs ? zAs : g.argv[i];
273286
if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
274287
fossil_fatal("'%Q' is not an acceptable filename", zIn);
275288
}
289
+ if( contains_whitespace(zIn) ){
290
+ fossil_fatal("names of unversioned files may not contain whitespace");
291
+ }
276292
blob_init(&file,0,0);
277293
blob_read_from_file(&file, g.argv[i]);
278294
unversioned_write(zIn, &file, mtime);
279295
blob_reset(&file);
280296
}
281297
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190 }
191 return syncFlags;
192 }
193
194 /*
 
 
 
 
 
 
 
 
 
 
 
 
195 ** COMMAND: unversioned
196 **
197 ** Usage: %fossil unversioned SUBCOMMAND ARGS...
 
198 **
199 ** Unversioned files (UV-files) are artifacts that are synced and are available
200 ** for download but which do not preserve history. Only the most recent version
201 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
202 ** be undone, so use appropriate caution with this command.
@@ -271,10 +284,13 @@
271 for(i=3; i<g.argc; i++){
272 zIn = zAs ? zAs : g.argv[i];
273 if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
274 fossil_fatal("'%Q' is not an acceptable filename", zIn);
275 }
 
 
 
276 blob_init(&file,0,0);
277 blob_read_from_file(&file, g.argv[i]);
278 unversioned_write(zIn, &file, mtime);
279 blob_reset(&file);
280 }
281
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190 }
191 return syncFlags;
192 }
193
194 /*
195 ** Return true if the zName contains any whitespace
196 */
197 static int contains_whitespace(const char *zName){
198 while( zName[0] ){
199 if( fossil_isspace(zName[0]) ) return 1;
200 zName++;
201 }
202 return 0;
203 }
204
205 /*
206 ** COMMAND: uv*
207 ** COMMAND: unversioned
208 **
209 ** Usage: %fossil unversioned SUBCOMMAND ARGS...
210 ** or: %fossil uv SUBCOMMAND ARGS..
211 **
212 ** Unversioned files (UV-files) are artifacts that are synced and are available
213 ** for download but which do not preserve history. Only the most recent version
214 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
215 ** be undone, so use appropriate caution with this command.
@@ -271,10 +284,13 @@
284 for(i=3; i<g.argc; i++){
285 zIn = zAs ? zAs : g.argv[i];
286 if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
287 fossil_fatal("'%Q' is not an acceptable filename", zIn);
288 }
289 if( contains_whitespace(zIn) ){
290 fossil_fatal("names of unversioned files may not contain whitespace");
291 }
292 blob_init(&file,0,0);
293 blob_read_from_file(&file, g.argv[i]);
294 unversioned_write(zIn, &file, mtime);
295 blob_reset(&file);
296 }
297
+3 -3
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220220
introduced to improve the speed of the transfer of content by sending the
221221
compressed artifact directly from the server database to the client.</p>
222222
223223
<p>Compressed File cards are similar to File cards, sharing the same
224224
in-line "payload" data characteristics and also the same treatment of
225
-direct content or delta content. It comes in two different formats
225
+direct content or delta content. Cfile cards come in two different formats
226226
depending on whether the artifact is sent directly or as a delta from
227227
some other artifact.</p>
228228
229229
<blockquote>
230230
<b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277277
for the unversioned file, or "<b>-</b>" for deleted content.
278278
The <i>size</i> field is the (uncompressed) size of the content
279279
in bytes. The <i>flags</i> field is an integer which is interpreted
280280
as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281281
the <i>content</i> is to be omitted. The content might be omitted if
282
-it is too large to transmit, or if the send merely wants to update the
282
+it is too large to transmit, or if the sender merely wants to update the
283283
modification time of the file without changing the files content.
284284
The <i>content</i> is the (uncompressed) content of the file.
285285
286286
<p>The receiver should only accept the uvfile card if the hash and
287287
size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398398
identified by the first argument is private on the sender and should
399399
be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400400
401401
<h4>3.6.1 Unversioned Igot Cards</h4>
402402
403
-<p>Zero or more "uvigot" cards are sent from client to server when
403
+<p>Zero or more "uvigot" cards are sent from server to client when
404404
synchronizing unversioned content. The format of a uvigot card is
405405
as follows:
406406
407407
<blockquote>
408408
<b>uvigot</b> <i>name mtime hash size</i>
409409
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220 introduced to improve the speed of the transfer of content by sending the
221 compressed artifact directly from the server database to the client.</p>
222
223 <p>Compressed File cards are similar to File cards, sharing the same
224 in-line "payload" data characteristics and also the same treatment of
225 direct content or delta content. It comes in two different formats
226 depending on whether the artifact is sent directly or as a delta from
227 some other artifact.</p>
228
229 <blockquote>
230 <b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
282 it is too large to transmit, or if the send merely wants to update the
283 modification time of the file without changing the files content.
284 The <i>content</i> is the (uncompressed) content of the file.
285
286 <p>The receiver should only accept the uvfile card if the hash and
287 size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398 identified by the first argument is private on the sender and should
399 be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400
401 <h4>3.6.1 Unversioned Igot Cards</h4>
402
403 <p>Zero or more "uvigot" cards are sent from client to server when
404 synchronizing unversioned content. The format of a uvigot card is
405 as follows:
406
407 <blockquote>
408 <b>uvigot</b> <i>name mtime hash size</i>
409
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220 introduced to improve the speed of the transfer of content by sending the
221 compressed artifact directly from the server database to the client.</p>
222
223 <p>Compressed File cards are similar to File cards, sharing the same
224 in-line "payload" data characteristics and also the same treatment of
225 direct content or delta content. Cfile cards come in two different formats
226 depending on whether the artifact is sent directly or as a delta from
227 some other artifact.</p>
228
229 <blockquote>
230 <b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
282 it is too large to transmit, or if the sender merely wants to update the
283 modification time of the file without changing the files content.
284 The <i>content</i> is the (uncompressed) content of the file.
285
286 <p>The receiver should only accept the uvfile card if the hash and
287 size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398 identified by the first argument is private on the sender and should
399 be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400
401 <h4>3.6.1 Unversioned Igot Cards</h4>
402
403 <p>Zero or more "uvigot" cards are sent from server to client when
404 synchronizing unversioned content. The format of a uvigot card is
405 as follows:
406
407 <blockquote>
408 <b>uvigot</b> <i>name mtime hash size</i>
409

Keyboard Shortcuts

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