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

Re: Feature request: Restoring pristines

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 10 Nov 2016 16:19:37 +0000

Stefan Hett wrote on Thu, Nov 10, 2016 at 11:52:43 +0100:
> On 11/10/2016 8:08 AM, Cooke, Mark wrote:
> >>-----Original Message-----
> >>From: Stefan [mailto:luke1410_at_posteo.de]
> >>Sent: 09 November 2016 21:43
> >>To: users_at_subversion.apache.org
> >>Subject: Re: Feature request: Restoring pristines
> >>
> >>On 11/9/2016 21:22, Branko Čibej wrote:
> >>>On 08.11.2016 21:51, Stefan wrote:
> >>>>I didn't test this, but
> >>>This is how all down-voted stackoverflow answers start. :)
> >>>
> >>>-- Brane
> >>>
> >>OK, I see. Tested and it doesn't work. ;-)
> >>
> >>Certainly sounds like a reasonable request for an improvement to have at
> >>least svn co auto correct the case of missing pristine files, as far as
> >>I'm concerned.
> >>
> >>Regards,
> >>Stefan
> >Would this not fit better as part of `update` rather than `checkout` over an existing working copy?
> >
> >~ mark c
> >
> IMO it should be part of both, since both operations (aka: svn update as
> well as svn checkout) will error out, if a pristine would be required but
> missing (and this is some error, the operation could easily resolve without
> user interaction).
>

I thought of 'cleanup' as the appropriate place, since fixing violated
invariants should be opt-in;

However, let's not bikeshed about the UI. My concern about this change
is that by the time a pristine is absent, one invariant is no longer
holding so there may be additional problems. I.e., there's no guarantee
that after running «svn cleanup --reinvariant=missing-pristines» the wc
will be in a valid state.

That said, the feature might be useful in certain cases and ought to be
pretty easy to implement, so perhaps someone will write it? It might
even make sense to write it as an external script, at least at first, to
(a) shake out any bugs, (b) allow users of 1.9 and older to use it.

The external script should be quite short; it just needs to check
SVN_WC__VERSION, then to run `svn info` and `svn cat`. (That's assuming
the on-disk file is missing but the sqlite entry (in the PRISTINES
table) is still present.)

Cheers,

Daniel
Received on 2016-11-10 17:22:02 CET

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

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