Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

my svn version is zero?!

(1/2) > >>

cjl3230:
1.update repo by git svn rebase.   (git svn clone svn://svn.code.sf.net/p/codeblocks/code  execut  first)    sorry,my english is very poor;
2.I found a problem at src/build_tools/autorevision/autorevision.cpp
3. this is my patch

--- Code: (php) ---diff --git a/src/build_tools/autorevision/autorevision.cpp b/src/build_tools/autorevision/autorevision.cpp
index 5ca1727..9c74959 100644
--- a/src/build_tools/autorevision/autorevision.cpp
+++ b/src/build_tools/autorevision/autorevision.cpp
@@ -215,6 +215,22 @@ bool QuerySvn(const string& workingDir, string& revision, string &date)
             }
         }
 
+        if (getProcessOutput(output, "git log --grep=\"git-svn-id: svn\" --max-count=1" + workingDir))
+        {
+            string::size_type lineStart = output.find("git-svn-id: svn");
+            if (lineStart != string::npos)
+            {
+                string::size_type revStart = output.find("@", lineStart);
+                if (revStart != string::npos)
+                {
+                    revStart++;
+                    string::size_type revEnd = output.find(" ", revStart);
+                    revision = output.substr(revStart, revEnd - revStart);
+                    hasRev = true;
+                }
+            }
+        }
+
         if (getProcessOutput(output, "git log --date=iso --max-count=1 " + workingDir))
         {
             string::size_type lineStart = output.find("Date:");

--- End code ---

at last, I would like to add it to the repository.
 :) :) :) :) :)

dmoore:
This is probably what is causing problems with my PPA.

MortenMacFly:

--- Quote from: cjl3230 on February 01, 2016, 02:16:59 am ---3. this is my patch

--- End quote ---
Does it work on all platforms, e.g. on Windows, too? I see "grep" there which does hopefully not call a Unix command...

oBFusCATed:

--- Quote from: MortenMacFly on February 01, 2016, 07:47:58 pm ---Does it work on all platforms, e.g. on Windows, too? I see "grep" there which does hopefully not call a Unix command...

--- End quote ---
Yes, it works, this is not grep but "git log --grep", so if you have a working git installation then it should work.
Also this patch just adds another version of this command, that searches for checkouts with the svn protocol.
The original version searches for a https protocol.

@dmoore: I doubt this patch will fix it. I'll investigate, because I'm affected too...

MortenMacFly:

--- Quote from: oBFusCATed on February 01, 2016, 09:20:18 pm ---@dmoore: I doubt this patch will fix it. I'll investigate, because I'm affected too...

--- End quote ---
For me, this is always zero if I don't work in the working copy (which I usually don't). Therefore the pre-build command in the cbp file simply fails silently. To "fix" that I added to complete path to the svn (git) working copy to the command. (see the target named "sdk" in the C::B project file).

Navigation

[0] Message Index

[#] Next page

Go to full version