Hello community,

here is the log from the commit of package yast2-snapper for openSUSE:Factory
checked in at Tue Oct 18 14:35:53 CEST 2011.



--------
--- openSUSE:Factory/yast2-snapper/yast2-snapper.changes        2011-10-11 
17:08:37.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-snapper/yast2-snapper.changes    
2011-10-14 10:17:20.000000000 +0200
@@ -1,0 +2,21 @@
+Fri Oct 14 10:15:38 CEST 2011 - [email protected]
+
+- use the <pre> tag for the diff, so spaces are not lost
+  (bnc#723621)
+- 2.21.16
+
+-------------------------------------------------------------------
+Thu Oct 13 10:40:50 CEST 2011 - [email protected]
+
+- colorize the diff output (bnc#723660)
+- 2.21.15 
+
+-------------------------------------------------------------------
+Wed Oct 12 16:40:44 CEST 2011 - [email protected]
+
+- more optimalization in C++ code
+- use fixed font for showing the diff (bnc#723621)
+- escape HTML tags in diff output
+- 2.21.14
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  yast2-snapper-2.21.13.tar.bz2

New:
----
  yast2-snapper-2.21.16.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-snapper.spec ++++++
--- /var/tmp/diff_new_pack.JyYBMf/_old  2011-10-18 14:35:47.000000000 +0200
+++ /var/tmp/diff_new_pack.JyYBMf/_new  2011-10-18 14:35:47.000000000 +0200
@@ -19,16 +19,17 @@
 
 
 Name:           yast2-snapper
-Version:        2.21.13
+Version:        2.21.16
 Release:        0
 Group:          System/YaST
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        yast2-snapper-%{version}.tar.bz2
 
+
 Requires:       yast2 >= 2.21.22
 License:        GPL-2.0+
-BuildRequires:  doxygen gcc-c++ libsnapper-devel perl-XML-Writer 
update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite
+BuildRequires: update-desktop-files yast2 yast2-devtools yast2-testsuite 
libsnapper-devel doxygen yast2-core-devel gcc-c++ perl-XML-Writer
 
 Summary:        YaST - file system snapshots review
 
@@ -60,6 +61,7 @@
     %suse_update_desktop_file -d ycc_${d%.desktop} ${d%.desktop}
 done
 
+
 %clean
 rm -rf "$RPM_BUILD_ROOT"
 
@@ -73,5 +75,3 @@
 /usr/share/YaST2/scrconf/*.scr
 %{_libdir}/YaST2/plugin/libpy2ag_snapper*
 %doc %{_prefix}/share/doc/packages/yast2-snapper
-
-%changelog

++++++ yast2-snapper-2.21.13.tar.bz2 -> yast2-snapper-2.21.16.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-snapper-2.21.13/VERSION 
new/yast2-snapper-2.21.16/VERSION
--- old/yast2-snapper-2.21.13/VERSION   2011-10-10 12:45:23.000000000 +0200
+++ new/yast2-snapper-2.21.16/VERSION   2011-10-14 10:15:55.000000000 +0200
@@ -1 +1 @@
-2.21.13
+2.21.16
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-snapper-2.21.13/agent-snapper/src/SnapperAgent.cc 
new/yast2-snapper-2.21.16/agent-snapper/src/SnapperAgent.cc
--- old/yast2-snapper-2.21.13/agent-snapper/src/SnapperAgent.cc 2011-10-10 
12:43:23.000000000 +0200
+++ new/yast2-snapper-2.21.16/agent-snapper/src/SnapperAgent.cc 2011-10-12 
16:05:09.000000000 +0200
@@ -18,11 +18,11 @@
 /*
  * search the map for value of given key; both key and value have to be strings
  */
-string SnapperAgent::getValue (const YCPMap &map, const string key, const 
string deflt)
+string SnapperAgent::getValue (const YCPMap &map, const YCPString &key, const 
string &deflt)
 {
-    if (!map->value(YCPString(key)).isNull()
-       && map->value(YCPString(key))->isString())
-       return map->value(YCPString(key))->asString()->value();
+    YCPValue val = map->value(key);
+    if (!val.isNull() && val->isString())
+       return val->asString()->value();
     else
        return deflt;
 }
@@ -33,15 +33,15 @@
  * @param key key we are looking for
  * @param deflt the default value to be returned if key is not found
  */
-int SnapperAgent::getIntValue (const YCPMap &map, const string key, const int 
deflt)
+int SnapperAgent::getIntValue (const YCPMap &map, const YCPString &key, const 
int deflt)
 {
-    if (!map->value(YCPString(key)).isNull() && 
map->value(YCPString(key))->isInteger()) {
-       return map->value(YCPString(key))->asInteger()->value(); 
+    YCPValue val = map->value(key);
+
+    if (!val.isNull() && val->isInteger()) {
+       return val->asInteger()->value();
     }
-    else if (!map->value(YCPString(key)).isNull() &&
-            map->value(YCPString(key))->isString()) {
-       YCPInteger i (map->value(YCPString(key))->asString()->value().c_str());
-       return i->value();
+    else if (!val.isNull() && val->isString()) {
+       return YCPInteger (val->asString()->value().c_str())->value ();
     }
     return deflt;
 }
@@ -50,10 +50,11 @@
  * Search the map for value of given key;
  * key is string and value is YCPList
  */
-YCPList SnapperAgent::getListValue (const YCPMap &map, const string key)
+YCPList SnapperAgent::getListValue (const YCPMap &map, const YCPString &key)
 {
-    if (!map->value(YCPString(key)).isNull() && 
map->value(YCPString(key))->isList())
-       return map->value(YCPString(key))->asList();
+    YCPValue val = map->value(key);
+    if (!val.isNull() && val->isList())
+       return val->asList();
     else
        return YCPList();
 }
@@ -155,7 +156,7 @@
         * Read (.snapper.path, $[ "num" : num]) -> returns the path to 
directory with given snapshot
         */
        if (PC(0) == "path") {
-           unsigned int num    = getIntValue (argmap, "num", 0);
+           unsigned int num    = getIntValue (argmap, YCPString ("num"), 0);
            const Snapshots& snapshots = sh->getSnapshots();
            Snapshots::const_iterator snap = snapshots.find(num);
            if (snap == snapshots.end())
@@ -203,8 +204,8 @@
            return retlist;
        }
 
-       unsigned int num1       = getIntValue (argmap, "from", 0);
-       unsigned int num2       = getIntValue (argmap, "to", 0);
+       unsigned int num1       = getIntValue (argmap, YCPString ("from"), 0);
+       unsigned int num2       = getIntValue (argmap, YCPString ("to"), 0);
 
        /**
         * Read(.snapper.diff_list) -> show difference between snapnots num1 
and num2 as list.
@@ -323,8 +324,7 @@
            y2milestone ("deleting existing snapper object");
            deleteSnapper(sh);
        }
-
-       string config_name = getValue (argmap, "config", "root");
+       string config_name = getValue (argmap, YCPString ("config"), "root");
        try {
            sh = createSnapper (config_name);
        }
@@ -359,13 +359,13 @@
         */
        if (PC(0) == "rollback") {
 
-           unsigned int num1   = getIntValue (argmap, "from", 0);
-           unsigned int num2   = getIntValue (argmap, "to", 0);
+           unsigned int num1   = getIntValue (argmap, YCPString ("from"), 0);
+           unsigned int num2   = getIntValue (argmap, YCPString ("to"), 0);
            const Snapshots& snapshots = sh->getSnapshots();
            Comparison comparison(sh, snapshots.find(num1), 
snapshots.find(num2));
            Files& files = comparison.getFiles();
 
-           YCPList selected = getListValue (argmap, "files");
+           YCPList selected = getListValue (argmap, YCPString ("files"));
            for (int i=0; i < selected->size(); i++) {
                if (selected.value(i)->isString())
                {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-snapper-2.21.13/agent-snapper/src/SnapperAgent.h 
new/yast2-snapper-2.21.16/agent-snapper/src/SnapperAgent.h
--- old/yast2-snapper-2.21.13/agent-snapper/src/SnapperAgent.h  2011-10-10 
12:43:00.000000000 +0200
+++ new/yast2-snapper-2.21.16/agent-snapper/src/SnapperAgent.h  2011-10-12 
16:05:12.000000000 +0200
@@ -37,7 +37,7 @@
      * search the map for value of given key; both key and value have to be 
strings
      * when key is not present, default value is returned
      */
-    string getValue (const YCPMap &map, const string key, const string deflt);
+    string getValue (const YCPMap &map, const YCPString &key, const string 
&deflt);
 
     /**
      * Search the map for value of given key
@@ -45,13 +45,13 @@
      * @param key key we are looking for
      * @param deflt the default value to be returned if key is not found
      */
-    int getIntValue ( const YCPMap &map, const string key, const int deflt);
+    int getIntValue ( const YCPMap &map, const YCPString &key, const int 
deflt);
 
     /**
      * Search the map for value of given key;
      * key is string and value is YCPList
      */
-    YCPList getListValue (const YCPMap &map, const string key);
+    YCPList getListValue (const YCPMap &map, const YCPString &key);
 
 public:
     /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-snapper-2.21.13/src/dialogs.ycp 
new/yast2-snapper-2.21.16/src/dialogs.ycp
--- old/yast2-snapper-2.21.13/src/dialogs.ycp   2011-10-10 12:54:08.000000000 
+0200
+++ new/yast2-snapper-2.21.16/src/dialogs.ycp   2011-10-14 10:16:11.000000000 
+0200
@@ -24,7 +24,7 @@
  * Summary:    Dialogs definitions
  * Authors:    Jiri Suchomel <[email protected]>
  *
- * $Id: dialogs.ycp 66356 2011-10-10 10:54:07Z jsuchome $
+ * $Id: dialogs.ycp 66438 2011-10-14 08:16:10Z jsuchome $
  */
 
 {
@@ -374,8 +374,30 @@
 
        if (haskey (modification, "diff"))
        {
-           string diff = modification["diff"]:"";
-           diff        = mergestring (splitstring (diff, "\n"), "<br>");
+           string diff = String::EscapeTags (modification["diff"]:"");
+           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    = "<pre>" + diff + "</pre>";
+           }
            content     = add (content, `RichText (`id (`diff), diff));
        }
        else
@@ -637,7 +659,7 @@
            files = filter (string file, files, {
                if (haskey (files_index, file))
                {
-                   to_restore  = add (to_restore, String::Quote 
(Snapper::GetFileFullPath (file)));
+                   to_restore  = add (to_restore, String::EscapeTags 
(Snapper::GetFileFullPath (file)));
                    return true;
                }
                else

continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to