88 */
99
1010#include "cache.h"
11- #include "repo_tree.h"
1211#include "fast_export.h"
1312#include "line_buffer.h"
1413#include "strbuf.h"
@@ -134,13 +133,13 @@ static void handle_property(const struct strbuf *key_buf,
134133 die ("invalid dump: sets type twice" );
135134 }
136135 if (!val ) {
137- node_ctx .type = REPO_MODE_BLB ;
136+ node_ctx .type = S_IFREG | 0644 ;
138137 return ;
139138 }
140139 * type_set = 1 ;
141140 node_ctx .type = keylen == strlen ("svn:executable" ) ?
142- REPO_MODE_EXE :
143- REPO_MODE_LNK ;
141+ ( S_IFREG | 0755 ) :
142+ S_IFLNK ;
144143 }
145144}
146145
@@ -219,45 +218,45 @@ static void handle_node(void)
219218 */
220219 static const char * const empty_blob = "::empty::" ;
221220 const char * old_data = NULL ;
222- uint32_t old_mode = REPO_MODE_BLB ;
221+ uint32_t old_mode = S_IFREG | 0644 ;
223222
224223 if (node_ctx .action == NODEACT_DELETE ) {
225224 if (have_text || have_props || node_ctx .srcRev )
226225 die ("invalid dump: deletion node has "
227226 "copyfrom info, text, or properties" );
228- svn_repo_delete (node_ctx .dst .buf );
227+ fast_export_delete (node_ctx .dst .buf );
229228 return ;
230229 }
231230 if (node_ctx .action == NODEACT_REPLACE ) {
232- svn_repo_delete (node_ctx .dst .buf );
231+ fast_export_delete (node_ctx .dst .buf );
233232 node_ctx .action = NODEACT_ADD ;
234233 }
235234 if (node_ctx .srcRev ) {
236- svn_repo_copy (node_ctx .srcRev , node_ctx .src .buf , node_ctx .dst .buf );
235+ fast_export_copy (node_ctx .srcRev , node_ctx .src .buf , node_ctx .dst .buf );
237236 if (node_ctx .action == NODEACT_ADD )
238237 node_ctx .action = NODEACT_CHANGE ;
239238 }
240- if (have_text && type == REPO_MODE_DIR )
239+ if (have_text && type == S_IFDIR )
241240 die ("invalid dump: directories cannot have text attached" );
242241
243242 /*
244243 * Find old content (old_data) and decide on the new mode.
245244 */
246245 if (node_ctx .action == NODEACT_CHANGE && !* node_ctx .dst .buf ) {
247- if (type != REPO_MODE_DIR )
246+ if (type != S_IFDIR )
248247 die ("invalid dump: root of tree is not a regular file" );
249248 old_data = NULL ;
250249 } else if (node_ctx .action == NODEACT_CHANGE ) {
251250 uint32_t mode ;
252- old_data = svn_repo_read_path (node_ctx .dst .buf , & mode );
253- if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR )
251+ old_data = fast_export_read_path (node_ctx .dst .buf , & mode );
252+ if (mode == S_IFDIR && type != S_IFDIR )
254253 die ("invalid dump: cannot modify a directory into a file" );
255- if (mode != REPO_MODE_DIR && type == REPO_MODE_DIR )
254+ if (mode != S_IFDIR && type == S_IFDIR )
256255 die ("invalid dump: cannot modify a file into a directory" );
257256 node_ctx .type = mode ;
258257 old_mode = mode ;
259258 } else if (node_ctx .action == NODEACT_ADD ) {
260- if (type == REPO_MODE_DIR )
259+ if (type == S_IFDIR )
261260 old_data = NULL ;
262261 else if (have_text )
263262 old_data = empty_blob ;
@@ -280,7 +279,7 @@ static void handle_node(void)
280279 /*
281280 * Save the result.
282281 */
283- if (type == REPO_MODE_DIR ) /* directories are not tracked. */
282+ if (type == S_IFDIR ) /* directories are not tracked. */
284283 return ;
285284 assert (old_data );
286285 if (old_data == empty_blob )
@@ -385,9 +384,9 @@ void svndump_read(const char *url, const char *local_ref, const char *notes_ref)
385384 continue ;
386385 strbuf_addf (& rev_ctx .note , "%s\n" , t );
387386 if (!strcmp (val , "dir" ))
388- node_ctx .type = REPO_MODE_DIR ;
387+ node_ctx .type = S_IFDIR ;
389388 else if (!strcmp (val , "file" ))
390- node_ctx .type = REPO_MODE_BLB ;
389+ node_ctx .type = S_IFREG | 0644 ;
391390 else
392391 fprintf (stderr , "Unknown node-kind: %s\n" , val );
393392 break ;
0 commit comments