[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: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 13 Jun 2012 16:10:17 +0100 (BST)

Branko Čibej wrote:

> On 13.06.2012 16:33, Julian Foad wrote:
>> 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,

Yes, you're right; I should have put my pet project ideas in a new email thread, not here.

But my main point is that *if* there is missing API functionality then it's perfectly reasonably to request for the missing bit to be filled in.  (I haven't checked for myself that it really is missing functionality.)

> 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.

I totally agree, but we should present a complete logical interface to the SCM.

> However, I shall now
> demonstrate that Subversion already provides that functionality:

This demo doesn't seem to include the replacement of a node, which is the case in question.

- Julian

> 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 17:11:18 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.