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

Re: git patch friendly question

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sun, 19 Aug 2012 20:36:38 +0200

On 18.08.2012 11:26, asmwarrior wrote:

> Hi, Stefan. Thanks.
> Here is a simplified example which can reproduce this issue:
>
> 1, the url of the svn is below:
> http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/tools/ConsoleRunner
> This is a sub folder of the codeblocks' source repo, you can just check
> out to local like:
> F:\test\svntest\ConsoleRunner
>
> 2, I have two patches generated from the codeblocks' git repo, which
> is:git://cb.biplab.in/codeblocks.git
> I just create two simple patches from the TortoiseGit.
> a, changefile.patch: this patch just add two line in the file main.cpp
> b, addnewfile.patch: this patch add a new file "hi.txt" in the ConsoleRunner
> Both of the patches and the local ConsoleRunner files have CRLF EOF.
>
> Test of patch utility:
> 1, I can use the patch utility to apply both patches
> a, patch -p3 < changefile.patch --binary
> b, patch -p3 < addnewfile.patch--binary
> Note, "--binary" is necessary, because it avoid the patch utility to do
> a CRLF to LF conversion.
> Note2, before running the patch utility, I put the two patches under
> "F:\test\svntest"
>
> Test of the TortoiseSVN:
> I just use TortoiseSVN->Context Menu->Apply patch, but failed.
>
> Test of the svn command line:
>
> F:\test\svntest\ConsoleRunner>svn patch ..\changefile.patch --strip 4
> U main.cpp
>
> F:\test\svntest\ConsoleRunner>svn patch ..\addnewfile.patch --strip 4
> Skipped '.'
> svn: E195018: Cannot strip 4 components from '\dev\null'
> It looks like the svn command line does not under stand the "\dev\null"
> in the patch file.
>
> The attachment is two simple patch files.
>
> Thank you very much!

I've committed two changes to the svn library which fixes these issues.
One change was actually a bug that prevented the svn patch function to
recognize the '\dev\null' line.
The other change I committed was to support your patch files that have
an additional context line 'index xxx..xxx xxx' after the file mode
content line. Such patch files were not supported before.

I'll propose these two changes for backporting to the 1.7.x branch - no
guarantee though that it will make it there (needs three votes from
other svn developers to get there).

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2999455
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-08-19 20:36:46 CEST

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

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