julianf...@apache.org wrote on Mon, Dec 03, 2012 at 16:19:45 -0000: > Author: julianfoad > Date: Mon Dec 3 16:19:44 2012 > New Revision: 1416578 > > URL: http://svn.apache.org/viewvc?rev=1416578&view=rev > Log: > A bit of table-driven goodness for the interactive conflict resolver. >
Nice! > +/* Resolver options for a text conflict */ > +static const resolver_option_t text_conflict_options[] = > +{ > + { "e", "edit", N_("change merged file in an editor") }, > + { "df", "diff-full", N_("show all changes made to merged file") }, > + { "r", "resolved", N_("accept merged version of file") }, > + { "" }, > + { "dc", "display-conflict", N_("show all conflicts (ignoring merged > version)") }, > + { "mc", "mine-conflict", N_("accept my version for all conflicts > (same)") }, > + { "tc", "theirs-conflict", N_("accept their version for all conflicts > (same)") }, > + { "" }, > + { "mf", "mine-full", N_("accept my version of entire file (even " > + "non-conflicts)") }, > + { "tf", "theirs-full", N_("accept their version of entire file > (same)") }, > + { "" }, > + { "p", "postpone", N_("mark the conflict to be resolved later") }, > + { "m", "merge", N_("use internal merge tool to resolve > conflict") }, > + { "l", "launch", N_("launch external tool to resolve conflict") > }, > + { "s", "show all options", N_("show this list") }, > + { NULL } You could add here #define NUMBER_OF_OPTIONS (sizeof(text_conflict_options) / sizeof(text_conflict_options[0])) , ... > +}; > + > @@ -320,73 +471,45 @@ handle_text_conflict(svn_wc_conflict_res > > while (TRUE) > { > - svn_pool_clear(iterpool); > + const char *options[12]; /* size of array must be big enough */ and use it here. (and yes, I handwaved around the fact that there are 4 static arrays of resolver_option_t rather than just one.)