Fossil

Check-in [e0f5d4734a]
Login

Check-in [e0f5d4734a]

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

Overview
Comment:Inline uuid_to_rid and content_size. Saves one SQL statement per file in the checkout.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0f5d4734ac825893e7feb963efd50574a17534b
User & Date: joerg 2011-03-09 00:09:30.569
Context
2011-03-09
00:15
Add a utility for generating gzip-compressed files. This is one step on the road toward the ability to generated compressed tarballs. ... (check-in: 34d9a5e5c5 user: drh tags: trunk)
00:09
Inline uuid_to_rid and content_size. Saves one SQL statement per file in the checkout. ... (check-in: e0f5d4734a user: joerg tags: trunk)
2011-03-08
22:13
Fix diffs from or to an empty file to use the special position marker 0,0. Makes "fossil diff -N" create patches that are accepted by patch. ... (check-in: 4e77507e70 user: joerg tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vfile.c.
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

92
93
94
95





96



97
98
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
  return rid;
}

/*
** Build a catalog of all files in a checkin.
*/
void vfile_build(int vid){
  int rid;
  Stmt ins;
  Manifest *p;
  ManifestFile *pFile;

  db_begin_transaction();
  p = manifest_get(vid, CFTYPE_MANIFEST);
  if( p==0 ) return;
  db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid);
  db_prepare(&ins,
    "INSERT INTO vfile(vid,isexe,rid,mrid,pathname) "
    " VALUES(:vid,:isexe,:id,:id,:name)");

  db_bind_int(&ins, ":vid", vid);
  manifest_file_rewind(p);
  while( (pFile = manifest_file_next(p,0))!=0 ){
    if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue;





    rid = uuid_to_rid(pFile->zUuid, 0);



    if( rid==0 || content_size(rid, -1)<0 ){
      fossil_warning("content missing for %s", pFile->zName);
      continue;
    }
    db_bind_int(&ins, ":isexe", manifest_file_mperm(pFile));
    db_bind_int(&ins, ":id", rid);
    db_bind_text(&ins, ":name", pFile->zName);
    db_step(&ins);
    db_reset(&ins);
  }

  db_finalize(&ins);
  manifest_destroy(p);
  db_end_transaction(0);
}

/*
** Check the file signature of the disk image for every VFILE of vid.







|
|










>




>
>
>
>
>
|
>
>
>
|









>







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
  return rid;
}

/*
** Build a catalog of all files in a checkin.
*/
void vfile_build(int vid){
  int rid, size;
  Stmt ins, ridq;
  Manifest *p;
  ManifestFile *pFile;

  db_begin_transaction();
  p = manifest_get(vid, CFTYPE_MANIFEST);
  if( p==0 ) return;
  db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid);
  db_prepare(&ins,
    "INSERT INTO vfile(vid,isexe,rid,mrid,pathname) "
    " VALUES(:vid,:isexe,:id,:id,:name)");
  db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid");
  db_bind_int(&ins, ":vid", vid);
  manifest_file_rewind(p);
  while( (pFile = manifest_file_next(p,0))!=0 ){
    if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue;
    db_bind_text(&ridq, ":uuid", pFile->zUuid);
    if( db_step(&ridq)==SQLITE_ROW ){
      rid = db_column_int(&ridq, 0);
      size = db_column_int(&ridq, 0);
    }else{
      rid = 0;
      size = 0;
    }
    db_reset(&ridq);
    if( rid==0 || size<0 ){
      fossil_warning("content missing for %s", pFile->zName);
      continue;
    }
    db_bind_int(&ins, ":isexe", manifest_file_mperm(pFile));
    db_bind_int(&ins, ":id", rid);
    db_bind_text(&ins, ":name", pFile->zName);
    db_step(&ins);
    db_reset(&ins);
  }
  db_finalize(&ridq);
  db_finalize(&ins);
  manifest_destroy(p);
  db_end_transaction(0);
}

/*
** Check the file signature of the disk image for every VFILE of vid.