On Wed, May 22, 2024 at 11:13 AM Timofey Zhakov <t...@chemodax.net> wrote:
>
> On Wed, May 22, 2024 at 5:04 PM Timofey Zhakov <t...@chemodax.net> wrote:
> >
> > > >>> I found a little bug in parsing a change revision: If the number,
> > > >>> given to the --change argument, starts with a double minus or with
> > > >>> `-r-`, the command aborts. This patch fixes this bug.
> > > >>>
> > [...]
> > > > Thanks!
> > >
> > > Found another similar issue in -c option.
> > >
> > > The following works correctly:
> > >
> > > $ ~/svn/1.14.3/bin/svn diff -c '0-1' file:///tmp/svnrepos
> > > svn: E205000: There is no change 0
> > >
> > > However, the following aborts:
> > >
> > > $ ~/svn/1.14.3/bin/svn diff -c '1-0' file:///tmp/svnrepos
> > > svn: E235000: In file 'subversion/libsvn_client/ra.c' line 692: assertion 
> > > failed (SVN_IS_VALID_REVNUM(start_revnum))
> > > Aborted
> > >
> >
> > Hello!
> >
> > I made a patch which fixes this bug.
> >
> > [[[
> > Fix bug: Add check of the changeno_end variable for zero.
> >
> > The parser of the --change argument already checks the revision
> > number for a zero and raises an error, because there are no changes.
> > However, if a range is given to this argument it would not check
> > its second part, and the command aborts.
> >
> > Command to reproduce:
> > $ svn diff https://svn.apache.org/repos/asf -c 1-0
> >
> > Adding the check of the changeno_end variable for zero will fix
> > the problem.
> >
> > * subversion\svn\svn.c
> >   (sub_main): Add check of the changeno_end variable for zero.
> > * subversion\tests\cmdline\diff_tests.py
> >   (diff_invalid_change_arg): Add test case for a diff of change,
> >   done in revision range '1-0' and expect an error from it.
> >
> > Found by: jun66j5
> > ]]]
> >
> > Best regards.
>
> Oops, I found that the patch doesn't apply because of wrong encoding.
> Attaching a new one.
>
> --
> Timofei Zhakov


Committed in r1917944.
Nominated for backport to 1.14.x in r1917945.

Thanks!
Nathan

Reply via email to