Fossil

Check-in [a040ae6e17]
Login

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

Overview
Comment:Write the new manifest file to the root of the check-out tree when doing an update.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a040ae6e17e68b6f4de4ff7f3ec6ebee940c0ff3
User & Date: drh 2007-08-08 15:18:53.000
Context
2007-08-08
15:22
Make sure a user does not attempt to "fossil add" the manifest or the _FOSSIL_ files. check-in: 20bcbcf2f2 user: drh tags: trunk
15:18
Write the new manifest file to the root of the check-out tree when doing an update. check-in: a040ae6e17 user: drh tags: trunk
14:45
Omit the files "manifest" and "_FOSSIL_" from the "extra" list. check-in: 77327ae14e user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/checkout.c.
87
88
89
90
91
92
93
















94
95
96
97
98
99
100
  if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){
    return;
  }
  content_get(vid, &manifest);
  vfile_build(vid, &manifest);
  blob_reset(&manifest);
}

















/*
** COMMAND: checkout
**
** Check out a version specified on the command-line.
*/
void checkout_cmd(void){







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
  if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){
    return;
  }
  content_get(vid, &manifest);
  vfile_build(vid, &manifest);
  blob_reset(&manifest);
}

/*
** Read the manifest file given by vid out of the repository
** and store it in the root of the local check-out.
*/
void manifest_to_disk(int vid){
  char *zManFile;
  Blob manifest;

  blob_zero(&manifest);
  zManFile = mprintf("%smanifest", g.zLocalRoot);
  content_get(vid, &manifest);
  blob_write_to_file(&manifest, zManFile);
  free(zManFile);
  blob_reset(&manifest);
}

/*
** COMMAND: checkout
**
** Check out a version specified on the command-line.
*/
void checkout_cmd(void){
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
    return;
  }
  if( !noWrite ){
    uncheckout(prior);
  }
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
  if( !noWrite ){
    Blob manifest;
    char *zManFile;
    vfile_to_disk(vid, 0, 1);
    blob_zero(&manifest);
    zManFile = mprintf("%smanifest", g.zLocalRoot);
    content_get(vid, &manifest);
    blob_write_to_file(&manifest, zManFile);
    free(zManFile);
    db_lset_int("checkout", vid);
  }
  db_multi_exec("DELETE FROM vmerge");
  vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
  vfile_aggregate_checksum_disk(vid, &cksum2);
  if( blob_compare(&cksum1, &cksum2) ){
    printf("WARNING: manifest checksum does not agree with disk\n");
  }
  if( blob_compare(&cksum1, &cksum1b) ){
    printf("WARNING: manifest checksum does not agree with manifest\n");
  }
  db_end_transaction(0);
}







<
<

|
<
<
<
<













138
139
140
141
142
143
144


145
146




147
148
149
150
151
152
153
154
155
156
157
158
159
    return;
  }
  if( !noWrite ){
    uncheckout(prior);
  }
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
  if( !noWrite ){


    vfile_to_disk(vid, 0, 1);
    manifest_to_disk(vid);




    db_lset_int("checkout", vid);
  }
  db_multi_exec("DELETE FROM vmerge");
  vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
  vfile_aggregate_checksum_disk(vid, &cksum2);
  if( blob_compare(&cksum1, &cksum2) ){
    printf("WARNING: manifest checksum does not agree with disk\n");
  }
  if( blob_compare(&cksum1, &cksum1b) ){
    printf("WARNING: manifest checksum does not agree with manifest\n");
  }
  db_end_transaction(0);
}
Changes to src/update.c.
172
173
174
175
176
177
178

179
180
181
  }
  db_finalize(&q);
  
  /*
  ** Clean up the mid and pid VFILE entries.  Then commit the changes.
  */
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);

  db_lset_int("checkout", tid);
  db_end_transaction(0);
}







>



172
173
174
175
176
177
178
179
180
181
182
  }
  db_finalize(&q);
  
  /*
  ** Clean up the mid and pid VFILE entries.  Then commit the changes.
  */
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
  manifest_to_disk(tid);
  db_lset_int("checkout", tid);
  db_end_transaction(0);
}