Skip to content

Commit

Permalink
Merge pull request #51 from yast/fix_restore_selected
Browse files Browse the repository at this point in the history
Fix restore selected
  • Loading branch information
teclator committed Jul 24, 2018
2 parents 8968a10 + 810b5e4 commit 869760d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -29,3 +29,6 @@ tmp.*
*.log
*.ybc
test-driver

/.yardoc
/doc
25 changes: 12 additions & 13 deletions .travis.yml
@@ -1,15 +1,14 @@
language: cpp
compiler:
- gcc
sudo: required
language: bash
services:
- docker

before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2" -g "yast-rake rspec gettext ruby-dbus"
- docker build -t yast-snapper-image .
# list the installed packages (just for easier debugging)
- docker run --rm -it yast-snapper-image rpm -qa | sort

script:
- rake check:syntax
- rake check:pot
- make -f Makefile.cvs
- make
- rake test:unit
- sudo make install
# the "yast-travis-ruby" script is included in the base yastdevel/ruby image
# see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
- docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-snapper-image yast-travis-ruby
3 changes: 3 additions & 0 deletions Dockerfile
@@ -0,0 +1,3 @@
FROM yastdevel/ruby:sle12-sp2
COPY . /usr/src/app

8 changes: 8 additions & 0 deletions package/yast2-snapper.changes
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jul 24 08:42:11 UTC 2018 - knut.anderssen@suse.com

- Use the correct snapshot number when restoring selected massively
(bsc#956955)
- Use the sle12sp2 Docker for Travis image.
- 3.1.10

-------------------------------------------------------------------
Mon Jun 15 16:18:54 CEST 2015 - aschnell@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-snapper.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-snapper
Version: 3.1.9
Version: 3.1.10
Release: 0
Group: System/YaST

Expand Down
16 changes: 7 additions & 9 deletions src/include/snapper/dialogs.rb
Expand Up @@ -937,7 +937,7 @@ def ShowDialog
HSpacing(0.5)
)
)
show_file_modification.call(current_file, pre_num, snapshot_num)
show_file_modification.call(current_file, from, to)
end
else
UI.ReplaceWidget(Id(:diff_chooser), VBox(VStretch()))
Expand All @@ -955,7 +955,7 @@ def ShowDialog
Right(Label(date))
)
else
tree_label = "%{pre} && %{post}" % { :pre => pre_num, :post => snapshot_num }
tree_label = "%{pre} && %{post}" % { :pre => from, :post => to }
date_widget = VBox(
HBox(
# label, date string will follow at the end of line
Expand Down Expand Up @@ -1092,10 +1092,8 @@ def ShowDialog
elsif ret == :diff_snapshot
if type == :SINGLE
UI.ChangeWidget(Id(:selection_snapshots), :Enabled, false)
show_file_modification.call(current_file, snapshot_num, 0)
else
show_file_modification.call(current_file, pre_num, snapshot_num)
end
show_file_modification.call(current_file, from, to)

elsif ret == :diff_arbitrary || ret == :selection_snapshots
UI.ChangeWidget(Id(:selection_snapshots), :Enabled, true)
Expand Down Expand Up @@ -1166,10 +1164,10 @@ def ShowDialog
"from snapshot '%2' to current system?"
),
Snapper.GetFileFullPath(current_filename),
snapshot_num
from
)
)
Snapper.RestoreFiles(snapshot_num, [current_filename])
Snapper.RestoreFiles(from, [current_filename])
end
next

Expand Down Expand Up @@ -1205,7 +1203,7 @@ def ShowDialog
"<p>Files existing in original snapshot will be copied to current system.</p>\n" +
"<p>Files that did not exist in the snapshot will be deleted.</p>Are you sure?"
),
pre_num,
from,
to_restore.join("<br>")
),
60,
Expand All @@ -1214,7 +1212,7 @@ def ShowDialog
Label.NoButton,
:focus_no
)
Snapper.RestoreFiles(pre_num, filenames)
Snapper.RestoreFiles(from, filenames)
break
end
next
Expand Down

0 comments on commit 869760d

Please sign in to comment.