Fossil

Check-in [9659ed66]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the distinction between open and closed branches. An open branch is a branch with one or more open leaves. Show open and closed branches separately on the "Branches" webpage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9659ed66f83f895246b4f128e1dca1c6d5736cc0
User & Date: drh 2009-01-23 23:57:11
Context
2009-01-24
00:11
Add a "nomenclature" sidebox for the Branches page, explaining the difference between an open and a closed branch. check-in: 83ac468a user: drh tags: trunk
2009-01-23
23:57
Make the distinction between open and closed branches. An open branch is a branch with one or more open leaves. Show open and closed branches separately on the "Branches" webpage. check-in: 9659ed66 user: drh tags: trunk
22:20
Update the timeline so that it's use of "Leaf" conforms to the definition given in the documentation. check-in: cb31e908 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/branch.c.

218
219
220
221
222
223
224

225
226
227
228
229
230
231












232
233













234
235
236




237
238
239
240
241





242
243
244
245
246



247
248
249
250
251
252
253
/*
** WEBPAGE: brlist
**
** Show a timeline of all branches
*/
void brlist_page(void){
  Stmt q;


  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }

  style_header("Branches");
  style_submenu_element("Timeline", "Timeline", "brtimeline");
  login_anonymous_available();












  @ <h2>Branches:</h2>
  @ <ul>













  db_prepare(&q,
    "SELECT DISTINCT value FROM tagxref"
    " WHERE tagid=%d AND srcid!=0 AND value NOT NULL"




    " ORDER BY value",
    TAG_BRANCH
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zBr = db_column_text(&q, 0);





    if( g.okHistory ){
      @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
    }else{
      @ <li><b>%h(zBr)</b></li>
    }



  }
  db_finalize(&q);
  @ </ul>
  @ <br clear="both">
  @ <script>
  @ function xin(id){
  @ }







>







>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>

|
|
>
>
>
>

|



>
>
>
>
>





>
>
>







218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
/*
** WEBPAGE: brlist
**
** Show a timeline of all branches
*/
void brlist_page(void){
  Stmt q;
  int cnt;

  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }

  style_header("Branches");
  style_submenu_element("Timeline", "Timeline", "brtimeline");
  login_anonymous_available();
  compute_leaves(0, 1);
  db_prepare(&q,
    "SELECT DISTINCT value FROM tagxref"
    " WHERE tagid=%d AND value NOT NULL"
    "   AND rid IN leaves"
    " ORDER BY value",
    TAG_BRANCH
  );
  cnt = 0;
  while( db_step(&q)==SQLITE_ROW ){
    const char *zBr = db_column_text(&q, 0);
    if( cnt==0 ){
      @ <h2>Open Branches:</h2>
      @ <ul>
      cnt++;
    }
    if( g.okHistory ){
      @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
    }else{
      @ <li><b>%h(zBr)</b></li>
    }
  }
  db_finalize(&q);
  if( cnt ){
    @ </ul>
  }
  cnt = 0;
  db_prepare(&q,
    "SELECT value FROM tagxref"
    " WHERE tagid=%d AND value NOT NULL"
    " EXCEPT "
    "SELECT value FROM tagxref"
    " WHERE tagid=%d AND value NOT NULL"
    "   AND rid IN leaves"
    " ORDER BY value",
    TAG_BRANCH, TAG_BRANCH
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zBr = db_column_text(&q, 0);
    if( cnt==0 ){
      @ <h2>Closed Branches:</h2>
      @ <ul>
      cnt++;     
    }
    if( g.okHistory ){
      @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
    }else{
      @ <li><b>%h(zBr)</b></li>
    }
  }
  if( cnt ){
    @ </ul>
  }
  db_finalize(&q);
  @ </ul>
  @ <br clear="both">
  @ <script>
  @ function xin(id){
  @ }