SVN: Vacuum/delete pristine copies from command line
Solution 1
For TortoiseSVN the option or parameter is /vacuum
as mentioned by the developer in an email. As you've pointed out it is currently missing in the documentation.
SVN 1.8 introduced automatic vacuuming of pristines to the cleanup
command and 1.9 made it and other features optional. Source: SVN changelog.
Solution 2
For svn before 1.10, you just type "svn cleanup" without any parameters. Svn will automatically vacuum pristines after finishing cleanup.
For svn 1.10 (maybe or later, I hope), you type the above command along with "--vacuum-pristines" ("svn cleanup --vacuum-pristines"), and svn will do the same for you. But you can add other parameters as well and svn will execute all of them in one command. For example, ("svn cleanup --remove-unversioned --remove-ignored --vacuum-pristines")
Of course, like older versions, type "svn cleanup" without any parameters will vacuum it as well in 1.10.
Related videos on Youtube
hardmooth
BY DAY: mathematician and coder. BY NIGHT: juggler, musician, typesetter Focus on smart algorithms, coding style and clean structures (including strict code alignment). experience in C/C++, Python, R, LaTeX, Lilypond, Perl, Bash, Qt, ...
Updated on September 18, 2022Comments
-
hardmooth over 1 year
How can I vacuum/delete all pristine copies of a working copy from command line?
Use case:
- I have multiple working copies (20+) checked out
(same case for many developers in our firm) - some of those working copies grow large over time
- When disk space is scarce, I need to clean up every working copy by hand as described in this answer (previously checking, which working copies take up most of the disk space)
- Bonus: calculate (estimate?) disk space occupied by pristine copies and only call cleanup, if it will result in ... GBs to be freed up.
This is tedious and error-prone, so I'd like to automate these 20+ cleanups into a
vacuum_pristine_copies.XXX
Script, which can be executed in the hour of deepest need.enclosed label
- It is possible to call
cleanup
from command line (see the docs here).
However, this lacks a/vacuum-pristine
option. (We already use this TortoiseSVN-automation to do batched updates). - We're working on Windows machines, but we're not fixed on
CMD
.
One possible alternative could be Python27.
- I have multiple working copies (20+) checked out
-
hardmooth about 8 yearsmy problem with the
TortoiseProc.exe /command:cleanup /vacuum ...
is that it opens a dialog for each working directory. I'd prefer the fire-and-forget-script. thesvn cleanup
somehow doesn't reduce the working directory size (>6GB), while running a TortoiseSVN cleanup does (<4GB). -
dotn3b about 8 years@hardmooth As mentioned in the TSVN automation documentation you've linked you should be able to hide the dialog with
/noui
,/noprogressui
and/or/nodlg
. Regarding the standard SVN client: What I can gather from the 1.9.4 source code is that you must not supply--remove-unversioned
or--remove-ignored
. The term vacuum is used not just regarding the "vacuuming of pristines" but also when referring to removal of unversioned or ignored files which IMHO causes some confusion in the code and seemingly the implementation thereof. Also make sure the path you specify is the WC's root. -
Norio Akagi over 6 yearsFirst link is broken, perhaps this thread contains the same info. The "no ui" syntax would be something like
TortoiseProc.exe /command:cleanup /noui /cleanup /vacuum /externals /refreshshell /noprogressui /path:.
(leave path to.
for current folder or change as needed of course). One thing to note is that this command isn't blocking, i.e. it just starts the process and returns immediately, so running this in a for-loop inside a batch script might create many background processes. -
hardmooth about 6 years
svn cleanup --vacuum-pristines
yields (SVN 1.9.3) the errorsvn.exe: invalid option: --vacuum-pristines
-
hearst about 6 yearsI told you that --vacuum-pristines only available for svn v1.10 or above, could you check my words more carefully?
-
hardmooth about 6 yearsYes, you did! My mistake - I read
1.1.0
instead of1.10
.