Changeset 70834 in vbox for trunk/src/bldprogs
- Timestamp:
- Jan 31, 2018 2:48:21 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120640
- Location:
- trunk/src/bldprogs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/scm.cpp
r69753 r70834 101 101 SCMOPT_SET_SVN_KEYWORDS, 102 102 SCMOPT_DONT_SET_SVN_KEYWORDS, 103 SCMOPT_SKIP_SVN_SYNC_PROCESS, 104 SCMOPT_DONT_SKIP_SVN_SYNC_PROCESS, 103 105 SCMOPT_TAB_SIZE, 104 106 SCMOPT_WIDTH, … … 181 183 /* .fSetSvnExecutable = */ false, 182 184 /* .fSetSvnKeywords = */ false, 185 /* .fSkipSvnSyncProcess = */ false, 183 186 /* .cchTab = */ 8, 184 187 /* .cchWidth = */ 130, … … 230 233 { "--set-svn-keywords", SCMOPT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING }, 231 234 { "--dont-set-svn-keywords", SCMOPT_DONT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING }, 235 { "--skip-svn-sync-process", SCMOPT_SKIP_SVN_SYNC_PROCESS, RTGETOPT_REQ_NOTHING }, 236 { "--dont-skip-svn-sync-process", SCMOPT_DONT_SKIP_SVN_SYNC_PROCESS, RTGETOPT_REQ_NOTHING }, 232 237 { "--tab-size", SCMOPT_TAB_SIZE, RTGETOPT_REQ_UINT8 }, 233 238 { "--width", SCMOPT_WIDTH, RTGETOPT_REQ_UINT8 }, … … 268 273 SCM_REWRITER_CFG(g_SvnBinary, "svn-binary", rewrite_SvnBinary); 269 274 SCM_REWRITER_CFG(g_SvnKeywords, "svn-keywords", rewrite_SvnKeywords); 275 SCM_REWRITER_CFG(g_SvnSyncProcess, "svn-sync-process", rewrite_SvnSyncProcess); 270 276 SCM_REWRITER_CFG(g_Copyright_CstyleComment, "copyright-c-style", rewrite_Copyright_CstyleComment); 271 277 SCM_REWRITER_CFG(g_Copyright_HashComment, "copyright-hash-style", rewrite_Copyright_HashComment); … … 295 301 &g_SvnBinary, 296 302 &g_SvnKeywords, 303 &g_SvnSyncProcess, 297 304 &g_Copyright_CstyleComment, 298 305 &g_Copyright_HashComment, … … 313 320 { 314 321 &g_SvnNoExecutable, 322 &g_SvnSyncProcess, 315 323 &g_Makefile_kup 316 324 }; … … 323 331 &g_SvnNoExecutable, 324 332 &g_SvnKeywords, 333 &g_SvnSyncProcess, 325 334 &g_Copyright_HashComment, 326 335 &g_Makefile_kmk … … 334 343 &g_SvnNoExecutable, 335 344 &g_SvnKeywords, 345 &g_SvnSyncProcess, 336 346 &g_Copyright_HashComment, 337 347 }; … … 345 355 &g_SvnNoExecutable, 346 356 &g_SvnKeywords, 357 &g_SvnSyncProcess, 347 358 &g_Copyright_CstyleComment, 348 359 &g_FixFlowerBoxMarkers, … … 359 370 &g_SvnNoExecutable, 360 371 &g_SvnKeywords, 372 &g_SvnSyncProcess, 361 373 &g_Copyright_CstyleComment, 362 374 &g_C_and_CPP … … 371 383 &g_SvnNoExecutable, 372 384 &g_SvnKeywords, 385 &g_SvnSyncProcess, 373 386 &g_Copyright_CstyleComment, 374 387 }; … … 381 394 &g_AdjustTrailingLines, 382 395 &g_SvnKeywords, 396 &g_SvnSyncProcess, 383 397 &g_Copyright_CstyleComment, 384 398 }; … … 392 406 &g_SvnNoExecutable, 393 407 &g_SvnKeywords, 408 &g_SvnSyncProcess, 394 409 &g_Copyright_CstyleComment, 395 410 }; … … 403 418 &g_SvnNoExecutable, 404 419 &g_SvnKeywords, 420 &g_SvnSyncProcess, 405 421 &g_Copyright_SemicolonComment, 406 422 }; … … 414 430 &g_SvnNoExecutable, 415 431 &g_SvnKeywords, 432 &g_SvnSyncProcess, 416 433 &g_Copyright_SemicolonComment, 417 434 }; … … 422 439 &g_ExpandTabs, 423 440 &g_StripTrailingBlanks, 441 &g_SvnSyncProcess, 424 442 &g_Copyright_HashComment, 425 443 }; … … 430 448 &g_ExpandTabs, 431 449 &g_StripTrailingBlanks, 450 &g_SvnSyncProcess, 432 451 &g_Copyright_RemComment, 433 452 }; … … 438 457 &g_ExpandTabs, 439 458 &g_StripTrailingBlanks, 459 &g_SvnSyncProcess, 440 460 &g_Copyright_TickComment, 441 461 }; … … 446 466 &g_ExpandTabs, 447 467 &g_StripTrailingBlanks, 468 &g_SvnSyncProcess, 448 469 &g_Copyright_HashComment, 449 470 }; … … 456 477 &g_AdjustTrailingLines, 457 478 &g_SvnKeywords, 479 &g_SvnSyncProcess, 458 480 &g_Copyright_PythonComment, 459 481 }; … … 466 488 &g_AdjustTrailingLines, 467 489 &g_SvnKeywords, 490 &g_SvnSyncProcess, 468 491 &g_Copyright_HashComment, 469 492 }; … … 477 500 &g_SvnKeywords, 478 501 &g_SvnNoExecutable, 502 &g_SvnSyncProcess, 479 503 &g_Copyright_SemicolonComment, 480 504 }; … … 488 512 &g_SvnKeywords, 489 513 &g_SvnNoExecutable, 514 &g_SvnSyncProcess, 490 515 &g_Copyright_SemicolonComment, 491 516 }; … … 499 524 &g_SvnNoExecutable, 500 525 &g_SvnKeywords, 526 &g_SvnSyncProcess, 501 527 &g_Copyright_CstyleComment, 502 528 &g_FixFlowerBoxMarkers, … … 512 538 &g_SvnNoExecutable, 513 539 &g_SvnKeywords, 540 &g_SvnSyncProcess, 514 541 &g_Copyright_HashComment, 515 542 }; … … 519 546 &g_SvnNoExecutable, 520 547 &g_SvnBinary, 548 &g_SvnSyncProcess, 521 549 }; 522 550 … … 529 557 &g_SvnNoExecutable, 530 558 &g_SvnKeywords, 559 &g_SvnSyncProcess, 531 560 /** @todo copyright is in an XML comment. */ 532 561 }; … … 540 569 &g_SvnNoExecutable, 541 570 &g_SvnKeywords, 571 &g_SvnSyncProcess, 542 572 /** @todo copyright is in an XML comment. */ 543 573 }; … … 551 581 &g_SvnNoExecutable, 552 582 &g_SvnKeywords, 583 &g_SvnSyncProcess, 553 584 /** @todo copyright is in an XML comment. */ 554 585 }; … … 561 592 &g_SvnNoExecutable, 562 593 &g_SvnKeywords, 594 &g_SvnSyncProcess, 563 595 &g_Copyright_HashComment, 564 596 }; … … 569 601 &g_SvnNoExecutable, 570 602 &g_SvnKeywords, 603 &g_SvnSyncProcess, 571 604 /** @todo figure out copyright for Qt resource XML files. */ 572 605 }; … … 583 616 &g_SvnNoExecutable, 584 617 &g_SvnKeywords, 618 &g_SvnSyncProcess, 585 619 /** @todo copyright is in an XML 'comment' element. */ 586 620 }; … … 594 628 &g_SvnKeywords, 595 629 &g_SvnNoExecutable, 630 &g_SvnSyncProcess, 596 631 &g_Copyright_SemicolonComment, 597 632 }; … … 605 640 &g_SvnKeywords, 606 641 &g_SvnNoExecutable, 642 &g_SvnSyncProcess, 607 643 &g_Copyright_SqlComment, 608 644 }; … … 616 652 &g_SvnKeywords, 617 653 &g_SvnNoExecutable, 654 &g_SvnSyncProcess, 618 655 &g_Copyright_CstyleComment, 619 656 }; … … 625 662 &g_SvnKeywords, 626 663 &g_SvnNoExecutable, 664 &g_SvnSyncProcess, 627 665 /** @todo check for plain copyright + license in text files. */ 628 666 }; … … 634 672 &g_SvnKeywords, 635 673 &g_SvnNoExecutable, 674 &g_SvnSyncProcess, 636 675 }; 637 676 … … 639 678 { 640 679 &g_SvnBinary, 680 &g_SvnSyncProcess, 641 681 }; 642 682 … … 647 687 &g_StripTrailingBlanks, 648 688 &g_AdjustTrailingLines, 689 &g_SvnSyncProcess, 649 690 &g_Copyright_HashComment, 650 691 }; … … 1038 1079 case SCMOPT_DONT_SET_SVN_KEYWORDS: 1039 1080 pSettings->fSetSvnKeywords = false; 1081 return VINF_SUCCESS; 1082 1083 case SCMOPT_SKIP_SVN_SYNC_PROCESS: 1084 pSettings->fSkipSvnSyncProcess = true; 1085 return VINF_SUCCESS; 1086 case SCMOPT_DONT_SKIP_SVN_SYNC_PROCESS: 1087 pSettings->fSkipSvnSyncProcess = false; 1040 1088 return VINF_SUCCESS; 1041 1089 … … 2629 2677 case SCMOPT_SET_SVN_EXECUTABLE: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnExecutable); break; 2630 2678 case SCMOPT_SET_SVN_KEYWORDS: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnKeywords); break; 2679 case SCMOPT_SKIP_SVN_SYNC_PROCESS: RTPrintf(" Default: %RTbool\n", g_Defaults.fSkipSvnSyncProcess); break; 2631 2680 case SCMOPT_TAB_SIZE: RTPrintf(" Default: %u\n", g_Defaults.cchTab); break; 2632 2681 case SCMOPT_WIDTH: RTPrintf(" Default: %u\n", g_Defaults.cchWidth); break; -
trunk/src/bldprogs/scm.h
r69500 r70834 56 56 bool ScmSvnIsInWorkingCopy(PSCMRWSTATE pState); 57 57 int ScmSvnQueryProperty(PSCMRWSTATE pState, const char *pszName, char **ppszValue); 58 int ScmSvnQueryParentProperty(PSCMRWSTATE pState, const char *pszName, char **ppszValue); 58 59 int ScmSvnSetProperty(PSCMRWSTATE pState, const char *pszName, const char *pszValue); 59 60 int ScmSvnDelProperty(PSCMRWSTATE pState, const char *pszName); … … 202 203 FNSCMREWRITER rewrite_SvnBinary; 203 204 FNSCMREWRITER rewrite_SvnKeywords; 205 FNSCMREWRITER rewrite_SvnSyncProcess; 204 206 FNSCMREWRITER rewrite_Copyright_CstyleComment; 205 207 FNSCMREWRITER rewrite_Copyright_HashComment; … … 306 308 /** Set svn:keyword if completely or partially missing. */ 307 309 bool fSetSvnKeywords; 310 /** Skip checking svn:sync-process. */ 311 bool fSkipSvnSyncProcess; 308 312 /** Tab size. */ 309 313 uint8_t cchTab; -
trunk/src/bldprogs/scmrw.cpp
r69507 r70834 986 986 else if (RT_SUCCESS(rc)) 987 987 RTStrFree(pszKeywords); 988 989 return false; 990 } 991 992 /** 993 * Checks the svn:sync-process value and that parent is exported too. 994 * 995 * @returns false - the state carries these kinds of changes. 996 * @param pState The rewriter state. 997 * @param pIn The input stream. 998 * @param pOut The output stream. 999 * @param pSettings The settings. 1000 */ 1001 bool rewrite_SvnSyncProcess(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings) 1002 { 1003 RT_NOREF2(pIn, pOut); 1004 if ( pSettings->fSkipSvnSyncProcess 1005 || !ScmSvnIsInWorkingCopy(pState)) 1006 return false; 1007 1008 char *pszSyncProcess; 1009 int rc = ScmSvnQueryProperty(pState, "svn:sync-process", &pszSyncProcess); 1010 if (RT_SUCCESS(rc)) 1011 { 1012 if (strcmp(pszSyncProcess, "export") == 0) 1013 { 1014 char *pszParentSyncProcess; 1015 rc = ScmSvnQueryParentProperty(pState, "svn:sync-process", &pszParentSyncProcess); 1016 if (RT_SUCCESS(rc)) 1017 { 1018 if (strcmp(pszSyncProcess, "export") != 0) 1019 ScmError(pState, VERR_INVALID_STATE, 1020 "svn:sync-process=export, but parent directory differs: %s\n", pszParentSyncProcess); 1021 RTStrFree(pszParentSyncProcess); 1022 } 1023 else if (rc == VERR_NOT_FOUND) 1024 ScmError(pState, VERR_NOT_FOUND, "svn:sync-process=export, but parent directory is not exported!\n"); 1025 else 1026 ScmError(pState, rc, "ScmSvnQueryParentProperty: %Rrc\n", rc); 1027 } 1028 else if (strcmp(pszSyncProcess, "ignore") != 0) 1029 ScmError(pState, VERR_INVALID_NAME, "Bad sync-process value: %s\n", pszSyncProcess); 1030 RTStrFree(pszSyncProcess); 1031 } 1032 else if (rc != VERR_NOT_FOUND) 1033 ScmError(pState, rc, "ScmSvnQueryProperty: %Rrc\n", rc); 988 1034 989 1035 return false; -
trunk/src/bldprogs/scmsubversion.cpp
r70814 r70834 1436 1436 1437 1437 /** 1438 * Queries the value of an SVN property on the parent dir/whatever. 1439 * 1440 * This will not adjust for scheduled changes to the parent! 1441 * 1442 * @returns IPRT status code. 1443 * @retval VERR_INVALID_STATE if not a SVN WC file. 1444 * @retval VERR_NOT_FOUND if the property wasn't found. 1445 * @param pState The rewrite state to work on. 1446 * @param pszName The property name. 1447 * @param ppszValue Where to return the property value. Free this 1448 * using RTStrFree. Optional. 1449 */ 1450 int ScmSvnQueryParentProperty(PSCMRWSTATE pState, const char *pszName, char **ppszValue) 1451 { 1452 /* 1453 * Strip the filename and use ScmSvnQueryProperty. 1454 */ 1455 char szPath[RTPATH_MAX]; 1456 int rc = RTStrCopy(szPath, sizeof(szPath), pState->pszFilename); 1457 if (RT_SUCCESS(rc)) 1458 { 1459 RTPathStripFilename(szPath); 1460 SCMRWSTATE ParentState; 1461 ParentState.pszFilename = szPath; 1462 ParentState.fFirst = false; 1463 ParentState.fIsInSvnWorkingCopy = true; 1464 ParentState.cSvnPropChanges = 0; 1465 ParentState.paSvnPropChanges = NULL; 1466 ParentState.rc = VINF_SUCCESS; 1467 rc = ScmSvnQueryProperty(&ParentState, pszName, ppszValue); 1468 if (RT_SUCCESS(rc)) 1469 rc = ParentState.rc; 1470 } 1471 return rc; 1472 } 1473 1474 1475 /** 1438 1476 * Schedules the setting of a property. 1439 1477 *
Note:
See TracChangeset
for help on using the changeset viewer.