Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | style |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
3ba9a4d5caa9615236bb48609bedcb28 |
| User & Date: | jan.nijtmans 2013-03-14 14:09:35.499 |
Context
|
2013-03-14
| ||
| 14:19 | merge trunk check-in: 4aa55e5533 user: jan.nijtmans tags: clean-with-ignore | |
| 14:18 | Update the "annotate" command and webpage to prefer to take changes from direct ancestors of the version being analyzed, rather than more recent changes on branches. check-in: e320f0cd79 user: drh tags: trunk | |
| 14:09 | style check-in: 3ba9a4d5ca user: jan.nijtmans tags: trunk | |
| 13:51 | LOOK_LENGTH flags only has meaning when LOOK_NUL is not set. check-in: 8923e06cea user: jan.nijtmans tags: trunk | |
Changes
Changes to src/checkin.c.
| ︙ | ︙ | |||
936 937 938 939 940 941 942 |
Blob ans;
char cReply;
if( eType==0 ){
if( binOk ){
return 0; /* We don't want binary warnings for this file. */
}
| | | | | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
Blob ans;
char cReply;
if( eType==0 ){
if( binOk ){
return 0; /* We don't want binary warnings for this file. */
}
if( (lookFlags&LOOK_LENGTH) && !(lookFlags&LOOK_NUL) ){
zWarning = "long lines";
}else{
zWarning = "binary data";
}
zDisable = "\"binary-glob\" setting";
zConvert = ""; /* We cannot convert binary files. */
}else if( fHasCrLf && fUnicode ){
if( crnlOk && encodingOk ){
return 0; /* We don't want CR/NL and Unicode warnings for this file. */
}
zWarning = "CR/NL line endings and Unicode";
zDisable = "\"crnl-glob\" and \"encoding-glob\" settings";
}else if( fHasCrLf ){
if( crnlOk ){
return 0; /* We don't want CR/NL warnings for this file. */
}
zWarning = "CR/NL line endings";
zDisable = "\"crnl-glob\" setting";
}else{
if( encodingOk ){
return 0; /* We don't want encoding warnings for this file. */
}
zWarning = "Unicode";
zDisable = "\"encoding-glob\" setting";
#if !defined(_WIN32) && !defined(__CYGWIN__)
zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
#endif
|
| ︙ | ︙ | |||
1221 1222 1223 1224 1225 1226 1227 | ** follows "commit", then only those files are committed. ** ** After the following function call has returned, the Global.aCommitFile[] ** array is allocated to contain the "id" field from the vfile table ** for each file to be committed. Or, if aCommitFile is NULL, all files ** should be committed. */ | | | 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 |
** follows "commit", then only those files are committed.
**
** After the following function call has returned, the Global.aCommitFile[]
** array is allocated to contain the "id" field from the vfile table
** for each file to be committed. Or, if aCommitFile is NULL, all files
** should be committed.
*/
if( select_commit_files() ){
blob_zero(&ans);
prompt_user("continue (y/N)? ", &ans);
cReply = blob_str(&ans)[0];
if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
}
isAMerge = db_exists("SELECT 1 FROM vmerge WHERE id=0");
if( g.aCommitFile && isAMerge ){
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
767 768 769 770 771 772 773 |
const char *zLabel,
int *pWasAttached
){
if( !g.db ){
assert( g.zMainDbType==0 );
g.db = db_open(zDbName);
g.zMainDbType = zLabel;
| | | | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 |
const char *zLabel,
int *pWasAttached
){
if( !g.db ){
assert( g.zMainDbType==0 );
g.db = db_open(zDbName);
g.zMainDbType = zLabel;
if( pWasAttached ) *pWasAttached = 0;
}else{
assert( g.zMainDbType!=0 );
db_attach(zDbName, zLabel);
if( pWasAttached ) *pWasAttached = 1;
}
}
/*
** Open the user database in "~/.fossil". Create the database anew if
** it does not already exist.
**
|
| ︙ | ︙ |
Changes to src/diff.c.
| ︙ | ︙ | |||
335 336 337 338 339 340 341 |
int j, c, result = 1; /* Assume UTF-16 text, prove otherwise */
if( pFlags ) *pFlags = LOOK_NONE;
if( n==0 ) return result; /* Empty file -> text */
if( n%sizeof(WCHAR_T) ){
if( pFlags ) *pFlags |= LOOK_ODD;
result = 0; /* Odd number of bytes -> binary (UTF-8?) */
| | | | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
int j, c, result = 1; /* Assume UTF-16 text, prove otherwise */
if( pFlags ) *pFlags = LOOK_NONE;
if( n==0 ) return result; /* Empty file -> text */
if( n%sizeof(WCHAR_T) ){
if( pFlags ) *pFlags |= LOOK_ODD;
result = 0; /* Odd number of bytes -> binary (UTF-8?) */
if( n<sizeof(WCHAR_T) ) return result; /* One byte -> binary (UTF-8?) */
}
c = *z;
if( c==0 ){
if( pFlags ) *pFlags |= LOOK_NUL;
result = 0; /* NUL character in a file -> binary */
}
j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
if( !j && pFlags ) *pFlags |= LOOK_LONE_LF;
while( 1 ){
int c2 = c;
if( n<sizeof(WCHAR_T) ) break;
n -= sizeof(WCHAR_T);
c = *++z; ++j;
if( c==0 ){
if( pFlags ) *pFlags |= LOOK_NUL;
result = 0; /* NUL character in a file -> binary */
}
if( c==UTF16BE_LF || c==UTF16LE_LF ){
|
| ︙ | ︙ | |||
574 575 576 577 578 579 580 |
}
if( hideBlock ){
a = xa;
b = xb;
continue;
}
}
| | | 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
}
if( hideBlock ){
a = xa;
b = xb;
continue;
}
}
/* For the current block comprising nr triples, figure out
** how many lines of A and B are to be displayed
*/
if( R[r]>nContext ){
na = nb = nContext;
skip = R[r] - nContext;
}else{
|
| ︙ | ︙ | |||
1266 1267 1268 1269 1270 1271 1272 | ** (1) the alignment is more than 25% longer than the longest side, and ** (2) the average match cost exceeds 15 ** Then this is probably an alignment that will be difficult for humans ** to read. So instead, just show all of the right side inserted followed ** by all of the left side deleted. ** ** The coefficients for conditions (1) and (2) above are determined by | | | 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 |
** (1) the alignment is more than 25% longer than the longest side, and
** (2) the average match cost exceeds 15
** Then this is probably an alignment that will be difficult for humans
** to read. So instead, just show all of the right side inserted followed
** by all of the left side deleted.
**
** The coefficients for conditions (1) and (2) above are determined by
** experimentation.
*/
mxLen = nLeft>nRight ? nLeft : nRight;
if( i*4>mxLen*5 && (nMatch==0 || iMatch/nMatch>15) ){
memset(aM, 4, mnLen);
if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen);
if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen);
}
|
| ︙ | ︙ | |||
1503 1504 1505 1506 1507 1508 1509 |
sbsWriteText(&s, &B[b], SBS_NEWLINE);
blob_append(pOut, s.zLine, s.n);
ma--;
mb--;
a++;
b++;
}
| | | 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 |
sbsWriteText(&s, &B[b], SBS_NEWLINE);
blob_append(pOut, s.zLine, s.n);
ma--;
mb--;
a++;
b++;
}
}
fossil_free(alignment);
if( i<nr-1 ){
m = R[r+i*3+3];
for(j=0; j<m; j++){
s.n = 0;
sbsWriteLineno(&s, a+j);
|
| ︙ | ︙ | |||
2295 2296 2297 2298 2299 2300 2301 |
fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid);
}
if( !content_get(rid, &toAnnotate) ){
fossil_panic("unable to retrieve content of artifact #%d", rid);
}
if( iLimit<=0 ) iLimit = 1000000000;
annotation_start(p, &toAnnotate);
| | | | 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 |
fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid);
}
if( !content_get(rid, &toAnnotate) ){
fossil_panic("unable to retrieve content of artifact #%d", rid);
}
if( iLimit<=0 ) iLimit = 1000000000;
annotation_start(p, &toAnnotate);
db_prepare(&q,
"SELECT (SELECT uuid FROM blob WHERE rid=mlink.%s),"
" date(event.mtime),"
" coalesce(event.euser,event.user),"
" mlink.pid"
" FROM mlink, event"
" WHERE mlink.fid=:rid"
" AND event.objid=mlink.mid"
" ORDER BY event.mtime",
(annFlags & ANN_FILE_VERS)!=0 ? "fid" : "mid"
);
db_bind_int(&q, ":rid", rid);
if( iLimit==0 ) iLimit = 1000000000;
while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
const char *zUuid = db_column_text(&q, 0);
const char *zDate = db_column_text(&q, 1);
const char *zUser = db_column_text(&q, 2);
int prevId = db_column_int(&q, 3);
|
| ︙ | ︙ | |||
2432 2433 2434 2435 2436 2437 2438 |
zLimit = find_option("limit",0,1);
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
iLimit = atoi(zLimit);
showLog = find_option("log",0,0)!=0;
fileVers = find_option("filevers",0,0)!=0;
db_must_be_within_tree();
| | | | 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 |
zLimit = find_option("limit",0,1);
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
iLimit = atoi(zLimit);
showLog = find_option("log",0,0)!=0;
fileVers = find_option("filevers",0,0)!=0;
db_must_be_within_tree();
if( g.argc<3 ) {
usage("FILENAME");
}
file_tree_name(g.argv[2], &treename, 1);
zFilename = blob_str(&treename);
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
if( fnid==0 ){
fossil_fatal("no such file: %s", zFilename);
}
fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
if( fid==0 ){
fossil_fatal("not part of current checkout: %s", zFilename);
}
cid = db_lget_int("checkout", 0);
if( cid == 0 ){
fossil_fatal("Not in a checkout");
}
if( iLimit<=0 ) iLimit = 1000000000;
compute_direct_ancestors(cid, iLimit);
mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
" WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid"
" ORDER BY ancestor.generation ASC LIMIT 1",
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
18 19 20 21 22 23 24 | ** This file contains code to implement the "finfo" command. */ #include "config.h" #include "finfo.h" /* ** COMMAND: finfo | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ** This file contains code to implement the "finfo" command. */ #include "config.h" #include "finfo.h" /* ** COMMAND: finfo ** ** Usage: %fossil finfo ?OPTIONS? FILENAME ** ** Print the complete change history for a single file going backwards ** in time. The default mode is -l. ** ** For the -l|--log mode: If "-b|--brief" is specified one line per revision ** is printed, otherwise the full comment is printed. The "--limit N" |
| ︙ | ︙ | |||
53 54 55 56 57 58 59 |
** boolean: "yes", "no", "true", "false", etc.
**
** See also: artifact, cat, descendants, info, leaves
*/
void finfo_cmd(void){
capture_case_sensitive_option();
db_must_be_within_tree();
| | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
** boolean: "yes", "no", "true", "false", etc.
**
** See also: artifact, cat, descendants, info, leaves
*/
void finfo_cmd(void){
capture_case_sensitive_option();
db_must_be_within_tree();
if( find_option("status","s",0) ){
Stmt q;
Blob line;
Blob fname;
int vid;
if( g.argc!=3 ) usage("-s|--status FILENAME");
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_panic("no checkout to finfo files in");
}
vfile_check_signature(vid, CKSIG_ENOTFILE);
file_tree_name(g.argv[2], &fname, 1);
db_prepare(&q,
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
" FROM vfile WHERE vfile.pathname=%B %s",
&fname, filename_collation());
blob_zero(&line);
if( db_step(&q)==SQLITE_ROW ) {
Blob uuid;
int isDeleted = db_column_int(&q, 1);
int isNew = db_column_int(&q,2) == 0;
int chnged = db_column_int(&q,3);
int renamed = db_column_int(&q,4);
blob_zero(&uuid);
|
| ︙ | ︙ | |||
245 246 247 248 249 250 251 | /* Values for the debug= query parameter to finfo */ #define FINFO_DEBUG_MLINK 0x01 /* ** WEBPAGE: finfo ** URL: /finfo?name=FILENAME ** | | | | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
/* Values for the debug= query parameter to finfo */
#define FINFO_DEBUG_MLINK 0x01
/*
** WEBPAGE: finfo
** URL: /finfo?name=FILENAME
**
** Show the change history for a single file.
**
** Additional query parameters:
**
** a=DATE Only show changes after DATE
** b=DATE Only show changes before DATE
** n=NUM Show the first NUM changes only
** brbg Background color by branch name
** ubg Background color by user name
** fco=BOOL Show only first occurrence of each version if true (default)
*/
void finfo_page(void){
Stmt q;
const char *zFilename;
char zPrevDate[20];
const char *zA;
const char *zB;
int n;
Blob title;
Blob sql;
HQuery url;
GraphContext *pGraph;
int brBg = P("brbg")!=0;
int uBg = P("ubg")!=0;
int firstChngOnly = atoi(PD("fco","1"))!=0;
|
| ︙ | ︙ | |||
286 287 288 289 290 291 292 |
if( uBg ) url_add_parameter(&url, "ubg", 0);
if( firstChngOnly ) url_add_parameter(&url, "fco", "0");
zPrevDate[0] = 0;
zFilename = PD("name","");
url_add_parameter(&url, "name", zFilename);
blob_zero(&sql);
| | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
if( uBg ) url_add_parameter(&url, "ubg", 0);
if( firstChngOnly ) url_add_parameter(&url, "fco", "0");
zPrevDate[0] = 0;
zFilename = PD("name","");
url_add_parameter(&url, "name", zFilename);
blob_zero(&sql);
blob_appendf(&sql,
"SELECT"
" datetime(event.mtime,'localtime')," /* Date of change */
" coalesce(event.ecomment, event.comment)," /* Check-in comment */
" coalesce(event.euser, event.user)," /* User who made chng */
" mlink.pid," /* Parent rid */
" mlink.fid," /* File rid */
" (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */
|
| ︙ | ︙ | |||
401 402 403 404 405 406 407 |
pfnid);
@ <b>Renamed</b> from
@ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
}
@ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in
}else{
char *zNewName;
| | | | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
pfnid);
@ <b>Renamed</b> from
@ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
}
@ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in
}else{
char *zNewName;
zNewName = db_text(0,
"SELECT name FROM filename WHERE fnid = "
" (SELECT fnid FROM mlink"
" WHERE mid=%d"
" AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q %s))",
fmid, zFilename, filename_collation());
if( zNewName ){
@ <b>Renamed</b> to
@ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in
fossil_free(zNewName);
}else{
@ <b>Deleted</b> by check-in
}
}
hyperlink_to_uuid(zShortCkin);
@ %w(zCom) (user:
hyperlink_to_user(zUser, zDate, "");
@ branch: %h(zBr))
if( g.perm.Hyperlink && zUuid ){
const char *z = zFilename;
if( fpid ){
@ %z(href("%R/fdiff?v1=%S&v2=%S",zPUuid,zUuid))[diff]</a>
}
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
1729 1730 1731 1732 1733 1734 1735 | @ <tr><th>Date:</th><td> hyperlink_to_date(zDate, "</td></tr>"); @ <tr><th>User:</th><td> hyperlink_to_user(pTktChng->zUser, zDate, "</td></tr>"); @ </table> free(zDate); free(zTktTitle); | | | 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 |
@ <tr><th>Date:</th><td>
hyperlink_to_date(zDate, "</td></tr>");
@ <tr><th>User:</th><td>
hyperlink_to_user(pTktChng->zUser, zDate, "</td></tr>");
@ </table>
free(zDate);
free(zTktTitle);
if( g.perm.ModTkt && modPending ){
@ <div class="section">Moderation</div>
@ <blockquote>
@ <form method="POST" action="%R/tinfo/%s(zUuid)">
@ <label><input type="radio" name="modaction" value="delete">
@ Delete this change</label><br />
@ <label><input type="radio" name="modaction" value="approve">
|
| ︙ | ︙ | |||
1922 1923 1924 1925 1926 1927 1928 |
}
@ %h(aColor[i].zCName)</td>
if( (i%8)==7 && i+1<nColor ){
@ </tr><tr>
}
}
@ </tr><tr>
| | | 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 |
}
@ %h(aColor[i].zCName)</td>
if( (i%8)==7 && i+1<nColor ){
@ </tr><tr>
}
}
@ </tr><tr>
if( stdClrFound ){
@ <td colspan="6">
@ <input type="radio" name="%s(zId)" value="%h(aColor[nColor].zColor)" />
}else{
@ <td style="background-color: %h(zDefaultColor);" colspan="6">
@ <input type="radio" name="%s(zId)" value="%h(aColor[nColor].zColor)"
@ checked="checked" />
}
|
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
633 634 635 636 637 638 639 |
int i;
int nLong;
const char *zReturn = 0;
assert( hasArg==0 || hasArg==1 );
nLong = strlen(zLong);
for(i=1; i<g.argc; i++){
char *z;
| | | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
int i;
int nLong;
const char *zReturn = 0;
assert( hasArg==0 || hasArg==1 );
nLong = strlen(zLong);
for(i=1; i<g.argc; i++){
char *z;
if( i+hasArg >= g.argc ) break;
z = g.argv[i];
if( z[0]!='-' ) continue;
z++;
if( z[0]=='-' ){
if( z[1]==0 ){
remove_from_argv(i, 1);
break;
|
| ︙ | ︙ | |||
1129 1130 1131 1132 1133 1134 1135 |
while( 1 ){
while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);
/* To avoid mischief, make sure the repository basename contains no
** characters other than alphanumerics, "/", "_", "-", and ".", and
** that "-" never occurs immediately after a "/" and that "." is always
| | | 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
while( 1 ){
while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);
/* To avoid mischief, make sure the repository basename contains no
** characters other than alphanumerics, "/", "_", "-", and ".", and
** that "-" never occurs immediately after a "/" and that "." is always
** surrounded by two alphanumerics. Any character that does not
** satisfy these constraints is converted into "_".
*/
szFile = 0;
for(j=strlen(g.zRepositoryName)+1, k=0; zRepo[j] && k<i-1; j++, k++){
char c = zRepo[j];
if( fossil_isalnum(c) ) continue;
if( c=='/' ) continue;
|
| ︙ | ︙ | |||
1589 1590 1591 1592 1593 1594 1595 | const char *zIpAddr; const char *zNotFound; const char *zHost; const char *zAltBase; const char *zFileGlob; /* The winhttp module passes the --files option as --files-urlenc with | | | 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 |
const char *zIpAddr;
const char *zNotFound;
const char *zHost;
const char *zAltBase;
const char *zFileGlob;
/* The winhttp module passes the --files option as --files-urlenc with
** the argument being URL encoded, to avoid wildcard expansion in the
** shell. This option is for internal use and is undocumented.
*/
zFileGlob = find_option("files-urlenc",0,1);
if( zFileGlob ){
char *z = mprintf("%s", zFileGlob);
dehttpize(z);
zFileGlob = z;
|
| ︙ | ︙ | |||
1693 1694 1695 1696 1697 1698 1699 | ** The repository argument may be omitted if the working directory is ** within an open checkout. ** ** The "ui" command automatically starts a web browser after initializing ** the web server. The "ui" command also binds to 127.0.0.1 and so will ** only process HTTP traffic from the local machine. ** | | | | 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 | ** The repository argument may be omitted if the working directory is ** within an open checkout. ** ** The "ui" command automatically starts a web browser after initializing ** the web server. The "ui" command also binds to 127.0.0.1 and so will ** only process HTTP traffic from the local machine. ** ** The REPOSITORY can be a directory (aka folder) that contains one or ** more repositories with names ending in ".fossil". In this case, the ** a prefix of the URL pathname is used to search the directory for an ** appropriate repository. To thwart mischief, the pathname in the URL must ** contain only alphanumerics, "_", "/", "-", and ".", and no "-" may ** occur after "/", and every "." must be surrounded on both sides by ** alphanumerics. Any pathname that does not satisfy these constraints ** results in a 404 error. Files in REPOSITORY that match the comma-separated ** list of glob patterns given by --files and that have known suffixes |
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
137 138 139 140 141 142 143 |
style_submenu_element("Add", "Add User", "setup_uedit");
style_header("User List");
@ <table class="usetupLayoutTable">
@ <tr><td class="usetupColumnLayout">
@ <span class="note">Users:</span>
@ <table class="usetupUserList">
prevLevel = 0;
| | | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
style_submenu_element("Add", "Add User", "setup_uedit");
style_header("User List");
@ <table class="usetupLayoutTable">
@ <tr><td class="usetupColumnLayout">
@ <span class="note">Users:</span>
@ <table class="usetupUserList">
prevLevel = 0;
db_prepare(&s,
"SELECT uid, login, cap, info, 1 FROM user"
" WHERE login IN ('anonymous','nobody','developer','reader') "
" UNION ALL "
"SELECT uid, login, cap, info, 2 FROM user"
" WHERE login NOT IN ('anonymous','nobody','developer','reader') "
"ORDER BY 5, 2"
);
|
| ︙ | ︙ | |||
248 249 250 251 252 253 254 |
@ user <tt>developer</tt></td></tr>
@ <tr><td valign="top"><b>w</b></td>
@ <td><i>Write-Tkt:</i> Edit tickets</td></tr>
@ <tr><td valign="top"><b>x</b></td>
@ <td><i>Private:</i> Push and/or pull private branches</td></tr>
@ <tr><td valign="top"><b>z</b></td>
@ <td><i>Zip download:</i> Download a baseline via the
| | | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
@ user <tt>developer</tt></td></tr>
@ <tr><td valign="top"><b>w</b></td>
@ <td><i>Write-Tkt:</i> Edit tickets</td></tr>
@ <tr><td valign="top"><b>x</b></td>
@ <td><i>Private:</i> Push and/or pull private branches</td></tr>
@ <tr><td valign="top"><b>z</b></td>
@ <td><i>Zip download:</i> Download a baseline via the
@ <tt>/zip</tt> URL even without
@ check<span class="capability">o</span>ut
@ and <span class="capability">h</span>istory permissions</td></tr>
@ </table>
@ </li>
@
@ <li><p>
@ Every user, logged in or not, inherits the privileges of
|
| ︙ | ︙ | |||
355 356 357 358 359 360 361 |
zLogin = P("login");
if( strlen(zLogin)==0 ){
style_header("User Creation Error");
@ <span class="loginError">Empty login not allowed.</span>
@
@ <p><a href="setup_uedit?id=%d(uid)">[Bummer]</a></p>
style_footer();
| | | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
zLogin = P("login");
if( strlen(zLogin)==0 ){
style_header("User Creation Error");
@ <span class="loginError">Empty login not allowed.</span>
@
@ <p><a href="setup_uedit?id=%d(uid)">[Bummer]</a></p>
style_footer();
return;
}
if( isValidPwString(zPw) ){
zPw = sha1_shared_secret(zPw, zLogin, 0);
}else{
zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid);
}
zOldLogin = db_text(0, "SELECT login FROM user WHERE uid=%d", uid);
|
| ︙ | ︙ | |||
392 393 394 395 396 397 398 |
blob_appendf(&sql,
"INSERT INTO user(login)"
" SELECT %Q WHERE NOT EXISTS(SELECT 1 FROM user WHERE login=%Q);",
zLogin, zLogin
);
zOldLogin = zLogin;
}
| | | 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
blob_appendf(&sql,
"INSERT INTO user(login)"
" SELECT %Q WHERE NOT EXISTS(SELECT 1 FROM user WHERE login=%Q);",
zLogin, zLogin
);
zOldLogin = zLogin;
}
blob_appendf(&sql,
"UPDATE user SET login=%Q,"
" pw=coalesce(shared_secret(%Q,%Q,"
"(SELECT value FROM config WHERE name='project-code')),pw),"
" info=%Q,"
" cap=%Q,"
" mtime=now()"
" WHERE login=%Q;",
|
| ︙ | ︙ | |||
641 642 643 644 645 646 647 | @ are inherited by all users with the <span class="capability">Reader</span> @ privilege. @ </p></li> @ @ <li><p> @ The <span class="capability">Delete</span> privilege give the user the @ ability to erase wiki, tickets, and attachments that have been added | | | 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | @ are inherited by all users with the <span class="capability">Reader</span> @ privilege. @ </p></li> @ @ <li><p> @ The <span class="capability">Delete</span> privilege give the user the @ ability to erase wiki, tickets, and attachments that have been added @ by anonymous users. This capability is intended for deletion of spam. @ The delete capability is only in effect for 24 hours after the item @ is first posted. The <span class="usertype">Setup</span> user can @ delete anything at any time. @ </p></li> @ @ <li><p> @ The <span class="capability">Hyperlinks</span> privilege allows a user |
| ︙ | ︙ | |||
698 699 700 701 702 703 704 | @ <span class="usertype">anonymous</span>, @ and <span class="usertype">nobody</span>. @ </p></li> @ @ <li><p> @ The <span class="capability">EMail</span> privilege allows the display of @ sensitive information such as the email address of users and contact | | | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | @ <span class="usertype">anonymous</span>, @ and <span class="usertype">nobody</span>. @ </p></li> @ @ <li><p> @ The <span class="capability">EMail</span> privilege allows the display of @ sensitive information such as the email address of users and contact @ information on tickets. Recommended OFF for @ <span class="usertype">anonymous</span> and for @ <span class="usertype">nobody</span> but ON for @ <span class="usertype">developer</span>. @ </p></li> @ @ <li><p> @ The <span class="capability">Attachment</span> privilege is needed in |
| ︙ | ︙ | |||
722 723 724 725 726 727 728 | @ <h2>Special Logins</h2> @ @ <ul> @ <li><p> @ No login is required for user <span class="usertype">nobody</span>. The @ capabilities of the <span class="usertype">nobody</span> user are @ inherited by all users, regardless of whether or not they are logged in. | | | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | @ <h2>Special Logins</h2> @ @ <ul> @ <li><p> @ No login is required for user <span class="usertype">nobody</span>. The @ capabilities of the <span class="usertype">nobody</span> user are @ inherited by all users, regardless of whether or not they are logged in. @ To disable universal access to the repository, make sure no user named @ <span class="usertype">nobody</span> exists or that the @ <span class="usertype">nobody</span> user has no capabilities @ enabled. The password for <span class="usertype">nobody</span> is ignore. @ To avoid problems with spiders overloading the server, it is recommended @ that the <span class="capability">h</span> (Hyperlinks) capability be @ turned off for the <span class="usertype">nobody</span> user. @ </p></li> |
| ︙ | ︙ | |||
747 748 749 750 751 752 753 | @ <span class="usertype">anonymous</span>. @ </p></li> @ @ <li><p> @ The <span class="usertype">developer</span> user is intended as a template @ for trusted users with check-in privileges. When adding new trusted users, @ simply select the <span class="capability">developer</span> privilege to | | | | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 | @ <span class="usertype">anonymous</span>. @ </p></li> @ @ <li><p> @ The <span class="usertype">developer</span> user is intended as a template @ for trusted users with check-in privileges. When adding new trusted users, @ simply select the <span class="capability">developer</span> privilege to @ cause the new user to inherit all privileges of the @ <span class="usertype">developer</span> @ user. Similarly, the <span class="usertype">reader</span> user is a @ template for users who are allowed more access than @ <span class="usertype">anonymous</span>, @ but less than a <span class="usertype">developer</span>. @ </p></li> @ </ul> style_footer(); } |
| ︙ | ︙ | |||
831 832 833 834 835 836 837 |
login_verify_csrf_secret();
db_set(zVar, zQ, 0);
z = zQ;
}
if( rows>0 && cols>0 ){
@ <textarea id="id%s(zQP)" name="%s(zQP)" rows="%d(rows)"
@ cols="%d(cols)">%h(z)</textarea>
| | | 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 |
login_verify_csrf_secret();
db_set(zVar, zQ, 0);
z = zQ;
}
if( rows>0 && cols>0 ){
@ <textarea id="id%s(zQP)" name="%s(zQP)" rows="%d(rows)"
@ cols="%d(cols)">%h(z)</textarea>
if( zLabel && *zLabel ){
@ <span class="textareaLabel">%s(zLabel)</span>
}
}
}
/*
|
| ︙ | ︙ | |||
893 894 895 896 897 898 899 |
"remote_user_ok", "remote_user_ok", 0);
@ <p>When enabled, if the REMOTE_USER environment variable is set to the
@ login name of a valid user and no other login credentials are available,
@ then the REMOTE_USER is accepted as an authenticated user.
@ </p>
@
@ <hr />
| | | 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 |
"remote_user_ok", "remote_user_ok", 0);
@ <p>When enabled, if the REMOTE_USER environment variable is set to the
@ login name of a valid user and no other login credentials are available,
@ then the REMOTE_USER is accepted as an authenticated user.
@ </p>
@
@ <hr />
entry_attribute("IP address terms used in login cookie", 3,
"ip-prefix-terms", "ipt", "2");
@ <p>The number of octets of of the IP address used in the login cookie.
@ Set to zero to omit the IP address from the login cookie. A value of
@ 2 is recommended.
@ </p>
@
@ <hr />
|
| ︙ | ︙ | |||
956 957 958 959 960 961 962 |
@ <hr />
entry_attribute("Public pages", 30, "public-pages",
"pubpage", "");
@ <p>A comma-separated list of glob patterns for pages that are accessible
@ without needing a login and using the privileges given by the
@ "Default privileges" setting below. Example use case: Set this field
| | | | | | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 |
@ <hr />
entry_attribute("Public pages", 30, "public-pages",
"pubpage", "");
@ <p>A comma-separated list of glob patterns for pages that are accessible
@ without needing a login and using the privileges given by the
@ "Default privileges" setting below. Example use case: Set this field
@ to "/doc/trunk/www/*" to give anonymous users read-only permission to the
@ latest version of the embedded documentation in the www/ folder without
@ allowing them to see the rest of the source code.
@ </p>
@ <hr />
onoff_attribute("Allow users to register themselves",
"self-register", "selfregister", 0);
@ <p>Allow users to register themselves through the HTTP UI.
@ The registration form always requires filling in a CAPTCHA
@ (<em>auto-captcha</em> setting is ignored). Still, bear in mind that anyone
@ can register under any user name. This option is useful for public projects
@ where you do not want everyone in any ticket discussion to be named
@ "Anonymous".</p>
@ <hr />
entry_attribute("Default privileges", 10, "default-perms",
"defaultperms", "u");
@ <p>Permissions given to users that... <ul><li>register themselves using
@ the self-registration procedure (if enabled), or <li>access "public"
|
| ︙ | ︙ | |||
1126 1127 1128 1129 1130 1131 1132 |
@ <hr />
onoff_attribute("Use Universal Coordinated Time (UTC)",
"timeline-utc", "utc", 1);
@ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
@ Zulu) instead of in local time. On this server, local time is currently
g.fTimeFormat = 2;
tmDiff = db_double(0.0, "SELECT julianday('now')");
| | | 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 |
@ <hr />
onoff_attribute("Use Universal Coordinated Time (UTC)",
"timeline-utc", "utc", 1);
@ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
@ Zulu) instead of in local time. On this server, local time is currently
g.fTimeFormat = 2;
tmDiff = db_double(0.0, "SELECT julianday('now')");
tmDiff = db_double(0.0,
"SELECT (julianday(%.17g,'localtime')-julianday(%.17g))*24.0",
tmDiff, tmDiff);
sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", tmDiff);
if( strcmp(zTmDiff, "0.0")==0 ){
@ the same as UTC and so this setting will make no difference in
@ the display.</p>
}else if( tmDiff<0.0 ){
|
| ︙ | ︙ | |||
1448 1449 1450 1451 1452 1453 1454 |
login_insert_csrf_secret();
@ <hr />
onoff_attribute("Moderate ticket changes",
"modreq-tkt", "modreq-tkt", 0);
@ <p>When enabled, any change to tickets is subject to the approval
@ a ticket moderator - a user with the "q" or Mod-Tkt privilege.
@ Ticket changes enter the system and are shown locally, but are not
| | | | | 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 |
login_insert_csrf_secret();
@ <hr />
onoff_attribute("Moderate ticket changes",
"modreq-tkt", "modreq-tkt", 0);
@ <p>When enabled, any change to tickets is subject to the approval
@ a ticket moderator - a user with the "q" or Mod-Tkt privilege.
@ Ticket changes enter the system and are shown locally, but are not
@ synced until they are approved. The moderator has the option to
@ delete the change rather than approve it. Ticket changes made by
@ a user who hwas the Mod-Tkt privilege are never subject to
@ moderation.
@
@ <hr />
onoff_attribute("Moderate wiki changes",
"modreq-wiki", "modreq-wiki", 0);
@ <p>When enabled, any change to wiki is subject to the approval
@ a ticket moderator - a user with the "l" or Mod-Wiki privilege.
@ Wiki changes enter the system and are shown locally, but are not
@ synced until they are approved. The moderator has the option to
@ delete the change rather than approve it. Wiki changes made by
@ a user who has the Mod-Wiki privilege are never subject to
@ moderation.
@ </p>
@ <hr />
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@ </div></form>
db_end_transaction(0);
style_footer();
}
|
| ︙ | ︙ |