snipt

Ctrl+h for KB shortcuts

Bash

Roll back to a previous revision in Subversion

1
2
3
svn update
svn merge -r <current_revision>:<previous_revision> .
svn commit -m "Rolled back to <previous_revision>"
https://snipt.net/embed/c57cef74727cd13166ea5c64176c10ff/
https://snipt.net/raw/c57cef74727cd13166ea5c64176c10ff/
c57cef74727cd13166ea5c64176c10ff
bash
Bash
3
2016-09-21T23:05:28
True
False
False
/api/public/snipt/105516/
roll-back-to-a-previous-revision-in-subversion
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>svn update </span><span id="L-2"><a name="L-2"></a>svn merge -r &lt;current_revision&gt;:&lt;previous_revision&gt; . </span><span id="L-3"><a name="L-3"></a>svn commit -m <span class="s2">&quot;Rolled back to &lt;previous_revision&gt;&quot;</span> </span></pre></div> </td></tr></table>
subversion

Bash

List properties recursively

svn proplist -v -R <directory>
https://snipt.net/embed/bb3bded62d7c60d4520fef426aa0353c/
https://snipt.net/raw/bb3bded62d7c60d4520fef426aa0353c/
bb3bded62d7c60d4520fef426aa0353c
bash
Bash
1
2016-09-21T23:05:34
True
False
False
Oct 26, 2012 at 09:05 PM
/api/public/snipt/49130/
list-properties-recursively
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>svn proplist -v -R &lt;directory&gt; </span></pre></div> </td></tr></table>
subversion

Bash

Remove missing files

$ svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
https://snipt.net/embed/757e83864a6bcfef4d3ea437578a2e60/
https://snipt.net/raw/757e83864a6bcfef4d3ea437578a2e60/
757e83864a6bcfef4d3ea437578a2e60
bash
Bash
1
2016-09-22T05:04:52
True
False
False
/api/public/snipt/44856/
remove-missing-files
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>svn rm <span class="k">$(</span> svn status <span class="p">|</span> sed -e <span class="s1">&#39;/^!/!d&#39;</span> -e <span class="s1">&#39;s/^!//&#39;</span> <span class="k">)</span> </span></pre></div> </td></tr></table>
subversion

Text only

Revert a faulty change SubVersion

1
2
3
4
5
6
7
8
Suppose you have changes that turned out to be broken, but stuff that works
has been committed since. This can fix it:

svn merge -r 673:669 https://host/svn/project/trunk

669 is the version just before the broken stuff was committed and 673 is the start of stuff that works. So The change between revision 669 and 673 is reverted and applied.

don't forget to commit this.
https://snipt.net/embed/ea107abcf34d1f57d7c1002256ce589e/
https://snipt.net/raw/ea107abcf34d1f57d7c1002256ce589e/
ea107abcf34d1f57d7c1002256ce589e
text
Text only
8
2016-09-23T17:31:42
True
False
False
/api/public/snipt/33579/
revert-a-faulty-change-subversion
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Suppose you have changes that turned out to be broken, but stuff that works </span><span id="L-2"><a name="L-2"></a>has been committed since. This can fix it: </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>svn merge -r 673:669 https://host/svn/project/trunk </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>669 is the version just before the broken stuff was committed and 673 is the start of stuff that works. So The change between revision 669 and 673 is reverted and applied. </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>don&#39;t forget to commit this. </span></pre></div> </td></tr></table>
subversion, svn

MuPAD

check syntax of all php files before an svn commit

for i in `svn status | egrep '^(M|A)' | sed -r 's/\+\s+//' | awk '{ print $2 }'` ; do if [ ! -d $i ] ; then php -l $i ; fi ; done
https://snipt.net/embed/e51cba722b07c0cc5a071d1fcd32b95f/
https://snipt.net/raw/e51cba722b07c0cc5a071d1fcd32b95f/
e51cba722b07c0cc5a071d1fcd32b95f
mupad
MuPAD
1
2016-09-21T23:05:57
True
False
False
/api/public/snipt/30883/
check-syntax-of-all-php-files-before-an-svn-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">for</span> <span class="nv">i</span> <span class="ow">in</span> <span class="nv">`svn status | egrep &#39;^(M|A)&#39; | sed -r &#39;s/\+\s+//&#39; | awk &#39;{ print $2 }&#39;`</span> <span class="o">;</span> <span class="k">do</span> <span class="k">if</span> <span class="p">[</span> <span class="o">!</span> <span class="o">-</span><span class="nv">d</span> <span class="o">$</span><span class="nv">i</span> <span class="p">]</span> <span class="o">;</span> <span class="k">then</span> <span class="nv">php</span> <span class="o">-</span><span class="nv">l</span> <span class="o">$</span><span class="nv">i</span> <span class="o">;</span> <span class="nv">fi</span> <span class="o">;</span> <span class="nv">done</span> </span></pre></div> </td></tr></table>
bash, php, subversion, svn

MuPAD

use vim to get colorful diff output

svn diff | view -
https://snipt.net/embed/e90133f066ceed71f94a49b24b896daa/
https://snipt.net/raw/e90133f066ceed71f94a49b24b896daa/
e90133f066ceed71f94a49b24b896daa
mupad
MuPAD
1
2016-09-21T23:06:06
True
False
False
/api/public/snipt/30881/
use-vim-to-get-colorful-diff-output
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">svn</span> <span class="nv">diff</span> <span class="o">|</span> <span class="nv">view</span> <span class="o">-</span> </span></pre></div> </td></tr></table>
bash, subversion, svn, vim

MuPAD

show top committers for the last month

svn log -r {`date +"%Y-%m-%d" -d "1 month ago"`}:HEAD|grep '^r[0-9]' |cut -d\| -f2|sort|uniq -c
https://snipt.net/embed/d72883ebadde361e0538599ddc8a7317/
https://snipt.net/raw/d72883ebadde361e0538599ddc8a7317/
d72883ebadde361e0538599ddc8a7317
mupad
MuPAD
1
2016-09-21T23:06:13
True
False
False
/api/public/snipt/30880/
show-top-committers-for-the-last-month
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">svn</span> <span class="nv">log</span> <span class="o">-</span><span class="nv">r</span> <span class="p">{</span><span class="nv">`date +&quot;%Y-%m-%d&quot; -d &quot;1 month ago&quot;`</span><span class="p">}</span><span class="o">:</span><span class="nv">HEAD</span><span class="o">|</span><span class="nv">grep</span> <span class="o">&#39;^</span><span class="nv">r</span><span class="p">[</span><span class="m">0</span><span class="o">-</span><span class="m">9</span><span class="p">]</span><span class="o">&#39;</span> <span class="o">|</span><span class="nv">cut</span> <span class="o">-</span><span class="nv">d</span>\<span class="o">|</span> <span class="o">-</span><span class="nv">f2</span><span class="o">|</span><span class="nv">sort</span><span class="o">|</span><span class="nv">uniq</span> <span class="o">-</span><span class="nv">c</span> </span></pre></div> </td></tr></table>
bash, subversion, svn

MuPAD

list of files committed for the last 10 days

svn diff -r{`date -d "-10 day" +"%Y-%m-%d"`}:HEAD --summarize . | grep . | awk '{print $2}' | grep -E -v '^\.$'
https://snipt.net/embed/52eaadcd1a4391a833dba189674356c0/
https://snipt.net/raw/52eaadcd1a4391a833dba189674356c0/
52eaadcd1a4391a833dba189674356c0
mupad
MuPAD
1
2016-09-21T23:06:23
True
False
False
/api/public/snipt/30867/
list-of-files-committed-for-the-last-10-days
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">svn</span> <span class="nv">diff</span> <span class="o">-</span><span class="nv">r</span><span class="p">{</span><span class="nv">`date -d &quot;-10 day&quot; +&quot;%Y-%m-%d&quot;`</span><span class="p">}</span><span class="o">:</span><span class="nv">HEAD</span> <span class="o">--</span><span class="nv">summarize</span> <span class="o">.</span> <span class="o">|</span> <span class="nv">grep</span> <span class="o">.</span> <span class="o">|</span> <span class="nv">awk</span> <span class="o">&#39;</span><span class="p">{</span><span class="nv">print</span> <span class="o">$</span><span class="m">2</span><span class="p">}</span><span class="o">&#39;</span> <span class="o">|</span> <span class="nv">grep</span> <span class="o">-</span><span class="no">E</span> <span class="o">-</span><span class="nv">v</span> <span class="o">&#39;^</span>\<span class="o">.$&#39;</span> </span></pre></div> </td></tr></table>
bash, subversion, svn

MuPAD

show top committers for SVN repositority for today

svn log -r {`date "+%Y-%m-%d"`}:HEAD|grep '^r[0-9]' |cut -d\| -f2|sort|uniq -c
https://snipt.net/embed/5b8264fca16f6754b19cc4ce6ad16a59/
https://snipt.net/raw/5b8264fca16f6754b19cc4ce6ad16a59/
5b8264fca16f6754b19cc4ce6ad16a59
mupad
MuPAD
1
2016-09-24T16:29:43
True
False
False
/api/public/snipt/30866/
show-top-committers-for-svn-repositority-for-today
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">svn</span> <span class="nv">log</span> <span class="o">-</span><span class="nv">r</span> <span class="p">{</span><span class="nv">`date &quot;+%Y-%m-%d&quot;`</span><span class="p">}</span><span class="o">:</span><span class="nv">HEAD</span><span class="o">|</span><span class="nv">grep</span> <span class="o">&#39;^</span><span class="nv">r</span><span class="p">[</span><span class="m">0</span><span class="o">-</span><span class="m">9</span><span class="p">]</span><span class="o">&#39;</span> <span class="o">|</span><span class="nv">cut</span> <span class="o">-</span><span class="nv">d</span>\<span class="o">|</span> <span class="o">-</span><span class="nv">f2</span><span class="o">|</span><span class="nv">sort</span><span class="o">|</span><span class="nv">uniq</span> <span class="o">-</span><span class="nv">c</span> </span></pre></div> </td></tr></table>
bash, subversion, svn

Bash

Revert to a previous revision

$ svn merge -rHEAD:<revision> .
https://snipt.net/embed/0dc6e4e25b4eddc12d4de9e0e8f245ab/
https://snipt.net/raw/0dc6e4e25b4eddc12d4de9e0e8f245ab/
0dc6e4e25b4eddc12d4de9e0e8f245ab
bash
Bash
1
2016-09-21T23:06:37
True
False
False
/api/public/snipt/29359/
revert-to-a-previous-revision
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>svn merge -rHEAD:&lt;revision&gt; . </span></pre></div> </td></tr></table>
subversion
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.