<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 20:59:27 +0000</lastBuildDate>
    <item>
      <title>(Python) Color-Coded `svn status` (v3) - philchristensen</title>
      <link>https://snipplr.com/view/28748/colorcoded-svn-status-v3</link>
      <description>&lt;p&gt;First there was: [http://snipplr.com/view/15246/color-coded-svn-status](http://snipplr.com/view/15246/color-coded-svn-status)&#13;
&#13;
Then there was: [http://snipplr.com/view/16540/color-coded-svn-status-v2](http://snipplr.com/view/16540/color-coded-svn-status-v2)&#13;
&#13;
A few days ago, I found a handy script online that colorized the output of SVN status. It worked pretty well, but needed a little polish and a couple of tweaks to make it use more common Python idioms. As I continued to use it and fix bugs and inefficiencies, I ended up replacing nearly every line in the original, but it was still a great starting point.&#13;
&#13;
Additional changes include ANSI word-wrapping, a configurable tab expansion feature (for better code alignment), the 'colorizedSubcommands' sequence so that only applicable commands get colorized, use of proper `subprocess` module calls so that piping through `less` will work (for example, try `svn-color diff | less -r` to see colorized diff output).&#13;
&#13;
To use, stick it somewhere, make executable (`chmod 755`), and then add this to your .profile:&#13;
&#13;
    alias svn=/usr/local/bin/svn-color.py&#13;
&#13;
I hope you find my modifications useful. You can modify the colors used by looking up the ANSI color codes for your preferred color scheme and editing the 'statusColors' dictionary. Here's a useful reference for ANSI color values:&#13;
&#13;
[http://www.ibm.com/developerworks/linux/library/l-tip-prompt/colortable.gif](http://www.ibm.com/developerworks/linux/library/l-tip-prompt/colortable.gif)&#13;
&#13;
Requires Python 2.4 or greater.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Feb 2010 11:40:06 UTC</pubDate>
      <guid>https://snipplr.com/view/28748/colorcoded-svn-status-v3</guid>
    </item>
  </channel>
</rss>
