Author: jsuchome Date: Thu Oct 13 10:41:48 2011 New Revision: 66414 URL: http://svn.opensuse.org/viewcvs/yast?rev=66414&view=rev Log: - colorize the diff output (bnc#723660) - 2.17.9 Modified: branches/SuSE-Code-11-SP2-Branch/snapper/VERSION branches/SuSE-Code-11-SP2-Branch/snapper/package/yast2-snapper.changes branches/SuSE-Code-11-SP2-Branch/snapper/src/dialogs.ycp Modified: branches/SuSE-Code-11-SP2-Branch/snapper/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/snapper/VERSION?rev=66414&r1=66413&r2=66414&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/snapper/VERSION (original) +++ branches/SuSE-Code-11-SP2-Branch/snapper/VERSION Thu Oct 13 10:41:48 2011 @@ -1 +1 @@ -2.17.8 +2.17.9 Modified: branches/SuSE-Code-11-SP2-Branch/snapper/package/yast2-snapper.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/snapper/package/yast2-snapper.changes?rev=66414&r1=66413&r2=66414&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/snapper/package/yast2-snapper.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/snapper/package/yast2-snapper.changes Thu Oct 13 10:41:48 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Oct 13 09:32:17 CEST 2011 - jsuchome@suse.cz + +- colorize the diff output (bnc#723660) +- 2.17.9 + +------------------------------------------------------------------- Wed Oct 12 16:45:12 CEST 2011 - jsuchome@suse.cz - snaper agent: C++ optimalizations Modified: branches/SuSE-Code-11-SP2-Branch/snapper/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/snapper/src/dialogs.ycp?rev=66414&r1=66413&r2=66414&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/snapper/src/dialogs.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/snapper/src/dialogs.ycp Thu Oct 13 10:41:48 2011 @@ -375,9 +375,29 @@ if (haskey (modification, "diff")) { string diff = String::EscapeTags (modification["diff"]:""); - diff = mergestring (splitstring (diff, "\n"), "<br>"); - // show fixed font in diff - diff = "<tt>" + diff + "</tt>"; + list<string> l = splitstring (diff, "\n"); + if (!textmode) + { + // colorize diff output + l = (list<string>) maplist (string line, l, { + string first = substring (line, 0, 1); + if (first == "+") + { + line = sformat ("<font color=blue>%1</font>", line); + } + else if (first == "-") + { + line = sformat ("<font color=red>%1</font>", line); + } + return line; + }); + } + diff = mergestring (l, "<br>"); + if (!textmode) + { + // show fixed font in diff + diff = "<tt>" + diff + "</tt>"; + } content = add (content, `RichText (`id (`diff), diff)); } else -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org