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.
Commit
85f957c3e57b99b1408d6135a3dc0f0adebd5099
Parent
3f06618c9602871…
2 files changed
+16
+3
-3
+16
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -190,13 +190,26 @@ | ||
| 190 | 190 | } |
| 191 | 191 | return syncFlags; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 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* | |
| 195 | 207 | ** COMMAND: unversioned |
| 196 | 208 | ** |
| 197 | 209 | ** Usage: %fossil unversioned SUBCOMMAND ARGS... |
| 210 | +** or: %fossil uv SUBCOMMAND ARGS.. | |
| 198 | 211 | ** |
| 199 | 212 | ** Unversioned files (UV-files) are artifacts that are synced and are available |
| 200 | 213 | ** for download but which do not preserve history. Only the most recent version |
| 201 | 214 | ** of each UV-file is retained. Changes to an UV-file are permanent and cannot |
| 202 | 215 | ** be undone, so use appropriate caution with this command. |
| @@ -271,10 +284,13 @@ | ||
| 271 | 284 | for(i=3; i<g.argc; i++){ |
| 272 | 285 | zIn = zAs ? zAs : g.argv[i]; |
| 273 | 286 | if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){ |
| 274 | 287 | fossil_fatal("'%Q' is not an acceptable filename", zIn); |
| 275 | 288 | } |
| 289 | + if( contains_whitespace(zIn) ){ | |
| 290 | + fossil_fatal("names of unversioned files may not contain whitespace"); | |
| 291 | + } | |
| 276 | 292 | blob_init(&file,0,0); |
| 277 | 293 | blob_read_from_file(&file, g.argv[i]); |
| 278 | 294 | unversioned_write(zIn, &file, mtime); |
| 279 | 295 | blob_reset(&file); |
| 280 | 296 | } |
| 281 | 297 |
| --- 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 @@ | ||
| 220 | 220 | introduced to improve the speed of the transfer of content by sending the |
| 221 | 221 | compressed artifact directly from the server database to the client.</p> |
| 222 | 222 | |
| 223 | 223 | <p>Compressed File cards are similar to File cards, sharing the same |
| 224 | 224 | 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 | |
| 226 | 226 | depending on whether the artifact is sent directly or as a delta from |
| 227 | 227 | some other artifact.</p> |
| 228 | 228 | |
| 229 | 229 | <blockquote> |
| 230 | 230 | <b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br> |
| @@ -277,11 +277,11 @@ | ||
| 277 | 277 | for the unversioned file, or "<b>-</b>" for deleted content. |
| 278 | 278 | The <i>size</i> field is the (uncompressed) size of the content |
| 279 | 279 | in bytes. The <i>flags</i> field is an integer which is interpreted |
| 280 | 280 | as an array of bits. The 0x0004 bit of <i>flags</i> indicates that |
| 281 | 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 | |
| 282 | +it is too large to transmit, or if the sender merely wants to update the | |
| 283 | 283 | modification time of the file without changing the files content. |
| 284 | 284 | The <i>content</i> is the (uncompressed) content of the file. |
| 285 | 285 | |
| 286 | 286 | <p>The receiver should only accept the uvfile card if the hash and |
| 287 | 287 | size match the content and if the mtime is newer than any existing |
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | identified by the first argument is private on the sender and should |
| 399 | 399 | be ignored unless a "--private" [/help?cmd=sync|sync] is occurring. |
| 400 | 400 | |
| 401 | 401 | <h4>3.6.1 Unversioned Igot Cards</h4> |
| 402 | 402 | |
| 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 | |
| 404 | 404 | synchronizing unversioned content. The format of a uvigot card is |
| 405 | 405 | as follows: |
| 406 | 406 | |
| 407 | 407 | <blockquote> |
| 408 | 408 | <b>uvigot</b> <i>name mtime hash size</i> |
| 409 | 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. 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 |