Fossil: Check-in [4de1ed780c]

Fossil SCM

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

Overview
Comment:Merged in [grep-hash-digits] branch. See https://fossil-scm.org/forum/forumpost/44c8339561
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:4de1ed780c60524d550a834949efa036b5b4c045ced19a03f876023b785b53f1
User & Date: stephan 2019-11-19 15:12:34
Context
2019-11-20
15:25
Add support for Markdown in the default ticket configuration, and make Markdown the default choice for markup. check-in: 16fb915279 user: drh tags: trunk
2019-11-19
15:12
Merged in [grep-hash-digits] branch. See https://fossil-scm.org/forum/forumpost/44c8339561 check-in: 4de1ed780c user: stephan tags: trunk
2019-11-18
07:29
When editing a technote via HTTP GET request (e.g., an Edit link, as opposed to POST form submission), retain the previous version's custom color by default. check-in: 346e9e9760 user: stephan tags: trunk
2019-11-15
02:31
Modified grep command to respect the hash-digits config option. Closed-Leaf check-in: dccab378ce user: stephan tags: grep-hash-digits
Changes

Changes to src/regexp.c.

735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
...
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
  for(i=j=ln=cnt=0; z[i]; i=j+1){
    for(j=i; z[j] && z[j]!='\n'; j++){}
    n = j - i;
    ln++;
    if( re_match(pRe, (const unsigned char*)(z+i), j-i) ){
      cnt++;
      if( flags & GREP_EXISTS ){
        fossil_print("%s\n", zName);
        break;
      }
      fossil_print("%s:%d:%.*s\n", zName, ln, n, z+i);
    }
  }
  return cnt;
}

/*
** COMMAND: test-grep
................................................................................
  if( file_tree_name(g.argv[3], &fullName, 0, 0) ){
    int fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q",
                      blob_str(&fullName));
    if( fnid ){
      Stmt q;
      add_content_sql_commands(g.db);
      db_prepare(&q,
        "SELECT content(ux), substr(ux,1,10) FROM ("
        "  SELECT blob.uuid AS ux, min(event.mtime) AS mx"
        "    FROM mlink, blob, event"
        "   WHERE mlink.mid=event.objid"
        "     AND mlink.fid=blob.rid"
        "     AND mlink.fnid=%d"
        "   GROUP BY blob.uuid"
        ") ORDER BY mx DESC;",
        fnid
      );
      while( db_step(&q)==SQLITE_ROW ){
        if( bVerbose ) fossil_print("%s:\n", db_column_text(&q,1));
        grep_buffer(pRe, db_column_text(&q,1), db_column_text(&q,0), flags);
      }
      db_finalize(&q);
    }
  }
}







|


|







 







|










|






735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
...
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
  for(i=j=ln=cnt=0; z[i]; i=j+1){
    for(j=i; z[j] && z[j]!='\n'; j++){}
    n = j - i;
    ln++;
    if( re_match(pRe, (const unsigned char*)(z+i), j-i) ){
      cnt++;
      if( flags & GREP_EXISTS ){
        fossil_print("%S\n", zName);
        break;
      }
      fossil_print("%S:%d:%.*s\n", zName, ln, n, z+i);
    }
  }
  return cnt;
}

/*
** COMMAND: test-grep
................................................................................
  if( file_tree_name(g.argv[3], &fullName, 0, 0) ){
    int fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q",
                      blob_str(&fullName));
    if( fnid ){
      Stmt q;
      add_content_sql_commands(g.db);
      db_prepare(&q,
        "SELECT content(ux), ux FROM ("
        "  SELECT blob.uuid AS ux, min(event.mtime) AS mx"
        "    FROM mlink, blob, event"
        "   WHERE mlink.mid=event.objid"
        "     AND mlink.fid=blob.rid"
        "     AND mlink.fnid=%d"
        "   GROUP BY blob.uuid"
        ") ORDER BY mx DESC;",
        fnid
      );
      while( db_step(&q)==SQLITE_ROW ){
        if( bVerbose ) fossil_print("%S:\n", db_column_text(&q,1));
        grep_buffer(pRe, db_column_text(&q,1), db_column_text(&q,0), flags);
      }
      db_finalize(&q);
    }
  }
}