@@ -134,13 +134,13 @@ static void handle_property(const struct strbuf *key_buf,
134
134
die ("invalid dump: sets type twice" );
135
135
}
136
136
if (!val ) {
137
- node_ctx .type = REPO_MODE_BLB ;
137
+ node_ctx .type = S_IFREG | 0644 ;
138
138
return ;
139
139
}
140
140
* type_set = 1 ;
141
141
node_ctx .type = keylen == strlen ("svn:executable" ) ?
142
- REPO_MODE_EXE :
143
- REPO_MODE_LNK ;
142
+ ( S_IFREG | 0755 ) :
143
+ S_IFLNK ;
144
144
}
145
145
}
146
146
@@ -219,7 +219,7 @@ static void handle_node(void)
219
219
*/
220
220
static const char * const empty_blob = "::empty::" ;
221
221
const char * old_data = NULL ;
222
- uint32_t old_mode = REPO_MODE_BLB ;
222
+ uint32_t old_mode = S_IFREG | 0644 ;
223
223
224
224
if (node_ctx .action == NODEACT_DELETE ) {
225
225
if (have_text || have_props || node_ctx .srcRev )
@@ -237,27 +237,27 @@ static void handle_node(void)
237
237
if (node_ctx .action == NODEACT_ADD )
238
238
node_ctx .action = NODEACT_CHANGE ;
239
239
}
240
- if (have_text && type == REPO_MODE_DIR )
240
+ if (have_text && type == S_IFDIR )
241
241
die ("invalid dump: directories cannot have text attached" );
242
242
243
243
/*
244
244
* Find old content (old_data) and decide on the new mode.
245
245
*/
246
246
if (node_ctx .action == NODEACT_CHANGE && !* node_ctx .dst .buf ) {
247
- if (type != REPO_MODE_DIR )
247
+ if (type != S_IFDIR )
248
248
die ("invalid dump: root of tree is not a regular file" );
249
249
old_data = NULL ;
250
250
} else if (node_ctx .action == NODEACT_CHANGE ) {
251
251
uint32_t mode ;
252
252
old_data = svn_repo_read_path (node_ctx .dst .buf , & mode );
253
- if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR )
253
+ if (mode == S_IFDIR && type != S_IFDIR )
254
254
die ("invalid dump: cannot modify a directory into a file" );
255
- if (mode != REPO_MODE_DIR && type == REPO_MODE_DIR )
255
+ if (mode != S_IFDIR && type == S_IFDIR )
256
256
die ("invalid dump: cannot modify a file into a directory" );
257
257
node_ctx .type = mode ;
258
258
old_mode = mode ;
259
259
} else if (node_ctx .action == NODEACT_ADD ) {
260
- if (type == REPO_MODE_DIR )
260
+ if (type == S_IFDIR )
261
261
old_data = NULL ;
262
262
else if (have_text )
263
263
old_data = empty_blob ;
@@ -280,7 +280,7 @@ static void handle_node(void)
280
280
/*
281
281
* Save the result.
282
282
*/
283
- if (type == REPO_MODE_DIR ) /* directories are not tracked. */
283
+ if (type == S_IFDIR ) /* directories are not tracked. */
284
284
return ;
285
285
assert (old_data );
286
286
if (old_data == empty_blob )
@@ -385,9 +385,9 @@ void svndump_read(const char *url, const char *local_ref, const char *notes_ref)
385
385
continue ;
386
386
strbuf_addf (& rev_ctx .note , "%s\n" , t );
387
387
if (!strcmp (val , "dir" ))
388
- node_ctx .type = REPO_MODE_DIR ;
388
+ node_ctx .type = S_IFDIR ;
389
389
else if (!strcmp (val , "file" ))
390
- node_ctx .type = REPO_MODE_BLB ;
390
+ node_ctx .type = S_IFREG | 0644 ;
391
391
else
392
392
fprintf (stderr , "Unknown node-kind: %s\n" , val );
393
393
break ;
0 commit comments