Changeset 109308 in vbox
- Timestamp:
- May 16, 2025 9:10:21 PM (9 days ago)
- svn:sync-xref-src-repo-rev:
- 168914
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/apps/svnsync-vbox/main.c
r108190 r109308 47 47 #define SVNSYNC_PROP_LICENSE SVNSYNC_PROP_PREFIX "license" 48 48 #define SVNSYNC_PROP_DEFAULT_PROCESS SVNSYNC_PROP_PREFIX "default-process" 49 #define SVNSYNC_PROP_CENSOR_AUTHOR SVNSYNC_PROP_PREFIX "censor-author" 49 50 #define SVNSYNC_PROP_REPLACE_EXTERNALS SVNSYNC_PROP_PREFIX "replace-externals" 50 51 #define SVNSYNC_PROP_REPLACE_LICENSE SVNSYNC_PROP_PREFIX "replace-license" … … 98 99 svnsync_opt_config_dir, 99 100 #ifdef VBOX 101 svnsync_opt_censor_author, 100 102 svnsync_opt_start_rev, 101 103 svnsync_opt_default_process, … … 114 116 #ifdef VBOX 115 117 #define SVNSYNC_OPTS_INITIALIZE SVNSYNC_OPTS_DEFAULT, \ 118 svnsync_opt_censor_author, \ 116 119 svnsync_opt_start_rev, \ 117 120 svnsync_opt_default_process, \ … … 177 180 N_("read user configuration files from directory ARG")}, 178 181 #ifdef VBOX 182 {"censor-author", svnsync_opt_censor_author, 0, 183 N_("ignore all revisions before ARG")}, 179 184 {"start-rev", svnsync_opt_start_rev, 1, 180 185 N_("ignore all revisions before ARG")}, … … 203 208 const char *config_dir; 204 209 #ifdef VBOX 210 svn_boolean_t censor_author; 205 211 svn_revnum_t start_rev; 206 212 const char *default_process; … … 503 509 #ifdef VBOX 504 510 svn_revnum_t rev_to, 511 svn_boolean_t censor_author, 505 512 #endif /* VBOX */ 506 513 svn_boolean_t sync, … … 534 541 else 535 542 #ifdef VBOX 536 if (strncmp(key, SVN_PROP_REVISION_AUTHOR, 537 sizeof(SVN_PROP_REVISION_AUTHOR) - 1)) 543 if ( (!censor_author || strncmp(key, SVN_PROP_REVISION_AUTHOR, 544 sizeof(SVN_PROP_REVISION_AUTHOR) - 1)) 545 && ((rev_to != 1) || (rev == rev_to) || strncmp(key, SVN_PROP_REVISION_LOG, 546 sizeof(SVN_PROP_REVISION_LOG)-1))) 538 547 SVN_ERR(svn_ra_change_rev_prop2(to_session, rev_to, key, NULL, val, subpool)); 539 548 #else /* !VBOX */ … … 631 640 void *wrapped_edit_baton; 632 641 svn_ra_session_t *from_session_prop; 642 svn_boolean_t censor_author; 633 643 svn_revnum_t current; 634 644 const char *default_process; … … 666 676 667 677 DX(fprintf(stderr, "init set_target_revision %ld\n", target_revision);) 678 target_revision = 1; 679 DX(fprintf(stderr, "init override set_target_revision %ld\n", target_revision);) 668 680 SVN_ERR(eb->wrapped_editor->set_target_revision(eb->wrapped_edit_baton, 669 681 target_revision, pool)); … … 681 693 initdir_baton_t *db = apr_pcalloc(pool, sizeof(*db)); 682 694 683 DX(fprintf(stderr, "init open_root\n");) 695 DX(fprintf(stderr, "init open_root %ld\n", base_revision);) 696 base_revision = 1; 697 DX(fprintf(stderr, "init override open_root %ld\n", base_revision);) 684 698 SVN_ERR(get_props_sync(eb->from_session_prop, eb->default_process, TRUE, 685 699 FALSE,"", eb->current, &db->process, … … 688 702 if (db->process) 689 703 SVN_ERR(eb->wrapped_editor->open_root(eb->wrapped_edit_baton, 690 base_revision , pool,704 base_revision - 1, pool, 691 705 &db->wrapped_dir_baton)); 692 706 … … 928 942 svn_ra_session_t *prop_session, 929 943 const char *default_process, 944 svn_boolean_t censor_author, 930 945 svn_boolean_t replace_externals, 931 946 svn_boolean_t replace_license, … … 974 989 apr_hash_t *config; 975 990 #ifdef VBOX 991 svn_boolean_t censor_author; 976 992 svn_revnum_t start_rev; 977 993 const char *default_process; … … 1090 1106 svn_string_create(default_process, pool), 1091 1107 pool)); 1108 if (baton->censor_author) 1109 SVN_ERR(svn_ra_change_rev_prop2(to_session, 0, 1110 SVNSYNC_PROP_CENSOR_AUTHOR, NULL, 1111 svn_string_create("", pool), pool)); 1092 1112 if (baton->replace_externals) 1093 1113 SVN_ERR(svn_ra_change_rev_prop2(to_session, 0, … … 1107 1127 1108 1128 #ifdef VBOX 1109 SVN_ERR(copy_revprops(from_session, to_session, 0, 0, FALSE, pool));1129 SVN_ERR(copy_revprops(from_session, to_session, 0, 0, baton->censor_author, FALSE, pool)); 1110 1130 #else /* !VBOX */ 1111 1131 SVN_ERR(copy_revprops(from_session, to_session, 0, FALSE, pool)); … … 1145 1165 SVN_ERR(get_init_editor(commit_editor, commit_baton, baton->start_rev, 1146 1166 from_session_prop, baton->default_process, 1167 baton->censor_author, 1147 1168 baton->replace_externals, baton->replace_license, 1148 1169 &init_editor, &init_baton, pool)); … … 1161 1182 SVN_ERR(reporter->finish_report(report_baton, pool)); 1162 1183 } 1184 1185 /* Finally, copy all non-svnsync revprops from rev start_rev of the source 1186 repos into rev 1 of the dest repos. */ 1187 1188 SVN_ERR(copy_revprops(from_session, to_session, baton->start_rev, 1, baton->censor_author, FALSE, pool)); 1163 1189 #endif /* VBOX */ 1164 1190 … … 1196 1222 baton.start_rev = opt_baton->start_rev; 1197 1223 baton.default_process = opt_baton->default_process; 1224 baton.censor_author = opt_baton->censor_author; 1198 1225 baton.replace_externals = opt_baton->replace_externals; 1199 1226 baton.replace_license = opt_baton->replace_license; … … 2396 2423 * which records the most recently synchronized revision. 2397 2424 *** VBOX 2398 * Set START_REV_STR to the proper ly which records the starting revision.2425 * Set START_REV_STR to the property which records the starting revision. 2399 2426 *** VBOX 2400 2427 * … … 2488 2515 svn_revnum_t to_latest, copying, last_merged; 2489 2516 #ifdef VBOX 2517 svn_string_t *censor_author_str; 2518 svn_boolean_t censor_author; 2490 2519 svn_revnum_t start_rev; 2491 2520 svn_string_t *from_url; … … 2510 2539 if (!default_process) 2511 2540 default_process = svn_string_create("export", pool); 2541 SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_CENSOR_AUTHOR, 2542 &censor_author_str, pool)); 2543 censor_author = !!censor_author_str; 2512 2544 SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_REPLACE_EXTERNALS, 2513 2545 &replace_externals_str, pool)); … … 2586 2618 /** @todo fix use of from/to revision numbers. */ 2587 2619 SVN_ERR(copy_revprops(from_session, to_session, 2588 to_latest, to_latest, TRUE, pool));2620 to_latest, to_latest, censor_author, TRUE, pool)); 2589 2621 #else /* !VBOX */ 2590 2622 SVN_ERR(copy_revprops(from_session, to_session, … … 2769 2801 { 2770 2802 SVN_ERR(copy_revprops(from_session, to_session, current, 2771 baton->committed_rev, TRUE, subpool));2803 baton->committed_rev, censor_author, TRUE, subpool)); 2772 2804 2773 2805 /* Add a revision cross-reference revprop visible to the public. */ … … 2924 2956 #ifdef VBOX 2925 2957 svn_revnum_t start_rev; 2958 svn_string_t *censor_author_str; 2959 svn_boolean_t censor_author; 2926 2960 #endif /* VBOX */ 2927 2961 … … 2934 2968 (APR_EINVAL, NULL, _("Cannot copy revprops for repositories using " 2935 2969 "the start-rev feature (unimplemented)")); 2970 2971 SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_CENSOR_AUTHOR, 2972 &censor_author_str, pool)); 2973 censor_author = !!censor_author_str; 2936 2974 #else /* !VBOX */ 2937 2975 SVN_ERR(open_source_session(&from_session, &last_merged_rev, to_session, … … 2945 2983 2946 2984 #ifdef VBOX 2947 SVN_ERR(copy_revprops(from_session, to_session, baton->rev, baton->rev, FALSE, pool));2985 SVN_ERR(copy_revprops(from_session, to_session, baton->rev, baton->rev, censor_author, FALSE, pool)); 2948 2986 #else /* !VBOX */ 2949 2987 SVN_ERR(copy_revprops(from_session, to_session, baton->rev, FALSE, pool)); … … 3155 3193 3156 3194 #ifdef VBOX 3195 case svnsync_opt_censor_author: 3196 opt_baton.censor_author = TRUE; 3197 break; 3198 3157 3199 case svnsync_opt_start_rev: 3158 3200 opt_baton.start_rev = SVN_STR_TO_REV(opt_arg);
Note:
See TracChangeset
for help on using the changeset viewer.