[PATCH] hgk - fix CR issues on windows

Benoit Boissinot bboissin at gmail.com
Sat Dec 16 21:02:18 CST 2006


moving to -devel

Can someone ack this patch ? (I have nearly 0 tk knowledge. It looks
ok but I would prefer a ack)

Thanks,

Benoit

On 12/15/06, Andrei Vermel <avermel at mail.ru> wrote:
> # HG changeset patch
> # User "Andrei Vermel <avermel at mail.ru>"
> # Date 1166167977 -10800
> # Node ID 3f63b6936b7a67147c311bd42a5652998584df9a
> # Parent  070628929e1fce07ee6e242fe4157b12c00a1102
> hgk - fix CR issues on windows
>
> diff -r 070628929e1f -r 3f63b6936b7a contrib/hgk
> --- a/contrib/hgk Fri Dec 15 01:17:04 2006 -0600
> +++ b/contrib/hgk Fri Dec 15 10:32:57 2006 +0300
> @@ -43,7 +43,9 @@ proc getcommits {rargs} {
>      }
>      if [catch {
>   set parse_args [concat --default HEAD $revargs]
> - set parsed_args [split [eval exec hg debug-rev-parse $parse_args] "\n"]
> + set parse_temp [eval exec hg debug-rev-parse $parse_args]
> + regsub -all "\r\n" $parse_temp "\n" parse_temp
> + set parsed_args [split $parse_temp "\n"]
>      } err] {
>   # if git-rev-parse failed for some reason...
>   if {$rargs == {}} {
> @@ -108,6 +110,7 @@ to allow selection of commits to be disp
>       set leftover {}
>   }
>   set start [expr {$i + 1}]
> + regsub -all "\r\n" $cmit "\n" cmit
>   set j [string first "\n" $cmit]
>   set ok 0
>   if {$j >= 0} {
> @@ -209,6 +212,7 @@ proc parsecommit {id contents listed old
>       incr ncleft($p)
>   }
>      }
> +    regsub -all "\r\n" $contents "\n" contents
>      foreach line [split $contents "\n"] {
>   if {$inhdr} {
>       set line [split $line]
> @@ -257,7 +261,8 @@ proc readrefs {} {
>      global tagids idtags headids idheads tagcontents
>
>      set tags [exec hg tags]
> -    set lines [split $tags '\n']
> +    regsub -all "\r\n" $tags "\n" tags
> +    set lines [split $tags "\n"]
>      foreach f $lines {
>   set f [regexp -all -inline {\S+} $f]
>   set direct [lindex $f 0]
> @@ -2856,6 +2861,7 @@ proc getblobdiffline {bdf ids} {
>      if {$ids != $diffids || $bdf != $blobdifffd($ids)} {
>   return
>      }
> +    regsub -all "\r" $line "" line
>      $ctext conf -state normal
>      if {[regexp {^diff --git a/(.*) b/(.*)} $line match fname newname]} {
>   # start of a new file
> @@ -2914,7 +2920,7 @@ proc getblobdiffline {bdf ids} {
>   } elseif {$diffinhdr || $x == "\\"} {
>       # e.g. "\ No newline at end of file"
>       $ctext insert end "$line\n" filesep
> - } else {
> + } elseif  {$line != ""} {
>       # Something else we don't recognize
>       if {$curdifftag != "Comments"} {
>    $ctext insert end "\n"
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
>
>
>


More information about the Mercurial-devel mailing list