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

Re: Symbolic Name for Working Copy

From: Martin Scharrer <mailinglists_at_madmarty.de>
Date: 2006-12-22 17:53:32 CET

On Friday 22 December 2006 12:37, Schwarz, Konrad wrote:
> Subversion has symbolic revision labels "HEAD", "BASE", ..., but is
> missing one for the working copy. Although 'svn diff' defaults to the
> working copy when a revision is omitted, I see no way of specifying it
> explicitly.
The working copy has no own revision number and so there is no symbolic name
for that. The state ('revision') of the working copy is used when no rev
number is provided.

> Specifying the working copy revision explicitly is needed for reverse
> diffs.
>
> For example:
>
> svn diff -r WORKING_COPY -r BASE --diff-cmd diff -x -e some_file >
> some_file.ed
>
> should produce an ed(1) script in some_file.ed that contains the changes
> required to convert the working copy to the base revision.
I see your problem here. You can only create a 'forward' patch with the
current options of svn. You are right that you would need a explicit name
for the working copy state.
The '-c' option seems not to work with named rev numbers, otherwise maybe a
'-c -BASE' would create a reverse patch.

> This comes in handy when the working copy is the result of merging and a
> few of the changes need to be backed out; this can be done cleanly by
> editing "some_file.ed" to contain only the changes that need to be
> backed out and applying the result.
You could create a wrapper for diff which exchanges the two versions, so that
a reverse patch would be created.
So 'diff_wrapper file1 file2' would call 'diff file2 file1'.

Anyway, I always use for this (under Linux + KDE):
  $ svn diff [file ... ] | kompare -
and then go through the changes manually. Kompare can also exchange the two
different versions if you like.

best,
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 22 18:00:39 2006

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

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