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

Re: [PATCH] svnversion --no-stat (and an idea about changelists)

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 10 Dec 2019 03:17:26 +0000

Nathan Hartman wrote on Mon, Dec 09, 2019 at 09:04:20 -0500:
> On Sun, Dec 1, 2019 at 7:08 PM Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
>
> > Julian Foad wrote on Sun, Dec 01, 2019 at 12:01:09 +0000:
> > > Daniel Shahaf wrote:
> > > > I'd like to get the "is this WC mixed revision?" and "is this WC
> > switched?" bits without stat()-ing every single file in the worktree.
> > >
> > > What info do you actually want, functionally? Some info about the WC
> > base "shape" like "svn info --x-viewspec" gives?
> >
> > I use a shell plugin that shows svn/git information above the shell
> > prompt. The plugin shows the revision number of the working copy
> > checked out in cwd — IIRC, what is shows specifically is the BASE
> > revision of ./ — and I'd like to have an indication that the wc is
> > mixed-revision.
> >
> > At the same time, because the plugin assembles its data whenever a new
> > prompt is drawn, I'd like the data collection to be fast.
>
>
> Instead of --no-stat maybe call it --skip-disk-scan which self-explains
> what it's supposed to (not) do and implies that it's meant to trade
> accuracy for speed?

Everyone, let's please not bikeshed on the option name until the actual changes
are agreed on. Brane's original review was sufficient for me to consider the
option name change a blocker.

> Some other thoughts...
>
> Instead of stringing together UNIX commands, (which might not be available
> on Windows), maybe it would be useful to have a '--format' argument that
> takes printf-like codes and prints custom strings?

No comment on the proposal, but the config file parser code supports something
like this already: see subversion/tests/libsvn_subr/config-test.c:422.

> Instead of adding this to the client or core binaries, perhaps implement a
> standalone program that uses the svn libs to construct prompt strings? It
> could be in contrib?

contrib/ is deprecated, and in any case, I'm not going to write a standalone program
for that. There's already such a program; all I'm writing is hooks/patches for it
to teach it how to retrieve some of the information svnversion(1) prints.

Furthermore, I'm not sure I have anything worth sharing. I have a piece of
Python code that lists changelists by mtime, but it hardcodes a wc.db format
number check, so it'll fail hard on any wc newer than format 31; and I don't
have anything for determining mixed-revisionness. (I suppose I could set a
dummy property on the wcroot, run svnversion, and then revert the propmod.
That would use public API's only, but rely on an implementation detail of
svn_wc_revision_status2() for performance.)

> Ideas are a dime a dozen so that's my 3 1/3 cents :-)

We could create an SQL VIEW with some interesting data and declare it an
experimental public API.

That'll be $0.0083, please. :)
Received on 2019-12-10 04:17:41 CET

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.