00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef LIBAEGIS_CHANGE_H
00022 #define LIBAEGIS_CHANGE_H
00023
00024 #include <libaegis/cstate.h>
00025 #include <libaegis/fstate.h>
00026 #include <libaegis/pconf.h>
00027 #include <libaegis/view_path.h>
00028 #include <libaegis/zero.h>
00029
00030 class nstring_list;
00031
00032
00033
00034
00035
00036 #define THE_CONFIG_FILE_OLD "config"
00037 #define THE_CONFIG_FILE_NEW "aegis.conf"
00038
00039 #include <libaegis/user.h>
00040
00041
00042
00043
00044
00045 #define TRUNK_CHANGE_NUMBER ((long)((~(unsigned long)0) >> 1))
00046
00047 #define TIME_NOT_SET (time_t)0
00048
00049 struct string_list_ty;
00050 struct sub_context_ty;
00051 struct symtab_ty;
00052 class project_ty;
00053
00054 class change
00055 {
00056 public:
00063 typedef change *pointer;
00064
00065 long reference_count;
00066 project_ty *pp;
00067 long number;
00068 cstate_ty *cstate_data;
00069 string_ty *cstate_filename;
00070 int cstate_is_a_new_file;
00071 fstate_ty *fstate_data;
00072 symtab_ty *fstate_stp;
00073 symtab_ty *fstate_uuid_stp;
00074 string_ty *fstate_filename;
00075 fstate_ty *pfstate_data;
00076 symtab_ty *pfstate_stp;
00077 symtab_ty *pfstate_uuid_stp;
00078 string_ty *pfstate_filename;
00079 int fstate_is_a_new_file;
00080 string_ty *top_path_unresolved;
00081 string_ty *top_path_resolved;
00082 string_ty *development_directory_unresolved;
00083 string_ty *development_directory_resolved;
00084 string_ty *integration_directory_unresolved;
00085 string_ty *integration_directory_resolved;
00086 string_ty *logfile;
00087 pconf_ty *pconf_data;
00088 long lock_magic;
00089 int bogus;
00090 string_ty *architecture_name;
00091 string_list_ty *file_list[view_path_MAX];
00092 bool project_specific_setenv_performed;
00093
00094
00095
00096
00097
00098
00110 nstring attributes_get(const nstring &name);
00111
00125 bool attributes_get_boolean(const nstring &name);
00126
00131 cstate_ty *cstate_get();
00132
00144 fstate_src_ty *file_new(string_ty *fn);
00145
00159 fstate_src_ty *file_new(fstate_src_ty *meta);
00160
00165 int gid_get() const;
00166
00172 bool is_awaiting_development();
00173
00178 bool is_being_developed();
00179
00188 bool is_being_integrated();
00189
00194 bool is_completed();
00195
00209 nstring pconf_attributes_find(const nstring &name);
00210
00215 nstring pconf_copyright_owner_get();
00216
00225 void project_specific_setenv_performed_set();
00226
00236 bool project_specific_setenv_performed_get() const;
00237
00246 bool run_project_file_command_needed();
00247
00258 void run_project_file_command(const user_ty::pointer &up);
00259
00268 void run_project_file_command_done();
00269
00279 void run_new_file_command(string_list_ty *slp, const user_ty::pointer &up);
00280
00290 void run_new_file_undo_command(string_list_ty *slp,
00291 const user_ty::pointer &up);
00292
00302 void run_new_test_command(string_list_ty *slp,
00303 const user_ty::pointer &up);
00304
00314 void run_new_test_undo_command(string_list_ty *slp,
00315 const user_ty::pointer &up);
00316
00326 void run_copy_file_command(string_list_ty *slp, const user_ty::pointer &up);
00327
00337 void run_copy_file_undo_command(string_list_ty *slp,
00338 const user_ty::pointer &up);
00339
00349 void run_remove_file_command(string_list_ty *slp,
00350 const user_ty::pointer &up);
00351
00362 void run_remove_file_undo_command(string_list_ty *slp,
00363 const user_ty::pointer &up);
00364
00375 void run_make_transparent_command(string_list_ty *slp,
00376 const user_ty::pointer &up);
00377
00388 void run_make_transparent_undo_command(string_list_ty *slp,
00389 const user_ty::pointer &up);
00390
00399 void run_forced_develop_begin_notify_command(const user_ty::pointer &up);
00400
00406 void run_develop_end_notify_command();
00407
00413 void run_develop_end_undo_notify_command();
00414
00420 void run_review_begin_notify_command();
00421
00427 void run_review_begin_undo_notify_command();
00428
00434 void run_review_pass_notify_command();
00435
00441 void run_review_pass_undo_notify_command();
00442
00448 void run_review_fail_notify_command();
00449
00455 void run_integrate_pass_notify_command();
00456
00462 void run_integrate_fail_notify_command();
00463
00464 time_t time_limit_get();
00465
00473 nstring uuid_get();
00474
00483 void uuid_get_list(nstring_list &uuids);
00484
00490 user_ty::pointer developer_user_get();
00491
00492
00493
00494
00495
00496
00497
00498 };
00499
00500 change::pointer change_alloc(project_ty *, long);
00501 void change_free(change::pointer );
00502 change::pointer change_copy(change::pointer );
00503 void change_bind_existing(change::pointer );
00504 int change_bind_existing_errok(change::pointer );
00505 void change_bind_new(change::pointer );
00506 change::pointer change_bogus(project_ty *);
00507
00508 inline DEPRECATED cstate_ty *
00509 change_cstate_get(change::pointer cp)
00510 {
00511 return cp->cstate_get();
00512 }
00513
00514 void change_cstate_write(change::pointer );
00515 cstate_history_ty *change_history_new(change::pointer , user_ty::pointer );
00516 string_ty *change_creator_name(change::pointer );
00517 string_ty *change_developer_name(change::pointer );
00518 string_ty *change_reviewer_name(change::pointer );
00519 string_ty *change_integrator_name(change::pointer );
00520 void change_top_path_set(change::pointer , string_ty *);
00521 void change_top_path_set(change::pointer , const nstring &);
00522 void change_development_directory_set(change::pointer , string_ty *);
00523 void change_integration_directory_set(change::pointer , string_ty *);
00524 string_ty *change_top_path_get(change::pointer , int);
00525 string_ty *change_development_directory_get(change::pointer , int);
00526 string_ty *change_integration_directory_get(change::pointer , int);
00527 string_ty *change_logfile_basename(void);
00528 string_ty *change_logfile_get(change::pointer );
00529 void change_cstate_lock_prepare(change::pointer );
00530 void change_error(change::pointer , sub_context_ty *, const char *);
00531 void change_fatal(change::pointer , sub_context_ty *, const char *) NORETURN;
00532 void change_verbose(change::pointer , sub_context_ty *, const char *);
00533
00540 void change_warning(change::pointer , sub_context_ty *, const char *);
00541
00547 void change_warning_obsolete_field(change::pointer cp, string_ty *errpos,
00548 const char *old_field, const char *new_field);
00549
00550 pconf_ty *change_pconf_get(change::pointer , int);
00551
00552
00553 void change_run_new_file_command(change::pointer cp, string_list_ty *slp,
00554 user_ty::pointer up) DEPRECATED;
00555
00556
00557 void change_run_new_file_undo_command(change::pointer cp, string_list_ty *slp,
00558 user_ty::pointer up) DEPRECATED;
00559
00560
00561 void change_run_new_test_command(change::pointer cp, string_list_ty *slp,
00562 user_ty::pointer up) DEPRECATED;
00563
00564
00565 void change_run_new_test_undo_command(change::pointer cp, string_list_ty *slp,
00566 user_ty::pointer up) DEPRECATED;
00567
00568
00569 void change_run_copy_file_command(change::pointer cp, string_list_ty *slp,
00570 user_ty::pointer up) DEPRECATED;
00571
00572
00573 void change_run_copy_file_undo_command(change::pointer cp, string_list_ty *slp,
00574 user_ty::pointer up) DEPRECATED;
00575
00576
00577 void change_run_remove_file_command(change::pointer cp, string_list_ty *slp,
00578 user_ty::pointer up) DEPRECATED;
00579
00580
00581 void change_run_remove_file_undo_command(change::pointer cp,
00582 string_list_ty *slp, user_ty::pointer up) DEPRECATED;
00583
00584
00585 void change_run_make_transparent_command(change::pointer cp,
00586 string_list_ty *slp, user_ty::pointer up) DEPRECATED;
00587
00588
00589 void change_run_make_transparent_undo_command(change::pointer cp,
00590 string_list_ty *slp, user_ty::pointer up) DEPRECATED;
00591
00592
00593 int change_run_project_file_command_needed(change::pointer cp) DEPRECATED;
00594
00595
00596 void change_run_project_file_command(change::pointer cp, user_ty::pointer up)
00597 DEPRECATED;
00598
00599
00600 void change_run_forced_develop_begin_notify_command(change::pointer cp,
00601 user_ty::pointer up) DEPRECATED;
00602
00603
00604 void change_run_develop_end_notify_command(change::pointer cp) DEPRECATED;
00605
00606
00607 void change_run_develop_end_undo_notify_command(change::pointer cp) DEPRECATED;
00608
00609
00610 void change_run_review_begin_notify_command(change::pointer cp) DEPRECATED;
00611
00612
00613 void change_run_review_begin_undo_notify_command(change::pointer cp) DEPRECATED;
00614
00615
00616 void change_run_review_pass_notify_command(change::pointer cp) DEPRECATED;
00617
00618
00619 void change_run_review_pass_undo_notify_command(change::pointer cp) DEPRECATED;
00620
00621
00622 void change_run_review_fail_notify_command(change::pointer cp) DEPRECATED;
00623
00624
00625 void change_run_integrate_pass_notify_command(change::pointer cp) DEPRECATED;
00626
00627
00628 void change_run_integrate_fail_notify_command(change::pointer cp) DEPRECATED;
00629
00630 void change_run_history_get_command(change::pointer cp, fstate_src_ty *src,
00631 string_ty *output_file, user_ty::pointer up);
00632 void change_run_history_create_command(change::pointer cp, fstate_src_ty *);
00633 void change_run_history_put_command(change::pointer cp, fstate_src_ty *);
00634
00647 string_ty *change_run_history_query_command(change::pointer cp,
00648 fstate_src_ty *src);
00649
00650 void change_run_history_label_command(change::pointer cp, fstate_src_ty *,
00651 string_ty *label);
00652
00662 void change_run_history_transaction_begin_command(change::pointer cp);
00663
00673 void change_run_history_transaction_end_command(change::pointer cp);
00674
00684 void change_run_history_transaction_abort_command(change::pointer cp);
00685
00686 void change_history_trashed_fingerprints(change::pointer , string_list_ty *);
00687 void change_run_diff_command(change::pointer cp, user_ty::pointer up,
00688 string_ty *original, string_ty *input, string_ty *output);
00689 void change_run_diff3_command(change::pointer cp, user_ty::pointer up,
00690 string_ty *original, string_ty *most_recent, string_ty *input,
00691 string_ty *output);
00692 void change_run_merge_command(change::pointer cp, user_ty::pointer up,
00693 string_ty *original, string_ty *most_recent, string_ty *input,
00694 string_ty *output);
00695 void change_run_patch_diff_command(change::pointer cp, user_ty::pointer up,
00696 string_ty *original, string_ty *input, string_ty *output,
00697 string_ty *index_name);
00698 void change_run_annotate_diff_command(change::pointer cp, user_ty::pointer up,
00699 string_ty *original, string_ty *input, string_ty *output,
00700 string_ty *index_name, const char *diff_option);
00701 int change_has_merge_command(change::pointer );
00702 void change_run_integrate_begin_command(change::pointer );
00703 void change_run_integrate_begin_undo_command(change::pointer );
00704 void change_run_develop_begin_command(change::pointer , user_ty::pointer );
00705 void change_run_develop_begin_undo_command(change::pointer cp,
00706 user_ty::pointer up);
00707 int change_run_test_command(change::pointer cp, user_ty::pointer up,
00708 string_ty *, string_ty *, int, int,
00709 const nstring_list &variable_assignments);
00710 int change_run_development_test_command(change::pointer cp, user_ty::pointer up,
00711 string_ty *, string_ty *, int, int,
00712 const nstring_list &variable_assignments);
00713 void change_run_build_command(change::pointer );
00714 void change_run_build_time_adjust_notify_command(change::pointer );
00715 void change_run_development_build_command(change::pointer , user_ty::pointer ,
00716 string_list_ty *);
00717
00731 void change_run_develop_end_policy_command(change::pointer cp,
00732 user_ty::pointer up);
00733
00734 string_ty *change_file_whiteout(change::pointer , string_ty *);
00735 void change_file_whiteout_write(change::pointer cp, string_ty *path,
00736 user_ty::pointer up);
00737 void change_become(change::pointer );
00738 void change_become_undo(change::pointer cp);
00739 void change_developer_become(change::pointer );
00740 void change_developer_become_undo(change::pointer cp);
00741 int change_umask(change::pointer );
00742 void change_development_directory_clear(change::pointer );
00743 void change_integration_directory_clear(change::pointer );
00744 void change_architecture_clear(change::pointer );
00745 void change_architecture_add(change::pointer , string_ty *);
00746 void change_architecture_query(change::pointer );
00747 string_ty *change_architecture_name(change::pointer , int);
00748 string_ty *change_run_architecture_discriminator_command(change::pointer cp);
00749 cstate_architecture_times_ty *change_architecture_times_find(change::pointer ,
00750 string_ty *);
00751 void change_build_time_set(change::pointer );
00752
00762 void change_test_time_set(change::pointer cp, time_t when);
00763
00775 void change_test_time_set(change::pointer cp, string_ty *variant, time_t when);
00776
00787 void change_test_baseline_time_set(change::pointer cp, time_t when);
00788
00800 void change_test_baseline_time_set(change::pointer cp, string_ty *variant,
00801 time_t when);
00802
00815 void change_regression_test_time_set(change::pointer cp, time_t when,
00816 string_ty *arch_name = 0);
00817
00818 void change_test_times_clear(change::pointer );
00819 void change_build_times_clear(change::pointer );
00820 void change_architecture_from_pconf(change::pointer );
00821
00822 const char *change_outstanding_builds(change::pointer , time_t);
00823 const char *change_outstanding_tests(change::pointer , time_t);
00824 const char *change_outstanding_tests_baseline(change::pointer , time_t);
00825 const char *change_outstanding_tests_regression(change::pointer , time_t);
00826
00827 int change_pathconf_name_max(change::pointer );
00828 string_ty *change_filename_check(change::pointer , string_ty *);
00829
00830 void change_create_symlinks_to_baseline(change::pointer , user_ty::pointer ,
00831 const work_area_style_ty &);
00832
00857 void change_maintain_symlinks_to_baseline(change::pointer cp,
00858 user_ty::pointer up, bool undoing = false);
00859
00860 void change_remove_symlinks_to_baseline(change::pointer , user_ty::pointer ,
00861 const work_area_style_ty &);
00862
00863 void change_rescind_test_exemption(change::pointer );
00864 string_ty *change_cstate_filename_get(change::pointer );
00865
00876 string_ty *change_fstate_filename_get(change::pointer cp);
00877
00889 string_ty *change_pfstate_filename_get(change::pointer cp);
00890
00891 void change_rescind_test_exemption_undo(change::pointer );
00892 void change_force_regression_test_exemption(change::pointer );
00893 void change_force_regression_test_exemption_undo(change::pointer );
00894
00895 void change_check_architectures(change::pointer );
00896 string_ty *change_new_test_filename_get(change::pointer , long, int);
00897 string_ty *change_development_directory_template(change::pointer ,
00898 user_ty::pointer );
00899 string_ty *change_metrics_filename_pattern_get(change::pointer );
00900
00906 inline DEPRECATED bool
00907 change_is_awaiting_development(change::pointer cp)
00908 {
00909 return cp->is_awaiting_development();
00910 }
00911
00917 inline DEPRECATED int
00918 change_is_being_developed(change::pointer cp)
00919 {
00920 return cp->is_being_developed();
00921 }
00922
00933 inline DEPRECATED bool
00934 change_is_being_integrated(change::pointer cp)
00935 {
00936 return cp->is_being_integrated();
00937 }
00938
00943 inline DEPRECATED int
00944 change_is_completed(change::pointer cp)
00945 {
00946 return cp->is_completed();
00947 }
00948
00953 long change_delta_number_get(change::pointer );
00954
00959 string_ty *change_brief_description_get(change::pointer );
00960
00965 void change_uuid_set(change::pointer cp);
00966
00971 void change_uuid_clear(change::pointer cp);
00972
00984 void change_reviewer_list(change::pointer cp, string_list_ty &result);
00985
00997 bool change_reviewer_already(change::pointer cp, string_ty *login);
00998
01010 bool change_reviewer_already(change::pointer cp, const nstring &login);
01011
01023 time_t change_when_get(change::pointer cp, cstate_history_what_ty what);
01024
01034 bool change_diff_required(change::pointer cp);
01035
01048 bool change_build_required(change::pointer cp, bool conf_exists = true);
01049
01050 #endif // LIBAEGIS_CHANGE_H