Friday, August 17, 2012

Installing Rust 0.3 in Ubuntu 12.04 (Precise Pangolin)

I installed Rust with only a slight wrinkle; I decided to use GNU Stow so I could easily remove the installed files later. That should make it easier to upgrade to the next version of Rust when it's released.

sudo apt-get install g++ curl stow
cd ~/tmp
tar xzf rust-0.3.tar.gz
cd rust-0.3
./configure --prefix=/usr/local/stow/rust-0.3
make -j2
sudo make install
sudo stow -d /usr/local/stow rust-0.3

Extra info

Wednesday, August 15, 2012

Single-key shortcut for copy and paste in Windows

Too much copying (Control+C) and pasting (Control+V) hurts my fingers. Recently I downloaded a macro program to give me a single-key alternative for each. I used F3 and F4 for my new shortcuts. I made the shortcuts available in all applications except Eclipse. I disabled my shortcuts for Eclipse so that I could use its existing bindings.

  1. Install AutoHotkey.
  2. Create and edit a new script.
  3. Use the following code:
    #IfWinNotActive, ahk_class SWT_Window0
    F3::Send ^c
    F4::Send ^v
  4. Run the script.

Sunday, August 5, 2012

Review Board error with Subversion diff

Review Board 1.6.6 chokes on some diffs generated by Subversion 1.7.4. The error given is:

The file 'https://path-to-file-in-repo' could not be found in the repository

The problem seems to be with files that have been copied from elsewhere in the repository and then modified. Subversion generates a diff to show the changes to the file. Unfortunately Review Board doesn't realise the diff is taken against a file in a different location.

The diff is generated with the svn diff and produces a header like this:

Index: path/to/file
--- path/to/file (working copy)
+++ path/to/file (working copy)

The solution is to tell Subversion to pretend the file is newly added by using the --show-copies-as-adds option. With this option a different header is produced:

Index: path/to/file
--- path/to/file (revision 0)
+++ path/to/file (working copy)

Review Board accepts diffs created with this option without any problems. A downside is that some of the file history is missing for the reviewer.

Note: I didn't try using the post-review tool, which I think is the recommended way to generate diffs for Review Board.