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

Re: svn commit: r17190 - trunk/subversion/libsvn_wc

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-11-07 01:25:24 CET

On Mon, 2005-11-07 at 00:06 +0000, Julian Foad wrote:
> Daniel Berlin wrote (earlier):
> >>
> >> $ svn diff -r0 wc
> >> Index: /tmp/tmp
> >> ===================================================================
> >> Index: wc/foo
> >> ===================================================================
> >> --- wc/foo (revision 0)
> >> +++ wc/foo (working copy)
> >> @@ -1 +0,0 @@
> >> -xxx
> >>
> >> It's that really the correct output?
> >
> > That's not the output i get, but i've got an external diff configured :(
>
> Well, what output do you get? Philip replied "External diff makes no
> difference as far as I can see." If you got something similar to this, don't
> you agree it's wrong?

Similar, but not the same.

I only get the Index: wc/foo part.

I get no Index: /tmp/tmp line.

> If you got something very different, what's up?
>
>
> Daniel Berlin wrote:
> >> deleted perhaps I should get an empty diff:
> >>
> >> $ svn diff -r0 wc
> >> Index: wc/foo
> >> ===================================================================
> >>
> >> In all our diffs there is the issue about whether the header should be
> >> suppressed if there is no difference, but given that we currently show
> >> the header I would expect a single empty diff with the correct header.
> >
> > Okay.
> > Try the attached, it should give the output you are looking for
> > If so, i'll work up a changelog and commit it.
>
> Daniel, it's great that you're so quick to come up with a new fix, but please
> repost the patch with its log message (and "[PATCH]" in the subject line) and
> hold off committing until tomorrow to give the weekday workers a chance to
> review it and check whether it's the right fix.

Julian: I don't know what gives you the idea that what i say means i
wouldn't follow the rules in hacking.html, but i have in the past, and
will in the future.

I'm sorry if i don't precisely write exactly every single step i plan on
taking before committing this patch (which includes posting it with a
proper changelog and waiting), and this bothers you, however you can
assume safely that i would not go off and just randomly start committing
things without posting them properly. Are you next going to point out i
didn't say i would run the regression tests before committing it?

As for the test below, i fixed it well before your email, but ...

> >
> > +def diff_schedule_delete(sbox):
> > + "scheduled deleted"
> > + sbox.build()
> > + wc_dir = sbox.wc_dir
> > + was_cwd = os.getcwd()
> > + os.chdir(wc_dir)
> > + svntest.main.file_append('foo', "xxx")
> > + svntest.main.run_svn(None, 'add', 'foo')
> > + diff_output, err_output = svntest.main.run_svn(None, 'ci', '-m', 'log msg')
>
> There's no need to create and add a file: the default test repository already
> has one, called "iota", in order to save test writers from this chore.

But it won't help in this case, for the reasons below.

> > + if err_output: raise svntest.Failure
> > + svntest.main.run_svn(None, 'rm', 'foo')
> > + diff_output, err = svntest.actions.run_and_verify_svn(None, None, [],
> > + 'diff', '-r', '0' )
> > + if err: raise svntest.Failure
>
> Although lack of stderr output is sufficient to distinguish the fix from the
> original behaviour, it would be much better to test the contents of
> "diff_output", like most of the other tests in that file do.

Except you can't do this if you use iota.

svn diff -r 0 foo (or iota) won't show the bug.
svn commit and svn diff -r 0 will show the output from the rest of the
diff (which includes all the files because they haven't been committed
yet).

The bug only tickles when you are comparing a revision the file was
added in.
Thus, you can't use iota, because it's revision includes the othe
rfiles, and excluding them won't work.
You actually have to add a new file, commit it, remove it, and then diff
*that* revision, to be able to compare out.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 7 01:26:09 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.