Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Patch utitilities and applying patches
ollydbg:
Hi, Alpha, it looks like the svn command line can accept the pure patch file generated from tortoiseGit.
I just create a dummy patch file from tortoisegit (I create from the c::b git clone), see below:
--- Code: --- src/sdk/annoyingdialog.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/sdk/annoyingdialog.cpp b/src/sdk/annoyingdialog.cpp
index c6a5a29..b206647 100644
--- a/src/sdk/annoyingdialog.cpp
+++ b/src/sdk/annoyingdialog.cpp
@@ -62,6 +62,8 @@ AnnoyingDialog::AnnoyingDialog(const wxString& caption, const wxString& message,
wxString bTxt1;
wxString bTxt2;
wxString bTxt3;
+
+ adding many comments here to test the patch utility;
if(style == OK || style == ONE_BUTTON)
{
@@ -91,6 +93,8 @@ AnnoyingDialog::AnnoyingDialog(const wxString& caption, const wxString& message,
cbThrow(wxString(_T("Fatal error:\nUndefined style in dialog ")) << caption);
wxSizer* buttonSizer = 0;
+
+ say hello;
if (style < ONE_BUTTON) // standard buttons? use wxStdDialogButtonSizer
{
wxStdDialogButtonSizer *buttonArea = new wxStdDialogButtonSizer();
--- End code ---
Then, I can use the command line:
--- Code: ---E:\code\cb\cleantrunk>svn patch test.patch --strip 1
U src\sdk\annoyingdialog.cpp
--- End code ---
Look, everything works fine.
BTW:
I test several cases: the file "test.patch" can have either CRLF or LF format, when applied, the result file is CRLF, this is because my local c::b svn repo is all CRLF.
BTW2:
I'm using the svn command tool, which is:
--- Quote ---E:\code\cb\cleantrunk>svn --version
svn, version 1.7.1-SlikSvn-1.7.1-WIN32 (SlikSvn/1.7.1) WIN32
compiled Oct 26 2011, 13:38:01
Copyright (C) 2011 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- handles 'http' scheme
- handles 'https' scheme
--- End quote ---
BTW3:
I tried the TortoiseSVN to apply the patch file, then it will shown a failure dialog "rejected patch hunks for XXXXX". :(.
As a conclusion: svn command line is better than the patch utility. :), the patch utility is better than tortoisesvn.
EDIT:
If you use tortoiseSVN to apply the patch, after its failure, You will have some dummy folder named "b", "b/src", "b/src/sdk" created. :(
ollydbg:
I did further test, it looks like the patch utility is much robust, if I have such patch file generated from git:
--- Code: --- src/sdk/hi.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/sdk/hi.txt b/src/sdk/hi.txt
new file mode 100644
index 0000000..3b9f311
--- /dev/null
+++ b/src/sdk/hi.txt
@@ -0,0 +1 @@
+hihihi
\ No newline at end of file
--- End code ---
Only the patch utility works, and both TortoiseSVN and the SVN command line fail.
ollydbg:
FYI:
I report this issue to TortoiseSVN maillist, and now, they have fixed in the subversion library, see the change:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?view=log
Not sure how long this will come into TortoiseSVN, as TortoiseSVN internally use subversion library.
Navigation
[0] Message Index
[*] Previous page
Go to full version