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

Re: Backport of r20042 (Improve usability for Svn::Core::Dirent::time...)

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-07-11 20:17:06 CEST

On Wed, 12 Jul 2006, Kobayashi Noritada wrote:

> Hi,
>
> > > > I was looking at the remaining backport proposals, and this one stuck
> > > > out in my mind. Is it really a valid change from a backwards
> > > > compatibility standpoint? What about old code that expected
> > > > Dirent#time to return an integer?
> > >
> > > Dirent#time should return a Time because of its name. Returning a Time is
> > > a correct behaviour and returning an Integer is not so good. The Integer
> > > value is completely useless because it cannot be converted without knowing
> > > what APR-time integer means and how to convert it to a Time. Other
> > > methods returning time-related values already do that conversion inside
> > > and returns a Time, and Dirent#time follows that manner in this change.
> > > So, I think this is an improvement close to a minor-buglet fix.
> > >
> > > Those who expect it returns an Integer can now use Dirent#_time to get
> > > the value, but no one would like to do so... (I wonder how many users
> > > have used older Dirent#time without getting skeptical about the behaviour.)
> >
> > That makes perfect sense, but it still breaks our compatibility policy
> > by making people fix their code when they upgrade. There are a lot of
> > functions in the public Subversion API that I'd LOVE to change to make
> > them "better" in some way, but I can't because people are already
> > using them. Aren't there potentially already people using the
> > Dirent#time method from 1.3.x who are assuming it returns an integer?
> >
> > So, in short, no argument that it's a better API, but that doesn't
> > make it right.
>
> Umm..., I see. I know the policy. I was kidding myself only because it
> is clearly not a good API and it is a binding issue... So I'd love to
> write another patch to keep the backward compatibility.
>
> Kouhei, which is a better way, to add another method returning a Time
> (whose name I cannot think of...) to Dirent, or to add an argument which
> can adjust a type of the return value?

From the sound of it, the old API is useless to your typical Ruby
developer to the point where it could be considered broken. This
seems like a reasonable place to bend the rules...

If not, the old API should be deprecated, at least.

  • application/pgp-signature attachment: stored
Received on Tue Jul 11 20:17:48 2006

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