[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Kludge to make vc-svn.el work with Ediff (compare file with revision)

From: <e.huelsmann_at_gmx.net>
Date: 2003-08-30 23:58:19 CEST

Hi All,

For my current work on the test suite I needed Ediff to be able to compare
between a working copy and a revision of a file. Ediff does that by asking the
vc support to check out a file under a different name. svn does not support
this. Neither does svn support read-only files. Ediff uses both the read-only
flag and the destination file when requesting a file.

So I added support to vc-svn.el for what Ediff wants. Others might be
interested, so I decided to submit. There might be cleaner ways to do this though.
Please comment.

Log:
[[[
Add support to vc-svn.el for Ediff diff of working copy against
revision.

 * contrib/client-side/vc-svn.el
   vc-svn-checkout: added support for operation
      'read-only to different file' as requested by Ediff
]]]

Index: contrib/client-side/vc-svn.el
===================================================================
--- contrib/client-side/vc-svn.el (revision 6924)
+++ contrib/client-side/vc-svn.el (working copy)
@@ -294,15 +294,24 @@
 passing nil.
 If optional arg DESTFILE is given, it is an alternate filename to
 write the contents to; we raise an error."
- (unless editable
+ (when (or (not rev) (equal rev ""))
+ (setq rev "head"))
+ (cond
+ ((and (not editable) destfile)
+ (let ((buffer (create-file-buffer destfile)))
+ (set-buffer buffer)
+ (erase-buffer)
+ (vc-svn-find-version file rev buffer)
+ (write-file destfile nil)
+ (kill-buffer buffer)))
+ (editable
     (error "VC asked Subversion to check out a read-only copy of file"))
- (when destfile
+ (destfile
     (error "VC asked Subversion to check out a file under another name"))
- (when (equal rev "")
- (setq rev nil))
- (apply 'vc-do-command nil 0 vc-svn-program-name file
- "update" (if rev (list "-r" rev) '()))
- (vc-file-setprop file 'vc-workfile-version nil))
+ (t
+ (apply 'vc-do-command nil 0 vc-svn-program-name file
+ "update" (list "-r" rev))
+ (vc-file-setprop file 'vc-workfile-version nil))))
 
 
 (defun vc-svn-revert (file &optional contents-done)

-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Aug 30 23:59:05 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.