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

Re: svn diff -r HEAD:HEAD-1 URL

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-10-10 06:44:25 CEST

On Oct 9, 2007, at 06:35, Justin Johnson wrote:

>>> I would like to perform a diff from HEAD to HEAD-1 against a URL
>>> (i.e.
>>> without a working copy), but HEAD-1 is invalid syntax.
>>>
>>> C:\>svn diff -r HEAD:HEAD-1 http://svn.collab.net/repos/svn/
>>> svn: Syntax error in revision argument 'HEAD:HEAD-1'

[snip]

>>> Is there a way to do this without running multiple commands to
>>> extract
>>> the revision number for HEAD and subtract 1 for HEAD-1?
>>
>> Have you tried svn diff -c-HEAD? I know that -cHEAD is the same as
>> -rHEAD-1:HEAD and if you have a negative revision, e.g. -c-150, is
>> the
>> same as -r150:149, but I havne't tried if -c-HEAD actually works.
>
> The -c option expects a numeric argument.
>
> C:\>svn diff -c HEAD http://svn.collab.net/repos/svn/
> svn: Non-numeric change argument given to -c

Cute. Then: no, there is no way to do it in one command. Get the HEAD
revision via e.g. "svn info" and run "svn diff -c-" with that number.
Like this:

$ cat headdiff.sh
#!/bin/bash

REPO=http://svn.collab.net/repos/svn
SVN=svn
SED=sed

HEAD=`$SVN info $REPO | $SED -E -n 's%^Revision: %%p'`

$SVN diff -c-$HEAD $REPO

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 10 06:46:50 2007

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.