You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Justin Johnson <ju...@gmail.com> on 2007/10/09 11:28:00 UTC

svn diff -r HEAD:HEAD-1 URL

Hello,

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'

The 'svn help diff' output lists some special keywords, but none of
them seem to be what I want since they are dependent on having a
working copy.

  A revision argument can be one of:
     NUMBER       revision number
     '{' DATE '}' revision at start of the date
     'HEAD'       latest in repository
     'BASE'       base rev of item's working copy
     'COMMITTED'  last commit at or before BASE
     'PREV'       revision just before COMMITTED

Is there a way to do this without running multiple commands to extract
the revision number for HEAD and subtract 1 for HEAD-1?

Thanks,
Justin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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

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

Posted by Justin Johnson <ju...@gmail.com>.
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


On 10/9/07, Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> >
>
>
> Linedata Services (UK) Ltd
> Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
> Registered in England and Wales No 3027851     VAT Reg No 778499447
>
> -----Original Message-----
>
>
> > From: Justin Johnson [mailto:justinjohnson@gmail.com]
> > Sent: 09 October 2007 12:28
> > To: users@subversion.tigris.org
> > Subject: svn diff -r HEAD:HEAD-1 URL
> >
> > Hello,
> >
> > 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'
> >
> > The 'svn help diff' output lists some special keywords, but none of
> > them seem to be what I want since they are dependent on having a
> > working copy.
> >
> >   A revision argument can be one of:
> >      NUMBER       revision number
> >      '{' DATE '}' revision at start of the date
> >      'HEAD'       latest in repository
> >      'BASE'       base rev of item's working copy
> >      'COMMITTED'  last commit at or before BASE
> >      'PREV'       revision just before COMMITTED
> >
> > Is there a way to do this without running multiple commands to extract
> > the revision number for HEAD and subtract 1 for HEAD-1?
> >
> > Thanks,
> > Justin
> >
>
> 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.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
> 
 
 
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851     VAT Reg No 778499447
 
-----Original Message-----
 

> From: Justin Johnson [mailto:justinjohnson@gmail.com]
> Sent: 09 October 2007 12:28
> To: users@subversion.tigris.org
> Subject: svn diff -r HEAD:HEAD-1 URL
> 
> Hello,
> 
> 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'
> 
> The 'svn help diff' output lists some special keywords, but none of
> them seem to be what I want since they are dependent on having a
> working copy.
> 
>   A revision argument can be one of:
>      NUMBER       revision number
>      '{' DATE '}' revision at start of the date
>      'HEAD'       latest in repository
>      'BASE'       base rev of item's working copy
>      'COMMITTED'  last commit at or before BASE
>      'PREV'       revision just before COMMITTED
> 
> Is there a way to do this without running multiple commands to extract
> the revision number for HEAD and subtract 1 for HEAD-1?
> 
> Thanks,
> Justin
> 

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org