Fossil

Check-in [25d0049045]
Login

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

Overview
Comment:Adapt other callers of print_timeline(), so they show as well whether the limit was reached.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline_cmd_dash_n_fix
Files: files | file ages | folders
SHA1: 25d0049045e2caa75d5b22868dc7fec57f702610
User & Date: jan.nijtmans 2013-10-22 07:46:45.147
Context
2013-10-25
12:42
Merge trunk. Add the "-W|--width WIDTH" option to "fossil timeline". Default is 80. check-in: 3710f2ac5b user: jan.nijtmans tags: timeline_cmd_dash_n_fix
2013-10-22
07:46
Adapt other callers of print_timeline(), so they show as well whether the limit was reached. check-in: 25d0049045 user: jan.nijtmans tags: timeline_cmd_dash_n_fix
07:41
Correctly determine whether the limit was really reached, this time without my mistake in [d54ada1cea] which didn't handle "-n 0" correctly. check-in: feb175065c user: jan.nijtmans tags: timeline_cmd_dash_n_fix
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/search.c.
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  Blob sql = empty_blob;
  Stmt q;
  int iBest;
  char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
                                                     off the end of the
                                                     results. */
  char const * zLimit = find_option("limit","n",1);
  int const nLimit = zLimit ? atoi(zLimit) : 0; /* Max number of matching
                                                   lines/entries to list */

  db_must_be_within_tree();
  if( g.argc<2 ) return;
  blob_init(&pattern, g.argv[2], -1);
  for(i=3; i<g.argc; i++){
    blob_appendf(&pattern, " %s", g.argv[i]);







|







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  Blob sql = empty_blob;
  Stmt q;
  int iBest;
  char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
                                                     off the end of the
                                                     results. */
  char const * zLimit = find_option("limit","n",1);
  int const nLimit = zLimit ? atoi(zLimit) : -20; /* Max number of matching
                                                   lines/entries to list */

  db_must_be_within_tree();
  if( g.argc<2 ) return;
  blob_init(&pattern, g.argv[2], -1);
  for(i=3; i<g.argc; i++){
    blob_appendf(&pattern, " %s", g.argv[i]);
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
  blob_append(&sql,
              "SELECT rid, uuid, date, comment, 0, 0 FROM srch "
              "WHERE 1 ", -1);
  if(!fAll){
    blob_appendf(&sql,"AND x>%d ", iBest/3);
  }
  blob_append(&sql, "ORDER BY x DESC, date DESC ", -1);
  if(nLimit>0){
    blob_appendf(&sql, "LIMIT %d", nLimit);
  }
  db_prepare(&q, blob_str(&sql));
  blob_reset(&sql);
  print_timeline(&q, nLimit, 0);
  db_finalize(&q);
}







<
<
<





218
219
220
221
222
223
224



225
226
227
228
229
  blob_append(&sql,
              "SELECT rid, uuid, date, comment, 0, 0 FROM srch "
              "WHERE 1 ", -1);
  if(!fAll){
    blob_appendf(&sql,"AND x>%d ", iBest/3);
  }
  blob_append(&sql, "ORDER BY x DESC, date DESC ", -1);



  db_prepare(&q, blob_str(&sql));
  blob_reset(&sql);
  print_timeline(&q, nLimit, 0);
  db_finalize(&q);
}
Changes to src/tag.c.
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
          "  AND blob.rid IN ("
                    " SELECT rid FROM tagxref"
                    "  WHERE tagtype>0 AND tagid=%d"
                    ")"
          " ORDER BY event.mtime DESC",
          timeline_query_for_tty(), zType, tagid
        );
        if(nFindLimit>0){
          blob_appendf(&sql, " LIMIT %d", nFindLimit);
        }
        db_prepare(&q, "%s", blob_str(&sql));
        blob_reset(&sql);
        print_timeline(&q, nFindLimit, 0);
        db_finalize(&q);
      }
    }
  }else







<
<
<







465
466
467
468
469
470
471



472
473
474
475
476
477
478
          "  AND blob.rid IN ("
                    " SELECT rid FROM tagxref"
                    "  WHERE tagtype>0 AND tagid=%d"
                    ")"
          " ORDER BY event.mtime DESC",
          timeline_query_for_tty(), zType, tagid
        );



        db_prepare(&q, "%s", blob_str(&sql));
        blob_reset(&sql);
        print_timeline(&q, nFindLimit, 0);
        db_finalize(&q);
      }
    }
  }else