יום שני, אוקטובר 26, 2009

“please get a newer Subversion client”

An old problem -- a new trick...

This error message is familiar to any Subversion user. The error is the result of trying to access a new working copy (WC) with an old subversion client.

An example scenario:
  • Your Subversion WC is shared between several hosts.
  • You work on the WC from one host (e.g: Centos5).
  • You access the WC by mistake from another (e.g: Fedora11).
  • The next time you try accessing your WC from the old host, you get this error message.
This behavior is pretty dumb:
  • Subversion silently upgrade your WC metadata.
  • It doesn't bother asking your permission to do so.
  • It does it even for supposedly non-modifying actions like 'svn status'.
  • The official FAQ says your only recourse is to upgrade the client...
  • And you may "loose" many uncommitted changes!
Previously, I didn't have any better idea than this:
  • Check out a clean working copy to a temporary directory.
  • Use: diff -ru -x .svn damaged-wc/ fresh-wc/
  • Manually merge files from damaged-wc/ to fresh-wc/
  • Keep working from fresh-wc/
  • Remove damaged-wc/
I just found a very nice workaround that was briefly mentioned:
rsync -r --progress \
--include='*/' --include '.svn/**' --exclude '*' \
fresh-wc/ damaged-wc/


That post only mentioned that emsearcy from OSUOSL is the source of this nice trick -- after googling I found it in an IRC log (big one).

So, this should serve as another documentation for this.

אין תגובות:

הוסף רשומת תגובה