Discussion:
Subversion server
Bellamy Baron
2018-07-03 14:32:04 UTC
Permalink
Does anyone know of a way to export a directory directly from a subversion
server and exclude certain filetypes?

Thanks in advance for your assistance.
--
--------------------------------------------------------------------------------------------------------
Bellamy
Specialist - iWYZE
https://www.iwyze.co.za/products/car-insurance
Johan Corveleyn
2018-07-05 09:53:19 UTC
Permalink
Post by Bellamy Baron
Does anyone know of a way to export a directory directly from a subversion
server and exclude certain filetypes?
Not as far as I know. If you are using TortoiseSVN, maybe something
can be done with client-side hook scripts [1], for example delete
unwanted files after exporting. Though I don't think there are
client-side hooks for the "export" operation.

I do think it would be a great feature though, to have --include and
--exclude options (with glob-like syntax, like our recent --search
option for 'svn ls') for certain svn commands. With server-side
support to only send the matching items (and falling back to pure
client-side filtering when talking to older servers). Then one could
do these as an efficient operation (if there is server-side support):

* svn cat -R --include '*.txt' $URL
* svn export --include 'build.xml' $URL (<- creating sparse directory
structure with only the matching files)
* svn export --exclude '*.iso' $URL

[1] https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks
--
Johan
Daniel Shahaf
2018-07-05 15:22:48 UTC
Permalink
Post by Johan Corveleyn
I do think it would be a great feature though, to have --include and
--exclude options (with glob-like syntax, like our recent --search
option for 'svn ls') for certain svn commands. With server-side
support to only send the matching items (and falling back to pure
client-side filtering when talking to older servers). Then one could
Even without any new server-side support, if the client can be assumed
to have `svn ls -R` output, then it can simply drive the reporter in the
right way for the server to return exactly the right data.
Post by Johan Corveleyn
* svn cat -R --include '*.txt' $URL
* svn export --include 'build.xml' $URL (<- creating sparse directory
structure with only the matching files)
* svn export --exclude '*.iso' $URL
This reminds me of the new authz-with-globs feature...
Daniel Shahaf
2018-07-05 15:23:43 UTC
Permalink
Post by Daniel Shahaf
Post by Johan Corveleyn
I do think it would be a great feature though, to have --include and
--exclude options (with glob-like syntax, like our recent --search
option for 'svn ls') for certain svn commands. With server-side
support to only send the matching items (and falling back to pure
client-side filtering when talking to older servers). Then one could
Even without any new server-side support, if the client can be assumed
to have `svn ls -R` output, then it can simply drive the reporter in the
right way for the server to return exactly the right data.
The "reporter" is the server-side interface that answers 'svn update' requests.
Post by Daniel Shahaf
Post by Johan Corveleyn
* svn cat -R --include '*.txt' $URL
* svn export --include 'build.xml' $URL (<- creating sparse directory
structure with only the matching files)
* svn export --exclude '*.iso' $URL
This reminds me of the new authz-with-globs feature...
Johan Corveleyn
2018-07-06 07:15:43 UTC
Permalink
Post by Daniel Shahaf
Post by Johan Corveleyn
I do think it would be a great feature though, to have --include and
--exclude options (with glob-like syntax, like our recent --search
option for 'svn ls') for certain svn commands. With server-side
support to only send the matching items (and falling back to pure
client-side filtering when talking to older servers). Then one could
Even without any new server-side support, if the client can be assumed
to have `svn ls -R` output, then it can simply drive the reporter in the
right way for the server to return exactly the right data.
Ah yes, indeed. That'll surely be more efficient than downloading all
files and filtering client-side.

On top of that, the client can use the new-in-1.10 'svn ls -R --search
$glob-pattern' to gather the already-filtered list of files (a 1.10
server will perform the filtering of the list of files on the
server-side then). This is beginning to sound like low-hanging fruit
:-). For the include case at least ... for the exclude case there is
no server-optimized ls operation (yet).
--
Johan
Loading...