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

Re: Retrieve pristine version of a replaced file via the svn api

From: Branko Čibej <brane_at_apache.org>
Date: Wed, 13 Jun 2012 16:45:34 +0200

On 13.06.2012 16:33, Julian Foad wrote:
> (I'm not cross-posting to users@.)
>
> I think this is a valid enhancement request: to have an API to get the WC base tree (not what the UI calls "base", but the result of the last checkout/update, which is called BASE (usually with capital letters) in libsvn_wc). By "get the tree" I mean an API that covers getting the directory tree structure, text and properties, and also perhaps other relevant metadata such as revision numbers, last-changed info, etc.

You're overreacting to their request, as you note below. There's also
this thing called "svn diff" that already tells you everything you need
to know about the changes in the working copy.

> We could of course just add one function that does the specific thing that you have found to be missing.

I don't believe this project should be in the business of helping people
to avoid using a version control system. However, I shall now
demonstrate that Subversion already provides that functionality:

brane_at_zulu$ svnadmin create r
brane_at_zulu$ svn co file://`pwd`/r w
Checked out revision 0.
brane_at_zulu$ cd w
brane_at_zulu/w$ echo foo > f
brane_at_zulu/w$ svn add f
A f
brane_at_zulu/w$ svn ci -m ''
Adding f
Transmitting file data .
Committed revision 1.
brane_at_zulu/w$ echo bar >> f
brane_at_zulu/w$ svn diff
Index: f
===================================================================
--- f (revision 1)
+++ f (working copy)
@@ -1 +1,2 @@
 foo
+bar
brane_at_zulu/w$ svn cat f > g
brane_at_zulu/w$ diff -u f g
--- f 2012-06-13 16:38:49.000000000 +0200
+++ g 2012-06-13 16:39:01.000000000 +0200
@@ -1,2 +1 @@
 foo
-bar
brane_at_zulu/w$

-- Brane
Received on 2012-06-13 16:45:42 CEST

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.