Fossil SCM
Fix a comment, and remove some unnecessary end-of-line spaces.
Commit
c54c2b0d4a7ca976dd565ee4d32693b46dda2360
Parent
ca6cb44c741041e…
1 file changed
+15
-15
+15
-15
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -17,11 +17,11 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file contains code used to convert user-supplied object names into |
| 19 | 19 | ** canonical UUIDs. |
| 20 | 20 | ** |
| 21 | 21 | ** A user-supplied object name is any unique prefix of a valid UUID but |
| 22 | -** not necessarily in canonical form. | |
| 22 | +** not necessarily in canonical form. | |
| 23 | 23 | */ |
| 24 | 24 | #include "config.h" |
| 25 | 25 | #include "name.h" |
| 26 | 26 | #include <assert.h> |
| 27 | 27 | |
| @@ -50,11 +50,11 @@ | ||
| 50 | 50 | ** |
| 51 | 51 | ** * SHA1 hash |
| 52 | 52 | ** * SHA1 hash prefix of at least 4 characters |
| 53 | 53 | ** * Symbolic Name |
| 54 | 54 | ** * "tag:" + symbolic name |
| 55 | -** * Date or date-time | |
| 55 | +** * Date or date-time | |
| 56 | 56 | ** * "date:" + Date or date-time |
| 57 | 57 | ** * symbolic-name ":" date-time |
| 58 | 58 | ** * "tip" |
| 59 | 59 | ** |
| 60 | 60 | ** The following additional forms are available in local checkouts: |
| @@ -64,11 +64,11 @@ | ||
| 64 | 64 | ** * "next" |
| 65 | 65 | ** |
| 66 | 66 | ** Return the RID of the matching artifact. Or return 0 if the name does not |
| 67 | 67 | ** match any known object. Or return -1 if the name is ambiguous. |
| 68 | 68 | ** |
| 69 | -** The zType parameter specifies the type of artifact: ci, t, w, e, g. | |
| 69 | +** The zType parameter specifies the type of artifact: ci, t, w, e, g. | |
| 70 | 70 | ** If zType is NULL or "" or "*" then any type of artifact will serve. |
| 71 | 71 | ** zType is "ci" in most use cases since we are usually searching for |
| 72 | 72 | ** a check-in. |
| 73 | 73 | */ |
| 74 | 74 | int symbolic_name_to_rid(const char *zTag, const char *zType){ |
| @@ -93,11 +93,11 @@ | ||
| 93 | 93 | |
| 94 | 94 | /* special keywords: "prev", "previous", "current", and "next" */ |
| 95 | 95 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 96 | 96 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 97 | 97 | rid = vid; |
| 98 | - }else if( fossil_strcmp(zTag, "prev")==0 | |
| 98 | + }else if( fossil_strcmp(zTag, "prev")==0 | |
| 99 | 99 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 100 | 100 | rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid); |
| 101 | 101 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 102 | 102 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 103 | 103 | " ORDER BY isprim DESC, mtime DESC", vid); |
| @@ -105,19 +105,19 @@ | ||
| 105 | 105 | if( rid ) return rid; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /* Date and times */ |
| 109 | 109 | if( memcmp(zTag, "date:", 5)==0 ){ |
| 110 | - rid = db_int(0, | |
| 110 | + rid = db_int(0, | |
| 111 | 111 | "SELECT objid FROM event" |
| 112 | 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | 114 | &zTag[5], zType); |
| 115 | 115 | return rid; |
| 116 | 116 | } |
| 117 | 117 | if( fossil_isdate(zTag) ){ |
| 118 | - rid = db_int(0, | |
| 118 | + rid = db_int(0, | |
| 119 | 119 | "SELECT objid FROM event" |
| 120 | 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | 122 | zTag, zType); |
| 123 | 123 | if( rid) return rid; |
| @@ -124,19 +124,19 @@ | ||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /* Deprecated date & time formats: "local:" + date-time and |
| 127 | 127 | ** "utc:" + date-time */ |
| 128 | 128 | if( memcmp(zTag, "local:", 6)==0 ){ |
| 129 | - rid = db_int(0, | |
| 129 | + rid = db_int(0, | |
| 130 | 130 | "SELECT objid FROM event" |
| 131 | 131 | " WHERE mtime<=julianday(%Q) AND type GLOB '%q'" |
| 132 | 132 | " ORDER BY mtime DESC LIMIT 1", |
| 133 | 133 | &zTag[6], zType); |
| 134 | 134 | return rid; |
| 135 | 135 | } |
| 136 | 136 | if( memcmp(zTag, "utc:", 4)==0 ){ |
| 137 | - rid = db_int(0, | |
| 137 | + rid = db_int(0, | |
| 138 | 138 | "SELECT objid FROM event" |
| 139 | 139 | " WHERE mtime<=julianday('%qz') AND type GLOB '%q'" |
| 140 | 140 | " ORDER BY mtime DESC LIMIT 1", |
| 141 | 141 | &zTag[4], zType); |
| 142 | 142 | return rid; |
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | " AND event.type GLOB '%q'", |
| 154 | 154 | &zTag[4], zType |
| 155 | 155 | ); |
| 156 | 156 | return rid; |
| 157 | 157 | } |
| 158 | - | |
| 158 | + | |
| 159 | 159 | /* root:TAG -> The origin of the branch */ |
| 160 | 160 | if( memcmp(zTag, "root:", 5)==0 ){ |
| 161 | 161 | Stmt q; |
| 162 | 162 | int rc; |
| 163 | 163 | char *zBr; |
| @@ -255,11 +255,11 @@ | ||
| 255 | 255 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 256 | 256 | if( zTag[i]==0 ){ |
| 257 | 257 | if( strcmp(zType,"*")==0 ){ |
| 258 | 258 | rid = atoi(zTag); |
| 259 | 259 | }else{ |
| 260 | - rid = db_int(0, | |
| 260 | + rid = db_int(0, | |
| 261 | 261 | "SELECT event.objid" |
| 262 | 262 | " FROM event" |
| 263 | 263 | " WHERE event.objid=%s" |
| 264 | 264 | " AND event.type GLOB '%q'", zTag, zType); |
| 265 | 265 | } |
| @@ -278,12 +278,12 @@ | ||
| 278 | 278 | ** the name as a tag. If multiple tags match, pick the latest. |
| 279 | 279 | ** If the input name matches "tag:*" then always resolve as a tag. |
| 280 | 280 | ** |
| 281 | 281 | ** If the input is not a tag, then try to match it as an ISO-8601 date |
| 282 | 282 | ** string YYYY-MM-DD HH:MM:SS and pick the nearest check-in to that date. |
| 283 | -** If the input is of the form "date:*" or "localtime:*" or "utc:*" then | |
| 284 | -** always resolve the name as a date. | |
| 283 | +** If the input is of the form "date:*" then always resolve the name as | |
| 284 | +** a date. The forms "utc:*" and "local:" are deprecated. | |
| 285 | 285 | ** |
| 286 | 286 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 287 | 287 | ** Return 2 name is ambiguous. |
| 288 | 288 | */ |
| 289 | 289 | int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){ |
| @@ -379,20 +379,20 @@ | ||
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /* |
| 382 | 382 | ** WEBPAGE: ambiguous |
| 383 | 383 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 384 | -** | |
| 384 | +** | |
| 385 | 385 | ** The UUID given by the name parameter is ambiguous. Display a page |
| 386 | 386 | ** that shows all possible choices and let the user select between them. |
| 387 | 387 | */ |
| 388 | 388 | void ambiguous_page(void){ |
| 389 | 389 | Stmt q; |
| 390 | - const char *zName = P("name"); | |
| 390 | + const char *zName = P("name"); | |
| 391 | 391 | const char *zSrc = P("src"); |
| 392 | 392 | char *z; |
| 393 | - | |
| 393 | + | |
| 394 | 394 | if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){ |
| 395 | 395 | fossil_redirect_home(); |
| 396 | 396 | } |
| 397 | 397 | style_header("Ambiguous Artifact ID"); |
| 398 | 398 | @ <p>The artifact id <b>%h(zName)</b> is ambiguous and might |
| 399 | 399 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -17,11 +17,11 @@ | |
| 17 | ** |
| 18 | ** This file contains code used to convert user-supplied object names into |
| 19 | ** canonical UUIDs. |
| 20 | ** |
| 21 | ** A user-supplied object name is any unique prefix of a valid UUID but |
| 22 | ** not necessarily in canonical form. |
| 23 | */ |
| 24 | #include "config.h" |
| 25 | #include "name.h" |
| 26 | #include <assert.h> |
| 27 | |
| @@ -50,11 +50,11 @@ | |
| 50 | ** |
| 51 | ** * SHA1 hash |
| 52 | ** * SHA1 hash prefix of at least 4 characters |
| 53 | ** * Symbolic Name |
| 54 | ** * "tag:" + symbolic name |
| 55 | ** * Date or date-time |
| 56 | ** * "date:" + Date or date-time |
| 57 | ** * symbolic-name ":" date-time |
| 58 | ** * "tip" |
| 59 | ** |
| 60 | ** The following additional forms are available in local checkouts: |
| @@ -64,11 +64,11 @@ | |
| 64 | ** * "next" |
| 65 | ** |
| 66 | ** Return the RID of the matching artifact. Or return 0 if the name does not |
| 67 | ** match any known object. Or return -1 if the name is ambiguous. |
| 68 | ** |
| 69 | ** The zType parameter specifies the type of artifact: ci, t, w, e, g. |
| 70 | ** If zType is NULL or "" or "*" then any type of artifact will serve. |
| 71 | ** zType is "ci" in most use cases since we are usually searching for |
| 72 | ** a check-in. |
| 73 | */ |
| 74 | int symbolic_name_to_rid(const char *zTag, const char *zType){ |
| @@ -93,11 +93,11 @@ | |
| 93 | |
| 94 | /* special keywords: "prev", "previous", "current", and "next" */ |
| 95 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 96 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 97 | rid = vid; |
| 98 | }else if( fossil_strcmp(zTag, "prev")==0 |
| 99 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 100 | rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid); |
| 101 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 102 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 103 | " ORDER BY isprim DESC, mtime DESC", vid); |
| @@ -105,19 +105,19 @@ | |
| 105 | if( rid ) return rid; |
| 106 | } |
| 107 | |
| 108 | /* Date and times */ |
| 109 | if( memcmp(zTag, "date:", 5)==0 ){ |
| 110 | rid = db_int(0, |
| 111 | "SELECT objid FROM event" |
| 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | &zTag[5], zType); |
| 115 | return rid; |
| 116 | } |
| 117 | if( fossil_isdate(zTag) ){ |
| 118 | rid = db_int(0, |
| 119 | "SELECT objid FROM event" |
| 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | zTag, zType); |
| 123 | if( rid) return rid; |
| @@ -124,19 +124,19 @@ | |
| 124 | } |
| 125 | |
| 126 | /* Deprecated date & time formats: "local:" + date-time and |
| 127 | ** "utc:" + date-time */ |
| 128 | if( memcmp(zTag, "local:", 6)==0 ){ |
| 129 | rid = db_int(0, |
| 130 | "SELECT objid FROM event" |
| 131 | " WHERE mtime<=julianday(%Q) AND type GLOB '%q'" |
| 132 | " ORDER BY mtime DESC LIMIT 1", |
| 133 | &zTag[6], zType); |
| 134 | return rid; |
| 135 | } |
| 136 | if( memcmp(zTag, "utc:", 4)==0 ){ |
| 137 | rid = db_int(0, |
| 138 | "SELECT objid FROM event" |
| 139 | " WHERE mtime<=julianday('%qz') AND type GLOB '%q'" |
| 140 | " ORDER BY mtime DESC LIMIT 1", |
| 141 | &zTag[4], zType); |
| 142 | return rid; |
| @@ -153,11 +153,11 @@ | |
| 153 | " AND event.type GLOB '%q'", |
| 154 | &zTag[4], zType |
| 155 | ); |
| 156 | return rid; |
| 157 | } |
| 158 | |
| 159 | /* root:TAG -> The origin of the branch */ |
| 160 | if( memcmp(zTag, "root:", 5)==0 ){ |
| 161 | Stmt q; |
| 162 | int rc; |
| 163 | char *zBr; |
| @@ -255,11 +255,11 @@ | |
| 255 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 256 | if( zTag[i]==0 ){ |
| 257 | if( strcmp(zType,"*")==0 ){ |
| 258 | rid = atoi(zTag); |
| 259 | }else{ |
| 260 | rid = db_int(0, |
| 261 | "SELECT event.objid" |
| 262 | " FROM event" |
| 263 | " WHERE event.objid=%s" |
| 264 | " AND event.type GLOB '%q'", zTag, zType); |
| 265 | } |
| @@ -278,12 +278,12 @@ | |
| 278 | ** the name as a tag. If multiple tags match, pick the latest. |
| 279 | ** If the input name matches "tag:*" then always resolve as a tag. |
| 280 | ** |
| 281 | ** If the input is not a tag, then try to match it as an ISO-8601 date |
| 282 | ** string YYYY-MM-DD HH:MM:SS and pick the nearest check-in to that date. |
| 283 | ** If the input is of the form "date:*" or "localtime:*" or "utc:*" then |
| 284 | ** always resolve the name as a date. |
| 285 | ** |
| 286 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 287 | ** Return 2 name is ambiguous. |
| 288 | */ |
| 289 | int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){ |
| @@ -379,20 +379,20 @@ | |
| 379 | } |
| 380 | |
| 381 | /* |
| 382 | ** WEBPAGE: ambiguous |
| 383 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 384 | ** |
| 385 | ** The UUID given by the name parameter is ambiguous. Display a page |
| 386 | ** that shows all possible choices and let the user select between them. |
| 387 | */ |
| 388 | void ambiguous_page(void){ |
| 389 | Stmt q; |
| 390 | const char *zName = P("name"); |
| 391 | const char *zSrc = P("src"); |
| 392 | char *z; |
| 393 | |
| 394 | if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){ |
| 395 | fossil_redirect_home(); |
| 396 | } |
| 397 | style_header("Ambiguous Artifact ID"); |
| 398 | @ <p>The artifact id <b>%h(zName)</b> is ambiguous and might |
| 399 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -17,11 +17,11 @@ | |
| 17 | ** |
| 18 | ** This file contains code used to convert user-supplied object names into |
| 19 | ** canonical UUIDs. |
| 20 | ** |
| 21 | ** A user-supplied object name is any unique prefix of a valid UUID but |
| 22 | ** not necessarily in canonical form. |
| 23 | */ |
| 24 | #include "config.h" |
| 25 | #include "name.h" |
| 26 | #include <assert.h> |
| 27 | |
| @@ -50,11 +50,11 @@ | |
| 50 | ** |
| 51 | ** * SHA1 hash |
| 52 | ** * SHA1 hash prefix of at least 4 characters |
| 53 | ** * Symbolic Name |
| 54 | ** * "tag:" + symbolic name |
| 55 | ** * Date or date-time |
| 56 | ** * "date:" + Date or date-time |
| 57 | ** * symbolic-name ":" date-time |
| 58 | ** * "tip" |
| 59 | ** |
| 60 | ** The following additional forms are available in local checkouts: |
| @@ -64,11 +64,11 @@ | |
| 64 | ** * "next" |
| 65 | ** |
| 66 | ** Return the RID of the matching artifact. Or return 0 if the name does not |
| 67 | ** match any known object. Or return -1 if the name is ambiguous. |
| 68 | ** |
| 69 | ** The zType parameter specifies the type of artifact: ci, t, w, e, g. |
| 70 | ** If zType is NULL or "" or "*" then any type of artifact will serve. |
| 71 | ** zType is "ci" in most use cases since we are usually searching for |
| 72 | ** a check-in. |
| 73 | */ |
| 74 | int symbolic_name_to_rid(const char *zTag, const char *zType){ |
| @@ -93,11 +93,11 @@ | |
| 93 | |
| 94 | /* special keywords: "prev", "previous", "current", and "next" */ |
| 95 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 96 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 97 | rid = vid; |
| 98 | }else if( fossil_strcmp(zTag, "prev")==0 |
| 99 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 100 | rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid); |
| 101 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 102 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 103 | " ORDER BY isprim DESC, mtime DESC", vid); |
| @@ -105,19 +105,19 @@ | |
| 105 | if( rid ) return rid; |
| 106 | } |
| 107 | |
| 108 | /* Date and times */ |
| 109 | if( memcmp(zTag, "date:", 5)==0 ){ |
| 110 | rid = db_int(0, |
| 111 | "SELECT objid FROM event" |
| 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | &zTag[5], zType); |
| 115 | return rid; |
| 116 | } |
| 117 | if( fossil_isdate(zTag) ){ |
| 118 | rid = db_int(0, |
| 119 | "SELECT objid FROM event" |
| 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | zTag, zType); |
| 123 | if( rid) return rid; |
| @@ -124,19 +124,19 @@ | |
| 124 | } |
| 125 | |
| 126 | /* Deprecated date & time formats: "local:" + date-time and |
| 127 | ** "utc:" + date-time */ |
| 128 | if( memcmp(zTag, "local:", 6)==0 ){ |
| 129 | rid = db_int(0, |
| 130 | "SELECT objid FROM event" |
| 131 | " WHERE mtime<=julianday(%Q) AND type GLOB '%q'" |
| 132 | " ORDER BY mtime DESC LIMIT 1", |
| 133 | &zTag[6], zType); |
| 134 | return rid; |
| 135 | } |
| 136 | if( memcmp(zTag, "utc:", 4)==0 ){ |
| 137 | rid = db_int(0, |
| 138 | "SELECT objid FROM event" |
| 139 | " WHERE mtime<=julianday('%qz') AND type GLOB '%q'" |
| 140 | " ORDER BY mtime DESC LIMIT 1", |
| 141 | &zTag[4], zType); |
| 142 | return rid; |
| @@ -153,11 +153,11 @@ | |
| 153 | " AND event.type GLOB '%q'", |
| 154 | &zTag[4], zType |
| 155 | ); |
| 156 | return rid; |
| 157 | } |
| 158 | |
| 159 | /* root:TAG -> The origin of the branch */ |
| 160 | if( memcmp(zTag, "root:", 5)==0 ){ |
| 161 | Stmt q; |
| 162 | int rc; |
| 163 | char *zBr; |
| @@ -255,11 +255,11 @@ | |
| 255 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 256 | if( zTag[i]==0 ){ |
| 257 | if( strcmp(zType,"*")==0 ){ |
| 258 | rid = atoi(zTag); |
| 259 | }else{ |
| 260 | rid = db_int(0, |
| 261 | "SELECT event.objid" |
| 262 | " FROM event" |
| 263 | " WHERE event.objid=%s" |
| 264 | " AND event.type GLOB '%q'", zTag, zType); |
| 265 | } |
| @@ -278,12 +278,12 @@ | |
| 278 | ** the name as a tag. If multiple tags match, pick the latest. |
| 279 | ** If the input name matches "tag:*" then always resolve as a tag. |
| 280 | ** |
| 281 | ** If the input is not a tag, then try to match it as an ISO-8601 date |
| 282 | ** string YYYY-MM-DD HH:MM:SS and pick the nearest check-in to that date. |
| 283 | ** If the input is of the form "date:*" then always resolve the name as |
| 284 | ** a date. The forms "utc:*" and "local:" are deprecated. |
| 285 | ** |
| 286 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 287 | ** Return 2 name is ambiguous. |
| 288 | */ |
| 289 | int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){ |
| @@ -379,20 +379,20 @@ | |
| 379 | } |
| 380 | |
| 381 | /* |
| 382 | ** WEBPAGE: ambiguous |
| 383 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 384 | ** |
| 385 | ** The UUID given by the name parameter is ambiguous. Display a page |
| 386 | ** that shows all possible choices and let the user select between them. |
| 387 | */ |
| 388 | void ambiguous_page(void){ |
| 389 | Stmt q; |
| 390 | const char *zName = P("name"); |
| 391 | const char *zSrc = P("src"); |
| 392 | char *z; |
| 393 | |
| 394 | if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){ |
| 395 | fossil_redirect_home(); |
| 396 | } |
| 397 | style_header("Ambiguous Artifact ID"); |
| 398 | @ <p>The artifact id <b>%h(zName)</b> is ambiguous and might |
| 399 |