00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "global.h"
00010 #include "actions.h"
00011 #include "status.h"
00012 #include "commit.h"
00013 #include "update.h"
00014 #include "export.h"
00015 #include "log.h"
00016 #include "cat.h"
00017 #include "ignore.h"
00018 #include "cp_mv.h"
00019 #include "sync.h"
00020 #include "checkout.h"
00021 #include "diff.h"
00022 #include "url.h"
00023 #include "add_unvers.h"
00024 #include "props.h"
00025 #include "info.h"
00026 #include "revert.h"
00027 #include "remote.h"
00028 #include "resolve.h"
00029 #include "build.h"
00030
00031
00038 static const char
00039 *acl_status[] = { "status", NULL },
00040 *acl_commit[] = { "commit", "checkin", "ci", NULL },
00041 *acl_update[] = { "update", NULL },
00042 *acl_export[] = { "export", NULL },
00043 *acl_build[] = { "_build-new-list", NULL },
00044 *acl_delay[] = { "delay", NULL },
00045 *acl_remote[] = { "remote-status", "rs", NULL },
00046 *acl_ignore[] = { "ignore", NULL },
00047 *acl_rign[] = { "rel-ignore", "ri", "r-i", NULL },
00048 *acl_groups[] = { "groups", "groupings", "grps", NULL },
00049 *acl_add[] = { "add", NULL },
00050 *acl_copyfr[] = { "copyfrom-detect", "copy-detect", NULL },
00051 *acl_cp[] = { "copy", "move", "cp", "mv", NULL },
00052 *acl_uncp[] = { "uncopy", NULL },
00053 *acl_unvers[] = { "unversion", NULL },
00054 *acl_log[] = { "log", NULL },
00055 *acl_cat[] = { "cat", NULL },
00056 *acl_resolv[] = { "resolved", NULL },
00057 *acl_checko[] = { "checkout", "co", NULL },
00058 *acl_sync_r[] = { "sync-repos", NULL },
00059 *acl_revert[] = { "revert", "undo", NULL },
00060 *acl_prop_l[] = { "prop-list", "pl", NULL },
00061 *acl_prop_g[] = { "prop-get", "pg", NULL },
00062 *acl_prop_s[] = { "prop-set", "ps", NULL },
00063 *acl_prop_d[] = { "prop-del", "pd", NULL },
00064 *acl_diff[] = { "diff", NULL },
00065 *acl_help[] = { "help", "?", NULL },
00066 *acl_info[] = { "info", NULL },
00068 *acl_urls[] = { "urls", "initialize", NULL };
00069
00070
00071
00072 #include "doc.g-c"
00073
00078 #define ACT(nam, _work, _act, ...) \
00079 { .name=acl_##nam, .help_text=hlp_##nam, \
00080 .work=_work, .local_callback=_act, \
00081 __VA_ARGS__ }
00082
00084 #define UNINIT .local_uninit=st__progress_uninit
00085
00086 #define DECODER .needs_decoder=1
00087
00088 #define FILTER .only_opt_filter=1
00089
00090 #define STS_WRITE .overwrite_sts_st=1
00091
00092 #define DIR_UPD .do_update_dir=1
00093
00094 #define RO .is_readonly=1
00095
00096
00098 struct actionlist_t action_list[]=
00099 {
00100
00101 ACT(status, st__work, st__action, FILTER, STS_WRITE, DIR_UPD, RO),
00102 ACT(commit, ci__work, ci__action, UNINIT, FILTER, DIR_UPD),
00103 ACT(update, up__work, st__progress, UNINIT, DECODER),
00104 ACT(export, exp__work, NULL, .is_import_export=1, DECODER),
00105 ACT(unvers, au__work, au__action, .i_val=RF_UNVERSION, STS_WRITE),
00106 ACT( add, au__work, au__action, .i_val=RF_ADD, STS_WRITE),
00107 ACT( diff, df__work, NULL, DECODER, STS_WRITE, RO),
00108 ACT(sync_r, sync__work, NULL, .repos_feedback=sync__progress, .keep_user_prop=1),
00109 ACT( urls, url__work, NULL),
00110 ACT(revert, rev__work, NULL, UNINIT, DECODER, .keep_children=1),
00111 ACT(groups, ign__work, NULL, .i_val=0, DIR_UPD),
00112 ACT(ignore, ign__work, NULL, .i_val=HAVE_GROUP, DIR_UPD),
00113 ACT( rign, ign__rign, NULL, .i_val=HAVE_GROUP, DIR_UPD),
00114 ACT(copyfr, cm__detect, st__progress, UNINIT, DIR_UPD, STS_WRITE),
00115 ACT( cp, cm__work, NULL),
00116 ACT( cat, cat__work, NULL),
00117 ACT( uncp, cm__uncopy, NULL),
00118 ACT(resolv, res__work, res__action, .is_compare=1),
00119 ACT( log, log__work, NULL, RO),
00120 ACT(checko, co__work, NULL, DECODER, .repos_feedback=st__rm_status),
00121 ACT( build, bld__work, st__status, DIR_UPD),
00122 ACT( delay,delay__work, st__status, RO),
00123
00124
00125 ACT( help, ac__Usage, NULL, .is_import_export=1, RO),
00126 ACT( info, info__work, info__action, RO),
00127 ACT(prop_g,prp__g_work, NULL, RO),
00128 ACT(prop_s,prp__s_work, NULL, .i_val=FS_NEW),
00129 ACT(prop_d,prp__s_work, NULL, .i_val=FS_REMOVED),
00130 ACT(prop_l,prp__l_work, NULL, RO),
00131 ACT(remote, up__work, NULL, .is_compare=1, .repos_feedback=st__rm_status),
00132 };
00133
00135 const int action_list_count = sizeof(action_list)/sizeof(action_list[0]);
00137 struct actionlist_t *action=action_list;
00138