[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Add -c option to merge

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-10-25 22:23:44 CEST

> What exactly is your propsed syntax? I would imagine "-c ARG" as an
> alternative to "-r ARG-1:ARG". In that case, you need to specify that this
> option takes an argument by changing that "0" to "1", and you'd be better off
> saying "ARG" instead of "ARG1" in the description.

Grr, i sent the wrong diff, since i had fixed that, and some other
things.

>
> > {"revision", 'r', 1, N_
> > ("ARG (some commands also take ARG1:ARG2 range)\n"
> > " A revision argument can be one of:\n"
> > @@ -466,7 +467,7 @@ const svn_opt_subcommand_desc_t svn_cl__
> > " If WCPATH is omitted, a default value of '.' is assumed, unless\n"
> > " the sources have identical basenames that match a file within '.':\n"
> > " in which case, the differences will be applied to that file.\n"),
> > - {'r', 'N', 'q', svn_cl__force_opt, svn_cl__dry_run_opt,
> > + {'r', 'N', 'q', 'c', svn_cl__force_opt, svn_cl__dry_run_opt,
>
> It would be nice to put 'c' next to 'r' so that the closely related options
> appear together in the help.
>
Okay.

> > svn_cl__merge_cmd_opt, svn_cl__ignore_ancestry_opt,
> > SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
> >
> > @@ -914,6 +915,38 @@ main (int argc, const char * const *argv
> > opt_state.message = apr_pstrdup (pool, opt_arg);
> > dash_m_arg = opt_arg;
> > break;
> > + case 'c':
> > + {
> > + char *end;
> > + if (opt_state.start_revision.kind != svn_opt_revision_unspecified)
> > + {
>
> (Style: Please convert your tab characters to spaces.)
>
Fixed already.

> > + err = svn_error_create
> > + (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
> > + _("Multiple revision arguments encountered; "
> > + "can't specify -c twice, or both -c and -r"));
>
> You ought to update the "-r" error message correspondingly.
>
> > + return svn_cmdline_handle_exit_error (err, pool, "svn: ");
> > + }
> > + opt_state.end_revision.value.number = strtol (opt_arg, &end, 10);
> > + opt_state.end_revision.kind = svn_opt_revision_number;
> > + if (end == opt_arg || *end != '\0')
> > + {
> > + err = svn_error_create (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
> > + _("Non-numeric change argument given"));
>
> So the argument must be a number? You haven't explicitly mentioned that.

Yes, how would we know what date - 1 is?

> > + return svn_cmdline_handle_exit_error (err, pool, "svn: ");
> > + }
> > + opt_state.start_revision.value.number = opt_state.end_revision.value.number - 1;
> > + opt_state.start_revision.kind = svn_opt_revision_number;
> > + }
> > + break;
> > case 'r':
> > if (opt_state.start_revision.kind != svn_opt_revision_unspecified)
> > {
>
> My manual first test fails:
>
> ~/src/subversion> svn merge -c 16000
> Segmentation fault
>
> If we agree that we want this, please would you add a very basic regression
> test for this, which could be a modified copy of an existing merge test?
>

I actually went looking through the command-line tests for merge, and
none of them actually seem to use "-r" specifically.

Try the attached diff, see if it works better for you.

> - Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Oct 25 22:27:52 2005

This is an archived mail posted to the Subversion Dev mailing list.