| Line 150... |
Line 150... |
| 150 |
REresults = val.search(CCLabelRE);
|
150 |
REresults = val.search(CCLabelRE);
|
| 151 |
if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
|
151 |
if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
|
| 152 |
}
|
152 |
}
|
| 153 |
|
153 |
|
| 154 |
if (test.indexOf('isSVNTag')!=-1) {
|
154 |
if (test.indexOf('isSVNTag')!=-1) {
|
| 155 |
// Subversion TAG validation
|
155 |
// Subversion Tag validation
|
| - |
|
156 |
var SVNTagValidPeg = /^@?\d+$/;
|
| 156 |
var SVNTagValidCharsRE = /^[0-9a-z_\.\-\/\@]+$/i;
|
157 |
var SVNTagRE = /^[0-9a-z_\.\-]+$/i;
|
| - |
|
158 |
|
| - |
|
159 |
if ( val.search(SVNTagValidPeg) < 0) {
|
| 157 |
var SVNTagInValidTrunkAnywhereRE = /\/trunk\//i;
|
160 |
val = val.replace (/@\d+$/,"");
|
| - |
|
161 |
|
| - |
|
162 |
if (val.search(SVNTagRE) < 0)
|
| - |
|
163 |
errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
|
| - |
|
164 |
}
|
| - |
|
165 |
}
|
| - |
|
166 |
|
| - |
|
167 |
if (test.indexOf('isSVNPath')!=-1) {
|
| - |
|
168 |
// Subversion Base Path validation
|
| 158 |
var SVNTagInValidAt = /@[0-9]*[^0-9$]+/i;
|
169 |
var SVNTagValidCharsRE = /^[0-9a-z_\.\-\/]+$/i;
|
| 159 |
var SVNTagInValidSlashAtBOL = /^\/.*$/i;
|
170 |
var SVNTagInValidSlashAtBOL = /^\/.*$/i;
|
| 160 |
var SVNTagInValidTrunkRE = /\/trunk[^@]+/i;
|
- |
|
| 161 |
var SVNTagInValidSlashAt = /\/@/i;
|
171 |
var SVNTagInValidSlashAtEOL = /\/$/i;
|
| 162 |
var SVNTagInValidAtSlash = /@\//i;
|
- |
|
| 163 |
var SVNTagInValidSlash = /^.*\/\/.*$/i;
|
172 |
var SVNTagInValidSlash = /^.*\/\/.*$/i;
|
| - |
|
173 |
var SVNTagInValidTrunkAnywhereRE = /\/trunk\//i;
|
| 164 |
var SVNTagValidTagAnywhereRE = /^.*\/tags\/.*$/i;
|
174 |
var SVNTagValidTagAnywhereRE = /^.*\/tags\/.*$/i;
|
| 165 |
var SVNTagValidBranchAnywhereRE = /^.*\/branches\/.*$/i;
|
- |
|
| 166 |
var SVNTagValidTrunkAtNumberRE = /^.*\/trunk@[0-9]+$/i;
|
- |
|
| 167 |
|
175 |
|
| 168 |
if (val.search(SVNTagValidCharsRE) < 0)
|
176 |
if (val.search(SVNTagValidCharsRE) < 0)
|
| 169 |
errors += val += ' - '+nm+' uses invalid character. Allowed characters are / A-Z a-z 0-9 . - _ @\n';
|
177 |
errors += val += ' - '+nm+' uses invalid character. Allowed characters are / A-Z a-z 0-9 . - _\n';
|
| - |
|
178 |
else if (val.search(SVNTagInValidSlashAtBOL) >= 0)
|
| - |
|
179 |
errors += val += ' - '+nm+' begins with a /. This is not allowed.\n';
|
| - |
|
180 |
else if (val.search(SVNTagInValidSlashAtEOL) >= 0)
|
| - |
|
181 |
errors += val += ' - '+nm+' ends with a /. This is not allowed.\n';
|
| 170 |
else {
|
182 |
else if (val.search(SVNTagInValidSlash) >= 0)
|
| - |
|
183 |
errors += val += ' - '+nm+' uses //. This is not allowed.\n';
|
| - |
|
184 |
else if (val.search(SVNTagValidTagAnywhereRE) >= 0)
|
| - |
|
185 |
errors += val += ' - '+nm+' contains /tags/. This is not allowed.\n';
|
| 171 |
if (val.search(SVNTagInValidTrunkAnywhereRE) >= 0)
|
186 |
else if (val.search(SVNTagInValidTrunkAnywhereRE) >= 0)
|
| 172 |
errors += val += ' - '+nm+' contains /trunk/. This is not allowed.\n';
|
187 |
errors += val += ' - '+nm+' contains /trunk/. This is not allowed.\n';
|
| 173 |
else {
|
188 |
else {
|
| 174 |
if (val.search(SVNTagInValidAt) >= 0)
|
189 |
var bits = val.split("/");
|
| 175 |
errors += val += ' - '+nm+' contains an @ symbol that is not followed by a numeric value and the end of the line.\n';
|
- |
|
| 176 |
else {
|
190 |
if ( bits.length < 4 )
|
| 177 |
if (val.search(SVNTagInValidSlashAtBOL) >= 0)
|
- |
|
| 178 |
errors += val += ' - '+nm+' begins with a /. This is not allowed.\n';
|
191 |
errors += val += ' - Must contain at least 4 path items.\n';
|
| 179 |
else {
|
192 |
|
| 180 |
if (val.search(SVNTagInValidTrunkRE) >= 0)
|
193 |
var ttbcount = 0;
|
| 181 |
errors += val += ' - '+nm+' contains invalid /trunk. This must be followed by an @<number>.\n';
|
- |
|
| 182 |
else {
|
194 |
for (i=0; i < bits.length; i++ )
|
| 183 |
if ((val.search(SVNTagInValidSlashAt) >= 0) || (val.search(SVNTagInValidAtSlash) >= 0))
|
- |
|
| 184 |
errors += val += ' - '+nm+' contains /@ or @/. This is not allowed.\n';
|
- |
|
| 185 |
else {
|
195 |
{
|
| 186 |
if (val.search(SVNTagInValidSlash) >= 0)
|
- |
|
| 187 |
errors += val += ' - '+nm+' uses //. This is not allowed.\n';
|
- |
|
| 188 |
else {
|
196 |
var el = bits[i];
|
| 189 |
var count_valid_forms = 0;
|
197 |
if ( el == 'tags') ttbcount++;
|
| 190 |
|
- |
|
| 191 |
if (val.search(SVNTagValidTrunkAtNumberRE) >= 0) count_valid_forms++;
|
- |
|
| 192 |
|
- |
|
| 193 |
if (val.search(SVNTagValidBranchAnywhereRE) >= 0) count_valid_forms++;
|
- |
|
| 194 |
|
- |
|
| 195 |
if (val.search(SVNTagValidTagAnywhereRE) >= 0) count_valid_forms++;
|
- |
|
| 196 |
|
- |
|
| 197 |
if (count_valid_forms == 0) errors += val += ' - '+nm+' does not end in /trunk@<number>,\nor does not contain /tags/ or /branches/\n';
|
- |
|
| 198 |
|
- |
|
| 199 |
if (count_valid_forms > 1) errors += val += ' - '+nm+' cannot combine use of trunk, /tags/, or /branches/ in one subversion tag\n';
|
- |
|
| 200 |
}
|
198 |
if ( el == 'trunk') ttbcount++;
|
| 201 |
}
|
199 |
if ( el == 'branches') ttbcount++;
|
| 202 |
}
|
- |
|
| 203 |
}
|
200 |
}
|
| - |
|
201 |
if ( ttbcount != 1 )
|
| - |
|
202 |
errors += val += ' - '+nm+' must contain exactly one of tags, trunk or branches. It contains '+ttbcount+'.\n';
|
| - |
|
203 |
|
| - |
|
204 |
if ( bits.pop() == 'branches' )
|
| - |
|
205 |
errors += val += ' - '+nm+' must not end in branches.\n';
|
| - |
|
206 |
|
| 204 |
}
|
207 |
}
|
| 205 |
}
|
- |
|
| 206 |
}
|
- |
|
| 207 |
}
|
208 |
}
|
| 208 |
|
209 |
|
| 209 |
if (test.indexOf('isVersionNumber')!=-1) {
|
210 |
if (test.indexOf('isVersionNumber')!=-1) {
|
| 210 |
REresults = val.search(versionNumberRE);
|
211 |
REresults = val.search(versionNumberRE);
|
| 211 |
if (REresults < 0) errors += val += ' - '+nm+' is formatted incorrectly.\nVersion number should be (major).(minor).(patch)(build)\ne.g. 1.0.2002\n';
|
212 |
if (REresults < 0) errors += val += ' - '+nm+' is formatted incorrectly.\nVersion number should be (major).(minor).(patch)(build)\ne.g. 1.0.2002\n';
|