Fossil SCM

Write the new manifest file to the root of the check-out tree when doing an update.

drh 2007-08-08 15:18 trunk
Commit a040ae6e17e68b6f4de4ff7f3ec6ebee940c0ff3
2 files changed +17 -7 +1
+17 -7
--- src/checkout.c
+++ src/checkout.c
@@ -89,10 +89,26 @@
8989
}
9090
content_get(vid, &manifest);
9191
vfile_build(vid, &manifest);
9292
blob_reset(&manifest);
9393
}
94
+
95
+/*
96
+** Read the manifest file given by vid out of the repository
97
+** and store it in the root of the local check-out.
98
+*/
99
+void manifest_to_disk(int vid){
100
+ char *zManFile;
101
+ Blob manifest;
102
+
103
+ blob_zero(&manifest);
104
+ zManFile = mprintf("%smanifest", g.zLocalRoot);
105
+ content_get(vid, &manifest);
106
+ blob_write_to_file(&manifest, zManFile);
107
+ free(zManFile);
108
+ blob_reset(&manifest);
109
+}
94110
95111
/*
96112
** COMMAND: checkout
97113
**
98114
** Check out a version specified on the command-line.
@@ -124,18 +140,12 @@
124140
if( !noWrite ){
125141
uncheckout(prior);
126142
}
127143
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
128144
if( !noWrite ){
129
- Blob manifest;
130
- char *zManFile;
131145
vfile_to_disk(vid, 0, 1);
132
- blob_zero(&manifest);
133
- zManFile = mprintf("%smanifest", g.zLocalRoot);
134
- content_get(vid, &manifest);
135
- blob_write_to_file(&manifest, zManFile);
136
- free(zManFile);
146
+ manifest_to_disk(vid);
137147
db_lset_int("checkout", vid);
138148
}
139149
db_multi_exec("DELETE FROM vmerge");
140150
vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
141151
vfile_aggregate_checksum_disk(vid, &cksum2);
142152
--- src/checkout.c
+++ src/checkout.c
@@ -89,10 +89,26 @@
89 }
90 content_get(vid, &manifest);
91 vfile_build(vid, &manifest);
92 blob_reset(&manifest);
93 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
95 /*
96 ** COMMAND: checkout
97 **
98 ** Check out a version specified on the command-line.
@@ -124,18 +140,12 @@
124 if( !noWrite ){
125 uncheckout(prior);
126 }
127 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
128 if( !noWrite ){
129 Blob manifest;
130 char *zManFile;
131 vfile_to_disk(vid, 0, 1);
132 blob_zero(&manifest);
133 zManFile = mprintf("%smanifest", g.zLocalRoot);
134 content_get(vid, &manifest);
135 blob_write_to_file(&manifest, zManFile);
136 free(zManFile);
137 db_lset_int("checkout", vid);
138 }
139 db_multi_exec("DELETE FROM vmerge");
140 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
141 vfile_aggregate_checksum_disk(vid, &cksum2);
142
--- src/checkout.c
+++ src/checkout.c
@@ -89,10 +89,26 @@
89 }
90 content_get(vid, &manifest);
91 vfile_build(vid, &manifest);
92 blob_reset(&manifest);
93 }
94
95 /*
96 ** Read the manifest file given by vid out of the repository
97 ** and store it in the root of the local check-out.
98 */
99 void manifest_to_disk(int vid){
100 char *zManFile;
101 Blob manifest;
102
103 blob_zero(&manifest);
104 zManFile = mprintf("%smanifest", g.zLocalRoot);
105 content_get(vid, &manifest);
106 blob_write_to_file(&manifest, zManFile);
107 free(zManFile);
108 blob_reset(&manifest);
109 }
110
111 /*
112 ** COMMAND: checkout
113 **
114 ** Check out a version specified on the command-line.
@@ -124,18 +140,12 @@
140 if( !noWrite ){
141 uncheckout(prior);
142 }
143 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
144 if( !noWrite ){
 
 
145 vfile_to_disk(vid, 0, 1);
146 manifest_to_disk(vid);
 
 
 
 
147 db_lset_int("checkout", vid);
148 }
149 db_multi_exec("DELETE FROM vmerge");
150 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
151 vfile_aggregate_checksum_disk(vid, &cksum2);
152
--- src/update.c
+++ src/update.c
@@ -174,8 +174,9 @@
174174
175175
/*
176176
** Clean up the mid and pid VFILE entries. Then commit the changes.
177177
*/
178178
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
179
+ manifest_to_disk(tid);
179180
db_lset_int("checkout", tid);
180181
db_end_transaction(0);
181182
}
182183
--- src/update.c
+++ src/update.c
@@ -174,8 +174,9 @@
174
175 /*
176 ** Clean up the mid and pid VFILE entries. Then commit the changes.
177 */
178 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
 
179 db_lset_int("checkout", tid);
180 db_end_transaction(0);
181 }
182
--- src/update.c
+++ src/update.c
@@ -174,8 +174,9 @@
174
175 /*
176 ** Clean up the mid and pid VFILE entries. Then commit the changes.
177 */
178 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
179 manifest_to_disk(tid);
180 db_lset_int("checkout", tid);
181 db_end_transaction(0);
182 }
183

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button