# HG changeset patch # User Andrew Shadura # Date 2012-10-16 20:44:14 # Node ID 3131c9da8bf604539e01a60fe706e3dd6d2880d0 # Parent 962844e8dd8ecc6b1fbdaf73cbfd2963f937d7df hgk: remove regsub, split on \r instead No need to regsub all \r\n's to \n's, we can just split on \r as well; this may produce extra empty elements in the list, but they won't match anyway. diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -472,9 +472,8 @@ proc readrefs {} { exit 2 } } - regsub -all "\r\n" $heads "\n" heads - - set lines [split $heads "\n"] + + set lines [split $heads \r\n] foreach f $lines { set match "" regexp {changeset:\s+(\S+):(\S+)$} $f match id sha