You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Olivier Sannier <ob...@free.fr> on 2006/08/21 17:14:34 UTC

Applying the results of svn diff to a disconnected repository

Hi all,

I can get the difference between two revisions with this command:

svn diff --revision 1234:head http://url/to/repos/trunk/

Using redirection, I get a file containing the differences.
When moving to an offline location, I take this file with me and I'm 
trying to apply those differences to the locally kept files.
But what command should I use?

I tried with the standalone "patch" command, but it seems it does not 
recognize the format.
Any ideas, anyone?

Thanks in advance
Olivier

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Olivier Sannier <ob...@free.fr>.
Mark Brown wrote:
> On 24-Aug-2006, Olivier Sannier <ob...@free.fr> wrote:
>   
>> Olivier Sannier wrote:
>>     
>>> Here is the output I get from "patch -i patchfile.diff":
>>>
>>> can't find file to patch at input line 5
>>> Perhaps you should have used the -p or --strip option?
>>>       
>
> The -p option is probably the one you want (e.g., -p0).
>
> Cheers,
> Mark.
I tried various values and it did not help.

What's weird is that if I give the file to the "Apply patch" command 
from TortoiseSVN, it works. But I'd like to be able to do this in a 
command line script...

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Mark Brown <ma...@csse.unimelb.edu.au>.
On 24-Aug-2006, Olivier Sannier <ob...@free.fr> wrote:
> Olivier Sannier wrote:
> >Here is the output I get from "patch -i patchfile.diff":
> >
> >can't find file to patch at input line 5
> >Perhaps you should have used the -p or --strip option?

The -p option is probably the one you want (e.g., -p0).

Cheers,
Mark.

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Olivier Sannier <ob...@free.fr>.
Gavin Lambert wrote:
> Quoth Olivier Sannier <ma...@free.fr>:
>   
>>> Here is the output I get from "patch -i patchfile.diff":
>>>
>>> can't find file to patch at input line 5
>>> Perhaps you should have used the -p or --strip option?
>>>       
> [...]
>   
>>> This is the patch.exe from the UnxUtils package, under windows. I
>>> also tried with the one from MinGW, same result. I also tried with
>>> the -n option, it complains that there is only garbage in the file.
>>>
>>> Thanks for any pointers
>>>       
>> Anyone ?
>>     
>
> You might be running afoul of line endings -- the Windows svn client
> probably produces output with CRLF line endings, and the patch utils
> might be expecting to see only LF endings (since that's the UNIX
> convention).  Try converting the file beforehand.
Tried that and it did not help.

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

RE: Applying the results of svn diff to a disconnected repository

Posted by Gavin Lambert <ga...@compacsort.com>.
Quoth Olivier Sannier <ma...@free.fr>:
>> Here is the output I get from "patch -i patchfile.diff":
>> 
>> can't find file to patch at input line 5
>> Perhaps you should have used the -p or --strip option?
[...]
>> This is the patch.exe from the UnxUtils package, under windows. I
>> also tried with the one from MinGW, same result. I also tried with
>> the -n option, it complains that there is only garbage in the file.
>> 
>> Thanks for any pointers
> Anyone ?

You might be running afoul of line endings -- the Windows svn client
probably produces output with CRLF line endings, and the patch utils
might be expecting to see only LF endings (since that's the UNIX
convention).  Try converting the file beforehand.

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Olivier Sannier <ob...@free.fr>.
Olivier Sannier wrote:
> Ryan Schmidt wrote:
>>
>> On Aug 21, 2006, at 19:14, Olivier Sannier wrote:
>>
>>> I can get the difference between two revisions with this command:
>>>
>>> svn diff --revision 1234:head http://url/to/repos/trunk/
>>>
>>> Using redirection, I get a file containing the differences.
>>> When moving to an offline location, I take this file with me and I'm 
>>> trying to apply those differences to the locally kept files.
>>> But what command should I use?
>>>
>>> I tried with the standalone "patch" command, but it seems it does 
>>> not recognize the format.
>>> Any ideas, anyone?
>>
>> svn diff should be producing standard diffs, which should be usable 
>> by the standard patch program, AFAIK. What message do you get when 
>> you try this? 
>
> Here is the output I get from "patch -i patchfile.diff":
>
> can't find file to patch at input line 5
> Perhaps you should have used the -p or --strip option?
> The text leading up to this was:
> --------------------------
> |Index: run/JvGrids.pas
> |===================================================================
> |--- run/JvGrids.pas (r├®vision 10887)
> |+++ run/JvGrids.pas (r├®vision 10898)
> --------------------------
> File to patch:
> Skip this patch? [y]
> Skipping patch.
> 1 out of 1 hunk ignored
>
>
> And the "patch --version" call gives this:
>
> patch 2.5
> Copyright 1988 Larry Wall
> Copyright 1997 Free Software Foundation, Inc.
>
> This program comes with NO WARRANTY, to the extent permitted by law.
> You may redistribute copies of this program
> under the terms of the GNU General Public License.
> For more information about these matters, see the file named COPYING.
>
> written by Larry Wall with lots o' patches by Paul Eggert
>
> This is the patch.exe from the UnxUtils package, under windows. I also 
> tried with the one from MinGW, same result. I also tried with the -n 
> option, it complains that there is only garbage in the file.
>
> Thanks for any pointers
Anyone ?

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Olivier Sannier <ob...@free.fr>.
Ryan Schmidt wrote:
>
> On Aug 21, 2006, at 19:14, Olivier Sannier wrote:
>
>> I can get the difference between two revisions with this command:
>>
>> svn diff --revision 1234:head http://url/to/repos/trunk/
>>
>> Using redirection, I get a file containing the differences.
>> When moving to an offline location, I take this file with me and I'm 
>> trying to apply those differences to the locally kept files.
>> But what command should I use?
>>
>> I tried with the standalone "patch" command, but it seems it does not 
>> recognize the format.
>> Any ideas, anyone?
>
> svn diff should be producing standard diffs, which should be usable by 
> the standard patch program, AFAIK. What message do you get when you 
> try this? 

Here is the output I get from "patch -i patchfile.diff":

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: run/JvGrids.pas
|===================================================================
|--- run/JvGrids.pas (r├®vision 10887)
|+++ run/JvGrids.pas (r├®vision 10898)
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored


And the "patch --version" call gives this:

patch 2.5
Copyright 1988 Larry Wall
Copyright 1997 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

written by Larry Wall with lots o' patches by Paul Eggert

This is the patch.exe from the UnxUtils package, under windows. I also 
tried with the one from MinGW, same result. I also tried with the -n 
option, it complains that there is only garbage in the file.

Thanks for any pointers

Olivier

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

Re: Applying the results of svn diff to a disconnected repository

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 21, 2006, at 19:14, Olivier Sannier wrote:

> I can get the difference between two revisions with this command:
>
> svn diff --revision 1234:head http://url/to/repos/trunk/
>
> Using redirection, I get a file containing the differences.
> When moving to an offline location, I take this file with me and  
> I'm trying to apply those differences to the locally kept files.
> But what command should I use?
>
> I tried with the standalone "patch" command, but it seems it does  
> not recognize the format.
> Any ideas, anyone?

svn diff should be producing standard diffs, which should be usable  
by the standard patch program, AFAIK. What message do you get when  
you try this?

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