<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6027753586757821206</id><updated>2012-02-16T18:29:49.021-08:00</updated><title type='text'>Coding Under the Influence</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codingundertheinfluence.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6027753586757821206/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codingundertheinfluence.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>John</name><uri>http://www.blogger.com/profile/10842804831103431305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp3.blogger.com/_9IDDAOgGRn8/R68vnf5pG8I/AAAAAAAAAAM/ET-oMXETmVw/S220/n17500088_30938866_8385.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6027753586757821206.post-8091663765223602920</id><published>2010-02-19T08:39:00.000-08:00</published><updated>2010-02-19T08:39:44.914-08:00</updated><title type='text'>Improving Google Buzz Subscriptions</title><content type='html'>Maybe someone at Google will stumble across this. Ah well, here goes:&lt;br /&gt;&lt;br /&gt;Some of my friends/followers on here don't care or want to see everything that I end up publishing. For example, Carlos really has no interest in seeing what I share on Reader. But others &lt;i&gt;might&lt;/i&gt; be interested in that stuff. I'm not claiming anyone is, but it's possible. Similarly, not everyone cares to read what I post on Twitter. Right now it's an all or nothing game. I could potentially make custom groups for each stream I publish... removing people from greoups when they don't want to be included, but that's a lot of hassle. I have no idea up front who cares about what.&lt;br /&gt;&lt;br /&gt;There's an easy fix for this though. The publisher side doesn't really need any changes: let me publish my various streams, each with its privacy settings, just like I do now.&amp;nbsp; But on the subscriber side, give my followers a list of the streams being published, and let them filter the ones they don't want. Let them subscribe to any subset of what I publish. Then they can decide for themselves if they're interested in general buzz and flickr posts, but not my talk status or Reader shares.&lt;br /&gt;&lt;br /&gt;With this capability, a subscriber can start out subscribed to everything, but then drop the streams that turn out to be of no interest or a bother.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6027753586757821206-8091663765223602920?l=codingundertheinfluence.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingundertheinfluence.blogspot.com/feeds/8091663765223602920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingundertheinfluence.blogspot.com/2010/02/improving-google-buzz-subscriptions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6027753586757821206/posts/default/8091663765223602920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6027753586757821206/posts/default/8091663765223602920'/><link rel='alternate' type='text/html' href='http://codingundertheinfluence.blogspot.com/2010/02/improving-google-buzz-subscriptions.html' title='Improving Google Buzz Subscriptions'/><author><name>John</name><uri>http://www.blogger.com/profile/10842804831103431305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp3.blogger.com/_9IDDAOgGRn8/R68vnf5pG8I/AAAAAAAAAAM/ET-oMXETmVw/S220/n17500088_30938866_8385.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6027753586757821206.post-5423902410743116628</id><published>2010-01-29T14:30:00.000-08:00</published><updated>2010-02-19T10:17:07.933-08:00</updated><title type='text'>Using meld as your external merge tool for subversion (svn)</title><content type='html'>&lt;i&gt;updated 2/19/2010&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt; &lt;br /&gt;I don't know about you, but I am not a fan of SVN's built-in merge tool. Nor do I much care for GNU diff3, which subversion's tool seems to mimic. The diffs are presented inline in a simple text editor. It's simple, it works, but it's not exactly user-friendly.&lt;br /&gt;&lt;br /&gt;So maybe you've used Meld. Meld provides a great, easy-to-use GUI for doing merges. If you're familiar with it, then you know what I'm talking about. If you're not, check it out &lt;a href="http://meld.sourceforge.net/"&gt;Meld's sourceforge page&lt;/a&gt;, which includes screenshots. The key for me is the side-by-side view, but there are other great features like single clicks to move changes between files, syntax highlighting, and line numbering, to name a few.&lt;br /&gt;&lt;br /&gt;So the question is, how can I use Meld to manage all my svn merge conflicts? Luckily, subversion allows you to call upon an external editor, as they explain in the subversion book (&lt;a href="http://svnbook.red-bean.com/en/1.5/svn.advanced.externaldifftools.html"&gt;Using External Differencing and Merge Tools&lt;/a&gt; in Chapter 7).&lt;br /&gt;&lt;br /&gt;Despite the examples provided in the subversion book, I wasn't quite sure how to get this to work. I was even more confused after following some examples I found on the web, not understanding the problems that arose. So that's why I'm writing this blog entry. I hope it helps.&lt;br /&gt;&lt;br /&gt;Hit the jump for the complete solution:&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Subversion gives you two ways to specify an external command to svn merge: via the &lt;b&gt;--diff3-cmd&lt;/b&gt; run-time argument or through the &lt;b&gt;merge-tool-cmd&lt;/b&gt; setting in your custom config file (~/.subversion/config). The former will work for that one call, the latter for all calls to svn merge. Since I prefer to use meld everytime, I use the config file approach. This is also the only method I have tried, so I can't guarantee it works with the command line argument.&lt;br /&gt;&lt;br /&gt;Now, as I noted above, the examples I found on the web (having Googled for varitions of "use meld for svn merge") led me astray. They seemed to rely upon using Meld as the diff3 replacement, which may NOT be what you want. Subversion only calls the merge-tool command when there is a real conflict to resolve. Conversely, the diff3 command always gets called to determine the differences between files and &lt;i&gt;identify&lt;/i&gt; conflicts&lt;br /&gt;&lt;br /&gt;I have found that subversion's default diff3 utility does a good job identifying conflicts and a fine job of resolving &lt;i&gt;trivial &lt;/i&gt;merges (i.e. no conflicting changes). This will save you work! Personally, I only want to call upon meld when I have conflicts to resolve. So, I only use it as my merge-tool-cmd.&lt;br /&gt;&lt;br /&gt;So, let's open up that config file and set to work. First thing you'll notice is that the subversion developers have left plenty of helpful comments. In particular:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;~/.subversion/config&lt;/b&gt;:&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;### Set merge-tool-cmd to the command used to invoke your external&lt;br /&gt;### merging tool of choice. Subversion will pass 4 arguments to&lt;br /&gt;### the specified command: base theirs mine merged&lt;/span&gt;&lt;br /&gt;merge-tool-cmd = merge-tool-cmd = /home/user/scripts/svn-merge-meld&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;So this should be pretty straightforward. When svn merge finds a conflict, it will run the command specified, passing in the 4 arguments listed. Only one hitch: Meld can take at most 3 arguments. This isn't a big deal, though, because as the book recommends, we simply have to write a wrapper script.&lt;br /&gt;&lt;br /&gt;Following the example set in the subversion book, I opted to write my script in python, which I'm loving more the more I use it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;/home/user/svn-diff3-meld&lt;/b&gt;:&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;&lt;span style="color: blue; font-weight: bold;"&gt;#!/usr/bin/env python&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;# svn merge-tool python wrapper for meld&lt;/span&gt;&lt;br /&gt;&lt;span style="color: violet;"&gt;import&lt;/span&gt; os, sys&lt;br /&gt;&lt;span style="color: violet;"&gt;import&lt;/span&gt; subprocess&lt;br /&gt;&lt;span style="color: violet;"&gt;import&lt;/span&gt; shutil&lt;br /&gt;&lt;br /&gt;&lt;span style="color: olive;"&gt;try&lt;/span&gt;:&lt;br /&gt;   &lt;span style="color: blue;"&gt;# path to meld&lt;/span&gt;&lt;br /&gt;   meld = &lt;span style="color: magenta;"&gt;"/usr/bin/meld"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# file paths&lt;/span&gt;&lt;br /&gt;   base   = sys.argv[-&lt;span style="color: magenta;"&gt;4&lt;/span&gt;]&lt;br /&gt;   theirs = sys.argv[-&lt;span style="color: magenta;"&gt;3&lt;/span&gt;]&lt;br /&gt;   mine   = sys.argv[-&lt;span style="color: magenta;"&gt;2&lt;/span&gt;]&lt;br /&gt;   merged = sys.argv[-&lt;span style="color: magenta;"&gt;1&lt;/span&gt;]&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# Replace 'merged' file with a copy of 'mine'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# (because we can't open 4 files)&lt;/span&gt;&lt;br /&gt;   shutil.copy(mine, merged)&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# the call to meld&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# work right-to-left (result is far left file)&lt;/span&gt;&lt;br /&gt;   cmd = [meld, merged, theirs, base]&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# Call meld, making sure it exits correctly&lt;/span&gt;&lt;br /&gt;   subprocess.check_call(cmd)&lt;br /&gt;&lt;span style="color: olive;"&gt;except&lt;/span&gt;:&lt;br /&gt;   &lt;span style="color: olive;"&gt;print&lt;/span&gt; &lt;span style="color: magenta;"&gt;"Oh noes, an error!"&lt;/span&gt;&lt;br /&gt;   sys.exit(-1)&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Note, that we replaced the 'merged' file with a copy of 'mine' (your working copy). I choose to do this for a number of reasons, but primarily because the 'merged' file contains output from subversion's internal diff3 tool, which has bits of the other 3 files in it for conflict resolution. I don't want to deal with that stuff, and it will make Meld's job harder anyway.&lt;br /&gt;&lt;br /&gt;So how do you actually use this? Once you have the script in place (don't forget to make it &lt;b&gt;executable&lt;/b&gt;!), and you've added the entry to your subversion config file, just run a merge.&lt;br /&gt;&lt;br /&gt;When subversion detects a conflict, you'll get prompted to respond to it, as usual:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;Conflict discovered in 'MyClass.cpp'.&lt;br /&gt;Select: (p) postpone, (df) diff-full, (e) edit,&lt;br /&gt;        (h) help for more options:&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Selecting &lt;b&gt;h&lt;/b&gt; will show you:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;(p)  postpone    - mark the conflict to be resolved later&lt;br /&gt;  (df) diff-full   - show all changes made to merged file&lt;br /&gt;  (e)  edit        - change merged file in an editor&lt;br /&gt;  (r)  resolved    - accept merged version of file&lt;br /&gt;  (mf) mine-full   - accept my version of entire file (ignore their changes)&lt;br /&gt;  (tf) theirs-full - accept their version of entire file (lose my changes)&lt;br /&gt;  &lt;b&gt;(l)  launch      - launch external tool to resolve conflict&lt;/b&gt;&lt;br /&gt;  (h)  help        - show this list&lt;br /&gt;&lt;br /&gt;Select: (p) postpone, (df) diff-full, (e) edit,&lt;br /&gt;        (h) help for more options:&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You want option &lt;b&gt;l&lt;/b&gt;, which will launch your script. This ends up opening Meld with 3 files. In order from left to right, they are: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;merged: this starts out as a copy of 'mine' (your working copy), and this is where you want the final results of the merge to end up.&lt;/li&gt;&lt;li&gt;theirs : this is "later" or "right"revision version of the file you're merging with&lt;/li&gt;&lt;li&gt;base : the base or "left" revision version of the file you're merging with&lt;/li&gt;&lt;/ul&gt;Now, I don't usually find the base revision particularly helpful, so I don't bother having meld open it. The modified command looks like:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;# the call to meld&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: blue;"&gt;# work right-to-left (result is far left file)&lt;/span&gt;&lt;br /&gt;   cmd = [meld, merged, theirs]&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;All that's left to do is resolve the conflicts. Keep in mind that the left-hand file is where the final results of the merge are stored, so make the changes you want in that file. When you're done, make sure you save the left-hand file and exit.&lt;br /&gt;&lt;br /&gt;There's no need to save the other file(s), and even though they're temporary files, you may be better off not saving any changes you made to them. If you were to quit meld, and then relaunch it from the command line, what you'll find is that the script copies over the 'merged' file again. This allows you start over on this merge if something got screwed up. However, subversion doesn't replace the temporary files, so if you have saved changes to them, those changes will still persist when you re-open them. You could easily modify the script to prevent this (open copies of the files instead), if you prefer to have the modifications stick around.&lt;br /&gt;&lt;br /&gt;So, when you're finally done, you save your changes and you exit out of meld, subversion will promopt you again:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #ccccbb; border: 1px solid black; padding: 3px;"&gt;&lt;pre&gt;Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,&lt;br /&gt;        (h) help for more options:&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;If you are, indeed, satisfied with how you resolved the merge conflict, just select &lt;b&gt;r&lt;/b&gt;. If you want to start over, just hit &lt;b&gt;l&lt;/b&gt; to launch Meld again.&lt;br /&gt;&lt;br /&gt;And that's it!&lt;br /&gt;&lt;br /&gt;----------------------&lt;br /&gt;&lt;br /&gt;I'll do my best to address any questions, suggestions, or critiques. Just leave a comment! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6027753586757821206-5423902410743116628?l=codingundertheinfluence.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingundertheinfluence.blogspot.com/feeds/5423902410743116628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingundertheinfluence.blogspot.com/2010/01/using-meld-as-your-external-diff3.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6027753586757821206/posts/default/5423902410743116628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6027753586757821206/posts/default/5423902410743116628'/><link rel='alternate' type='text/html' href='http://codingundertheinfluence.blogspot.com/2010/01/using-meld-as-your-external-diff3.html' title='Using meld as your external merge tool for subversion (svn)'/><author><name>John</name><uri>http://www.blogger.com/profile/10842804831103431305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp3.blogger.com/_9IDDAOgGRn8/R68vnf5pG8I/AAAAAAAAAAM/ET-oMXETmVw/S220/n17500088_30938866_8385.jpg'/></author><thr:total>5</thr:total></entry></feed>
