Fossil SCM

Fix a comment, and remove some unnecessary end-of-line spaces.

jan.nijtmans 2014-02-06 13:38 trunk
Commit c54c2b0d4a7ca976dd565ee4d32693b46dda2360
1 file changed +15 -15
+15 -15
--- src/name.c
+++ src/name.c
@@ -17,11 +17,11 @@
1717
**
1818
** This file contains code used to convert user-supplied object names into
1919
** canonical UUIDs.
2020
**
2121
** 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.
2323
*/
2424
#include "config.h"
2525
#include "name.h"
2626
#include <assert.h>
2727
@@ -50,11 +50,11 @@
5050
**
5151
** * SHA1 hash
5252
** * SHA1 hash prefix of at least 4 characters
5353
** * Symbolic Name
5454
** * "tag:" + symbolic name
55
-** * Date or date-time
55
+** * Date or date-time
5656
** * "date:" + Date or date-time
5757
** * symbolic-name ":" date-time
5858
** * "tip"
5959
**
6060
** The following additional forms are available in local checkouts:
@@ -64,11 +64,11 @@
6464
** * "next"
6565
**
6666
** Return the RID of the matching artifact. Or return 0 if the name does not
6767
** match any known object. Or return -1 if the name is ambiguous.
6868
**
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.
7070
** If zType is NULL or "" or "*" then any type of artifact will serve.
7171
** zType is "ci" in most use cases since we are usually searching for
7272
** a check-in.
7373
*/
7474
int symbolic_name_to_rid(const char *zTag, const char *zType){
@@ -93,11 +93,11 @@
9393
9494
/* special keywords: "prev", "previous", "current", and "next" */
9595
if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){
9696
if( fossil_strcmp(zTag, "current")==0 ){
9797
rid = vid;
98
- }else if( fossil_strcmp(zTag, "prev")==0
98
+ }else if( fossil_strcmp(zTag, "prev")==0
9999
|| fossil_strcmp(zTag, "previous")==0 ){
100100
rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid);
101101
}else if( fossil_strcmp(zTag, "next")==0 ){
102102
rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d"
103103
" ORDER BY isprim DESC, mtime DESC", vid);
@@ -105,19 +105,19 @@
105105
if( rid ) return rid;
106106
}
107107
108108
/* Date and times */
109109
if( memcmp(zTag, "date:", 5)==0 ){
110
- rid = db_int(0,
110
+ rid = db_int(0,
111111
"SELECT objid FROM event"
112112
" WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
113113
" ORDER BY mtime DESC LIMIT 1",
114114
&zTag[5], zType);
115115
return rid;
116116
}
117117
if( fossil_isdate(zTag) ){
118
- rid = db_int(0,
118
+ rid = db_int(0,
119119
"SELECT objid FROM event"
120120
" WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
121121
" ORDER BY mtime DESC LIMIT 1",
122122
zTag, zType);
123123
if( rid) return rid;
@@ -124,19 +124,19 @@
124124
}
125125
126126
/* Deprecated date & time formats: "local:" + date-time and
127127
** "utc:" + date-time */
128128
if( memcmp(zTag, "local:", 6)==0 ){
129
- rid = db_int(0,
129
+ rid = db_int(0,
130130
"SELECT objid FROM event"
131131
" WHERE mtime<=julianday(%Q) AND type GLOB '%q'"
132132
" ORDER BY mtime DESC LIMIT 1",
133133
&zTag[6], zType);
134134
return rid;
135135
}
136136
if( memcmp(zTag, "utc:", 4)==0 ){
137
- rid = db_int(0,
137
+ rid = db_int(0,
138138
"SELECT objid FROM event"
139139
" WHERE mtime<=julianday('%qz') AND type GLOB '%q'"
140140
" ORDER BY mtime DESC LIMIT 1",
141141
&zTag[4], zType);
142142
return rid;
@@ -153,11 +153,11 @@
153153
" AND event.type GLOB '%q'",
154154
&zTag[4], zType
155155
);
156156
return rid;
157157
}
158
-
158
+
159159
/* root:TAG -> The origin of the branch */
160160
if( memcmp(zTag, "root:", 5)==0 ){
161161
Stmt q;
162162
int rc;
163163
char *zBr;
@@ -255,11 +255,11 @@
255255
for(i=0; fossil_isdigit(zTag[i]); i++){}
256256
if( zTag[i]==0 ){
257257
if( strcmp(zType,"*")==0 ){
258258
rid = atoi(zTag);
259259
}else{
260
- rid = db_int(0,
260
+ rid = db_int(0,
261261
"SELECT event.objid"
262262
" FROM event"
263263
" WHERE event.objid=%s"
264264
" AND event.type GLOB '%q'", zTag, zType);
265265
}
@@ -278,12 +278,12 @@
278278
** the name as a tag. If multiple tags match, pick the latest.
279279
** If the input name matches "tag:*" then always resolve as a tag.
280280
**
281281
** If the input is not a tag, then try to match it as an ISO-8601 date
282282
** 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.
285285
**
286286
** Return 0 on success. Return 1 if the name cannot be resolved.
287287
** Return 2 name is ambiguous.
288288
*/
289289
int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){
@@ -379,20 +379,20 @@
379379
}
380380
381381
/*
382382
** WEBPAGE: ambiguous
383383
** URL: /ambiguous?name=UUID&src=WEBPAGE
384
-**
384
+**
385385
** The UUID given by the name parameter is ambiguous. Display a page
386386
** that shows all possible choices and let the user select between them.
387387
*/
388388
void ambiguous_page(void){
389389
Stmt q;
390
- const char *zName = P("name");
390
+ const char *zName = P("name");
391391
const char *zSrc = P("src");
392392
char *z;
393
-
393
+
394394
if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){
395395
fossil_redirect_home();
396396
}
397397
style_header("Ambiguous Artifact ID");
398398
@ <p>The artifact id <b>%h(zName)</b> is ambiguous and might
399399
--- 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

Keyboard Shortcuts

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