Fossil SCM
Begin refactoring forum code to support orthogonal history and plaintext options. First step: rename pEdit to pEditPrev to make room for a pEditNext field.
Commit
636f6596892306725514069f6b63c343979a28928f77a677dc2eb2f11608f89b
Parent
273dd80e85ff565…
1 file changed
+8
-8
+8
-8
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | int mfirt; /* Root in-reply-to */ |
| 40 | 40 | int nReply; /* Number of replies to this entry */ |
| 41 | 41 | int sid; /* Serial ID number */ |
| 42 | 42 | char *zUuid; /* Artifact hash */ |
| 43 | 43 | ForumEntry *pLeaf; /* Most recent edit for this entry */ |
| 44 | - ForumEntry *pEdit; /* This entry is an edit of pEdit */ | |
| 44 | + ForumEntry *pEditPrev; /* This entry is an edit of pEditPrev */ | |
| 45 | 45 | ForumEntry *pNext; /* Next in chronological order */ |
| 46 | 46 | ForumEntry *pPrev; /* Previous in chronological order */ |
| 47 | 47 | ForumEntry *pDisplay; /* Next in display order */ |
| 48 | 48 | int nIndent; /* Number of levels of indentation for this entry */ |
| 49 | 49 | }; |
| @@ -199,15 +199,15 @@ | ||
| 199 | 199 | */ |
| 200 | 200 | for(pEntry=pThread->pFirst; pEntry; pEntry=pEntry->pNext){ |
| 201 | 201 | if( pEntry->fprev ){ |
| 202 | 202 | ForumEntry *pBase = 0, *p; |
| 203 | 203 | p = forumentry_backward(pEntry->pPrev, pEntry->fprev); |
| 204 | - pEntry->pEdit = p; | |
| 204 | + pEntry->pEditPrev = p; | |
| 205 | 205 | while( p ){ |
| 206 | 206 | pBase = p; |
| 207 | 207 | p->pLeaf = pEntry; |
| 208 | - p = pBase->pEdit; | |
| 208 | + p = pBase->pEditPrev; | |
| 209 | 209 | } |
| 210 | 210 | for(p=pEntry->pNext; p; p=p->pNext){ |
| 211 | 211 | if( p->mfirt==pEntry->fpid ) p->mfirt = pBase->fpid; |
| 212 | 212 | } |
| 213 | 213 | } |
| @@ -433,17 +433,17 @@ | ||
| 433 | 433 | if( pPost->zThreadTitle ){ |
| 434 | 434 | @ <h1>%h(pPost->zThreadTitle)</h1> |
| 435 | 435 | } |
| 436 | 436 | zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate); |
| 437 | 437 | zDisplayName = display_name_from_login(pPost->zUser); |
| 438 | - sid = p->pEdit ? p->pEdit->sid : p->sid; | |
| 438 | + sid = p->pEditPrev ? p->pEditPrev->sid : p->sid; | |
| 439 | 439 | @ <h3 class='forumPostHdr'>(%d(sid)) By %h(zDisplayName) on %h(zDate) |
| 440 | 440 | fossil_free(zDisplayName); |
| 441 | 441 | fossil_free(zDate); |
| 442 | - if( p->pEdit ){ | |
| 443 | - @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\ | |
| 444 | - @ %d(p->pEdit->sid)</a> | |
| 442 | + if( p->pEditPrev ){ | |
| 443 | + @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEditPrev->zUuid,cMode))\ | |
| 444 | + @ %d(p->pEditPrev->sid)</a> | |
| 445 | 445 | } |
| 446 | 446 | if( g.perm.Debug ){ |
| 447 | 447 | @ <span class="debug">\ |
| 448 | 448 | @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span> |
| 449 | 449 | } |
| @@ -638,11 +638,11 @@ | ||
| 638 | 638 | int iIndentScale = 4; |
| 639 | 639 | |
| 640 | 640 | pThread = forumthread_create(froot, 1); |
| 641 | 641 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 642 | 642 | if( p->fpid==target ){ |
| 643 | - while( p->pEdit ) p = p->pEdit; | |
| 643 | + while( p->pEditPrev ) p = p->pEditPrev; | |
| 644 | 644 | target = p->fpid; |
| 645 | 645 | break; |
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | while( iIndentScale>1 && iIndentScale*pThread->mxIndent>25 ){ |
| 649 | 649 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | int mfirt; /* Root in-reply-to */ |
| 40 | int nReply; /* Number of replies to this entry */ |
| 41 | int sid; /* Serial ID number */ |
| 42 | char *zUuid; /* Artifact hash */ |
| 43 | ForumEntry *pLeaf; /* Most recent edit for this entry */ |
| 44 | ForumEntry *pEdit; /* This entry is an edit of pEdit */ |
| 45 | ForumEntry *pNext; /* Next in chronological order */ |
| 46 | ForumEntry *pPrev; /* Previous in chronological order */ |
| 47 | ForumEntry *pDisplay; /* Next in display order */ |
| 48 | int nIndent; /* Number of levels of indentation for this entry */ |
| 49 | }; |
| @@ -199,15 +199,15 @@ | |
| 199 | */ |
| 200 | for(pEntry=pThread->pFirst; pEntry; pEntry=pEntry->pNext){ |
| 201 | if( pEntry->fprev ){ |
| 202 | ForumEntry *pBase = 0, *p; |
| 203 | p = forumentry_backward(pEntry->pPrev, pEntry->fprev); |
| 204 | pEntry->pEdit = p; |
| 205 | while( p ){ |
| 206 | pBase = p; |
| 207 | p->pLeaf = pEntry; |
| 208 | p = pBase->pEdit; |
| 209 | } |
| 210 | for(p=pEntry->pNext; p; p=p->pNext){ |
| 211 | if( p->mfirt==pEntry->fpid ) p->mfirt = pBase->fpid; |
| 212 | } |
| 213 | } |
| @@ -433,17 +433,17 @@ | |
| 433 | if( pPost->zThreadTitle ){ |
| 434 | @ <h1>%h(pPost->zThreadTitle)</h1> |
| 435 | } |
| 436 | zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate); |
| 437 | zDisplayName = display_name_from_login(pPost->zUser); |
| 438 | sid = p->pEdit ? p->pEdit->sid : p->sid; |
| 439 | @ <h3 class='forumPostHdr'>(%d(sid)) By %h(zDisplayName) on %h(zDate) |
| 440 | fossil_free(zDisplayName); |
| 441 | fossil_free(zDate); |
| 442 | if( p->pEdit ){ |
| 443 | @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\ |
| 444 | @ %d(p->pEdit->sid)</a> |
| 445 | } |
| 446 | if( g.perm.Debug ){ |
| 447 | @ <span class="debug">\ |
| 448 | @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span> |
| 449 | } |
| @@ -638,11 +638,11 @@ | |
| 638 | int iIndentScale = 4; |
| 639 | |
| 640 | pThread = forumthread_create(froot, 1); |
| 641 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 642 | if( p->fpid==target ){ |
| 643 | while( p->pEdit ) p = p->pEdit; |
| 644 | target = p->fpid; |
| 645 | break; |
| 646 | } |
| 647 | } |
| 648 | while( iIndentScale>1 && iIndentScale*pThread->mxIndent>25 ){ |
| 649 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | int mfirt; /* Root in-reply-to */ |
| 40 | int nReply; /* Number of replies to this entry */ |
| 41 | int sid; /* Serial ID number */ |
| 42 | char *zUuid; /* Artifact hash */ |
| 43 | ForumEntry *pLeaf; /* Most recent edit for this entry */ |
| 44 | ForumEntry *pEditPrev; /* This entry is an edit of pEditPrev */ |
| 45 | ForumEntry *pNext; /* Next in chronological order */ |
| 46 | ForumEntry *pPrev; /* Previous in chronological order */ |
| 47 | ForumEntry *pDisplay; /* Next in display order */ |
| 48 | int nIndent; /* Number of levels of indentation for this entry */ |
| 49 | }; |
| @@ -199,15 +199,15 @@ | |
| 199 | */ |
| 200 | for(pEntry=pThread->pFirst; pEntry; pEntry=pEntry->pNext){ |
| 201 | if( pEntry->fprev ){ |
| 202 | ForumEntry *pBase = 0, *p; |
| 203 | p = forumentry_backward(pEntry->pPrev, pEntry->fprev); |
| 204 | pEntry->pEditPrev = p; |
| 205 | while( p ){ |
| 206 | pBase = p; |
| 207 | p->pLeaf = pEntry; |
| 208 | p = pBase->pEditPrev; |
| 209 | } |
| 210 | for(p=pEntry->pNext; p; p=p->pNext){ |
| 211 | if( p->mfirt==pEntry->fpid ) p->mfirt = pBase->fpid; |
| 212 | } |
| 213 | } |
| @@ -433,17 +433,17 @@ | |
| 433 | if( pPost->zThreadTitle ){ |
| 434 | @ <h1>%h(pPost->zThreadTitle)</h1> |
| 435 | } |
| 436 | zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate); |
| 437 | zDisplayName = display_name_from_login(pPost->zUser); |
| 438 | sid = p->pEditPrev ? p->pEditPrev->sid : p->sid; |
| 439 | @ <h3 class='forumPostHdr'>(%d(sid)) By %h(zDisplayName) on %h(zDate) |
| 440 | fossil_free(zDisplayName); |
| 441 | fossil_free(zDate); |
| 442 | if( p->pEditPrev ){ |
| 443 | @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEditPrev->zUuid,cMode))\ |
| 444 | @ %d(p->pEditPrev->sid)</a> |
| 445 | } |
| 446 | if( g.perm.Debug ){ |
| 447 | @ <span class="debug">\ |
| 448 | @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span> |
| 449 | } |
| @@ -638,11 +638,11 @@ | |
| 638 | int iIndentScale = 4; |
| 639 | |
| 640 | pThread = forumthread_create(froot, 1); |
| 641 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 642 | if( p->fpid==target ){ |
| 643 | while( p->pEditPrev ) p = p->pEditPrev; |
| 644 | target = p->fpid; |
| 645 | break; |
| 646 | } |
| 647 | } |
| 648 | while( iIndentScale>1 && iIndentScale*pThread->mxIndent>25 ){ |
| 649 |