Patch question lazarus / 8-Other ---------------------------------------------------------------------- typo · 2015-05-02 15:40 I follow these steps in Tortoise: 1) Update SVN folder. 2) Click on "Diff with previous version" only to open the right window of Tortoise. 3) From there, Open dialog > Their file: SVN folder file, My file: my edited file on Lazarus installation. What is wrong? ---------------------------------------------------------------------- typo · 2015-05-02 15:45 I do this because "Diff with previous version" from SVN folder shows me what attached image reproduces. ---------------------------------------------------------------------- lainz · 2015-05-02 15:51 I think you must use just Diff... and it will Diff with the current official downloaded copy of trunk not another file ir r48*** trunk at left and at right your version. ---------------------------------------------------------------------- typo · 2015-05-02 15:54 From where this menu item (Diff) is available? ---------------------------------------------------------------------- lainz · 2015-05-02 15:57 Quote from: typo on May 02, 2015, 05:54:55 pmFrom where this menu item (Diff) is available? right click the file : tortoisesvn : the first item. just one up to diff with previous version ---------------------------------------------------------------------- typo · 2015-05-02 16:03 Attched is the image of what I have if I right-click on LazUTF8.pas file of my SVN folder. ---------------------------------------------------------------------- lainz · 2015-05-02 16:07 thats because the file is already commited (green icon) is available only when the icon is red. ---------------------------------------------------------------------- typo · 2015-05-02 16:12 Ah, OK. Thanks. ---------------------------------------------------------------------- JuhaManninen · 2015-05-02 16:22 Quote from: 007 on May 02, 2015, 06:07:16 pmthats because the file is already commited (green icon) is available only when the icon is red. Yes and then there is the one menu item that Typo actually needs, namely "Create patch...". ---------------------------------------------------------------------- typo · 2015-05-02 16:29 The patch is already on the BugTracker. ---------------------------------------------------------------------- lainz · 2015-05-02 17:32 Quote from: JuhaManninen on May 02, 2015, 06:22:27 pmQuote from: 007 on May 02, 2015, 06:07:16 pmthats because the file is already commited (green icon) is available only when the icon is red. Yes and then there is the one menu item that Typo actually needs, namely "Create patch...". I think he already know where to find it, in the Window of the Diff is available as in Diff with previous version, is the same window. ---------------------------------------------------------------------- typo · 2015-05-02 17:34 I think he is only joking. ---------------------------------------------------------------------- typo · 2015-05-02 17:41 Juha, you only need to click on Apply now... ---------------------------------------------------------------------- lainz · 2015-05-02 17:47 I clicked on Post, you both make my day haha ---------------------------------------------------------------------- Cyrax · 2015-05-02 20:28 typo = Antônio Galvão, right? I'm sorry, but your patch is still not suitable for Subversion. See this example: Code: [Select]Index: components/aggpas/lazarus/aggpaslcl.lpk =================================================================== --- components/aggpas/lazarus/aggpaslcl.lpk (revision 48839) +++ components/aggpas/lazarus/aggpaslcl.lpk (working copy) @@ -1,23 +1,25 @@ - +   -  +        +    +                -      +              -        -        +        +                                                        +                                              -                            @@ -882,7 +884,6 @@                         -                            @@ -893,7 +894,7 @@                     -      +                          You patch misses Index header and other things, like relative path names. See this wiki article for more info : http://wiki.freepascal.org/Creating_A_Patch You need to create patch from root of your SVN working directory. ---------------------------------------------------------------------- typo · 2015-05-02 21:08 Please see the result: Code: [Select]Index: components/lazutils/lazutf8.pas =================================================================== --- components/lazutils/lazutf8.pas (revision 48916) +++ components/lazutils/lazutf8.pas (working copy) @@ -34,7 +34,7 @@    {$ifdef windows}    Windows,    {$endif} -  Classes, SysUtils; +  Classes, SysUtils;  // AnsiToUTF8 and UTF8ToAnsi need a widestring manager under Linux, BSD, MacOSX  // but normally these OS use UTF-8 as system encoding so the widestringmanager @@ -114,6 +114,9 @@  function UTF8QuotedStr(const S, Quote: string): string;  //Utf8 version of MidStr is just Utf8Copy with same parameters, so it is not implemented here +function UTF8WrapText(S, BreakStr :string; BreakChars :TSysCharSet; MaxCol: integer): string; overload; +function UTF8WrapText(S :string; MaxCol :integer) :string; overload; +  type    TUTF8TrimFlag = (      u8tKeepStart, @@ -2734,6 +2737,71 @@    Result+=copy(S,CopyPos-PChar(S)+1,p-CopyPos)+Quote;  end; +function UTF8WrapText(S, BreakStr :string; BreakChars :TSysCharSet; MaxCol: integer): string; +var +  P :PChar; +  CharLen :integer; +  RightSpace : Integer = 0; +  N :integer = 0; +  i : Integer; +  j : Integer; +  Len :integer = 0; +  ResultLen, RP :Integer; +begin +  Result := ''; +  if (S = '') or (BreakStr = '') or (BreakChars = []) then Exit; +  P := PChar(S); +  while P^ <> #0 do +  begin +    CharLen := UTF8CharacterLength(P); + +    // Result := Result + Copy(P, 1, CharLen); +    i := 1; +    j := 0; +    ResultLen := Length(Result); +    SetLength(Result, ResultLen + CharLen); +    while i <= CharLen do +    begin +      /// Result := Result + (P + j)^; +      Result[ResultLen + i] := (P + J)^; +      /// +      Inc(i); +      Inc(j); +    end; +    // + +    Inc(N); +    if P^ = {#10} BreakStr[Length(BreakStr)] then +      N := 0; +    if N > MaxCol then +    begin +      Len := Length(Result); + +      ///// avoiding RPos +      RP := Len; +      //while Result[RP] <> #32 do +      while not (Result[RP] in BreakChars) do +        Dec(RP); +      ///// + +      RightSpace := Len - RP;  //RPos(' ', Result); +      if RightSpace > 0 then +      begin +        Dec(P, RightSpace); +        SetLength(Result, Len - RightSpace); +      end; +      Result := Result + BreakStr; +      N := 0; +    end; +    Inc(P, CharLen); +  end; +end; + +function UTF8WrapText(S :string; MaxCol: integer): string; +begin +  Result := UTF8WrapText(S, LineEnding, [' ', '-', #9], MaxCol); +end; +  function UTF8Trim(const s: string; Flags: TUTF8TrimFlags): string;  var    p: PChar;