Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Remove all the associated files from a changelist and it'll disappear.</p> <h1>Official way</h1> <p>See <a href="https://stackoverflow.com/a/15992735/253468">https://stackoverflow.com/a/15992735/253468</a></p> <pre><code>svn changelist --remove --recursive --cl my_changes . </code></pre> <h1>Manual way</h1> <p>i.e. <code>svn changelist --remove file.name</code></p> <pre><code>D:\Programming&gt;mkdir test D:\Programming&gt;cd test D:\Programming\test&gt;svnadmin create . D:\Programming\test&gt;svn co file:///D:\Programming\test co Checked out revision 0. D:\Programming\test&gt;cd co D:\Programming\test\co&gt;echo "hello" &gt; test.file D:\Programming\test\co&gt;svn add test.file A test.file D:\Programming\test\co&gt;svn status A test.file D:\Programming\test\co&gt;svn changelist mycl test.file A [mycl] test.file D:\Programming\test\co&gt;svn status --- Changelist 'mycl': A test.file D:\Programming\test\co&gt;svn changelist --remove test.file D [mycl] test.file D:\Programming\test\co&gt;svn status A test.file </code></pre> <h1>Automation in Bash</h1> <pre><code># Remove all files from a specific CL # Usage: svn_remove_cl my_changes function svn_remove_cl() { svn status |\ sed -n "/--- Changelist '$1':/,/--- Changelist.*/p" |\ grep -v '^--- Changelist' |\ awk '{print $2}' |\ xargs svn changelist --remove } </code></pre> <p>Explanation:</p> <ul> <li><code>svn status</code>: output all the modified files</li> <li><code>sed</code>: find the changelist and take the output after the CL title until the next CL or the end of <code>svn status</code>'s output</li> <li><code>grep</code>: remove the CL titles from the buffer</li> <li><code>awk</code>: remove the file statuses, keep only the filenames (i.e. the second column)</li> <li><code>xargs</code>: put each line as an argument to <code>svn changelist</code><br> (may need tweaks if you have spaces or special characters in the filenames)</li> </ul> <h2>Example run</h2> <pre><code>~/tmp/wc$ svn status A d --- Changelist 'cl_a': A a A e A f --- Changelist 'cl_x': A b A c ~/tmp/wc$ svn_remove_cl cl_x Path 'b' is no longer a member of a changelist. Path 'c' is no longer a member of a changelist. ~/tmp/wc$ svn status A b A c A d --- Changelist 'cl_a': A a A e A f </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload