Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/hgsh/hgsh.c @ 5115:ea7b982b6c08
Remove trailing spaces
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 07 Aug 2007 10:24:33 +0200 |
parents | 59ddd43f609f |
children |
comparison
equal
deleted
inserted
replaced
5097:73fdc8bd3ed8 | 5115:ea7b982b6c08 |
---|---|
247 enum cmdline { | 247 enum cmdline { |
248 hg_init, | 248 hg_init, |
249 hg_serve, | 249 hg_serve, |
250 }; | 250 }; |
251 | 251 |
252 | 252 |
253 /* | 253 /* |
254 * attempt to verify that a directory is really a hg repo, by testing | 254 * attempt to verify that a directory is really a hg repo, by testing |
255 * for the existence of a subdirectory. | 255 * for the existence of a subdirectory. |
256 */ | 256 */ |
257 static int validate_repo(const char *repo_root, const char *subdir) | 257 static int validate_repo(const char *repo_root, const char *subdir) |
340 | 340 |
341 /* only hg init expects no repo. */ | 341 /* only hg init expects no repo. */ |
342 | 342 |
343 if (cmd != hg_init) { | 343 if (cmd != hg_init) { |
344 int valid; | 344 int valid; |
345 | 345 |
346 valid = validate_repo(repo_root, "data"); | 346 valid = validate_repo(repo_root, "data"); |
347 | 347 |
348 if (valid == -1) { | 348 if (valid == -1) { |
349 goto badargs; | 349 goto badargs; |
350 } | 350 } |
351 | 351 |
352 if (valid == 0) { | 352 if (valid == 0) { |
353 valid = validate_repo(repo_root, "store"); | 353 valid = validate_repo(repo_root, "store"); |
354 | 354 |
355 if (valid == -1) { | 355 if (valid == -1) { |
356 goto badargs; | 356 goto badargs; |
357 } | 357 } |
358 } | 358 } |
359 | 359 |
360 if (valid == 0) { | 360 if (valid == 0) { |
361 perror(repo); | 361 perror(repo); |
362 exit(EX_DATAERR); | 362 exit(EX_DATAERR); |
363 } | 363 } |
364 } | 364 } |
383 nargv[i++] = HG; | 383 nargv[i++] = HG; |
384 nargv[i++] = "init"; | 384 nargv[i++] = "init"; |
385 nargv[i++] = repo; | 385 nargv[i++] = repo; |
386 break; | 386 break; |
387 } | 387 } |
388 | 388 |
389 nargv[i] = NULL; | 389 nargv[i] = NULL; |
390 | 390 |
391 if (debug) { | 391 if (debug) { |
392 print_cmdline(i, nargv); | 392 print_cmdline(i, nargv); |
393 } | 393 } |