Fossil SCM
The undocumented feature of resolving RID-looking strings as RIDs has been changed to rid:### instead to avoid surprise, per ML discussion.
Commit
4c80aa2ae106a5b364e43dc1ba27cf94681d8172
Parent
ccc7724a511fad3…
1 file changed
+13
-10
+13
-10
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -248,20 +248,23 @@ | ||
| 248 | 248 | zTag, zType |
| 249 | 249 | ); |
| 250 | 250 | if( rid>0 ) return rid; |
| 251 | 251 | |
| 252 | 252 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 253 | - for(i=0; fossil_isdigit(zTag[i]); i++){} | |
| 254 | - if( zTag[i]==0 ){ | |
| 255 | - if( strcmp(zType,"*")==0 ){ | |
| 256 | - rid = atoi(zTag); | |
| 257 | - }else{ | |
| 258 | - rid = db_int(0, | |
| 259 | - "SELECT event.objid" | |
| 260 | - " FROM event" | |
| 261 | - " WHERE event.objid=%s" | |
| 262 | - " AND event.type GLOB '%q'", zTag, zType); | |
| 253 | + if( memcmp(zTag, "rid:", 4)==0 ){ | |
| 254 | + zTag += 4; | |
| 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 | + } | |
| 263 | 266 | } |
| 264 | 267 | } |
| 265 | 268 | return rid; |
| 266 | 269 | } |
| 267 | 270 | |
| 268 | 271 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -248,20 +248,23 @@ | |
| 248 | zTag, zType |
| 249 | ); |
| 250 | if( rid>0 ) return rid; |
| 251 | |
| 252 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 253 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 254 | if( zTag[i]==0 ){ |
| 255 | if( strcmp(zType,"*")==0 ){ |
| 256 | rid = atoi(zTag); |
| 257 | }else{ |
| 258 | rid = db_int(0, |
| 259 | "SELECT event.objid" |
| 260 | " FROM event" |
| 261 | " WHERE event.objid=%s" |
| 262 | " AND event.type GLOB '%q'", zTag, zType); |
| 263 | } |
| 264 | } |
| 265 | return rid; |
| 266 | } |
| 267 | |
| 268 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -248,20 +248,23 @@ | |
| 248 | zTag, zType |
| 249 | ); |
| 250 | if( rid>0 ) return rid; |
| 251 | |
| 252 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 253 | if( memcmp(zTag, "rid:", 4)==0 ){ |
| 254 | zTag += 4; |
| 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 | } |
| 266 | } |
| 267 | } |
| 268 | return rid; |
| 269 | } |
| 270 | |
| 271 |