[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: Mon, 2 Dec 2019 00:08:48 +0000

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 want to know whether the WC is mixed revision, like I said ☺ But let
me give some background about my use-case.

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. I assume that
solutions that read wc.db but don't look at the on-disk files at all
would be sufficiently performant.

Furthermore, I need just summary information. The plugin's output is
generally limitd to one or two condensed lines (comparable to a
customized status line in vim/tmux). Usually it's just a few numbers
and boolean indications.

Thus, `svnversion` sans text mods is actually a very good fit for my
use-case.

'info --x-viewspec' provides a superset of the information `svnversion
--no-stat` would provide, at comparable cost, so it'd be an option (more
so if it were covered by our compatibility promises). However, I'd have
to parse and condense the information myself, which would basically mean
implementing a third-party wrapper around `info --x-viewspec` that does
exactly what `svnversion --no-stat` would do. I'd rather cut out the
middleman. ☺

----
Not related to svnversion: In my use-case, another thing that'd be nice
to have is an overview of the changelists in the working copy — again,
without actually doing a tree walk.  I can think of two shapes an API
for this might take:
- An API that provides the list of changelist names, cheaply.  ('svn st'
  and 'svn info' provide this, but they're both expensive.)
  The list of names could be unsorted.  If we were to sort it, perhaps
  sorting by number of files or by the mtime of of member files [either
  nodes.last_mod_time or on-disk mtime] would be useful.
- An API such as «svn st --files-that-are-in-a-changelist».  Unlike
  --changelist, this would show information about _all_ changelists, not
  just one.
  This would basically be the opposite of issue #3348.  (I am reminded
  of hg revspecs¹.)
Cheers,
Daniel
¹ hg revspecs is a DSL for specifying sets of revisions.
Received on 2019-12-02 01:08:55 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.