Hello community,
here is the log from the commit of package snapper for openSUSE:Factory
checked in at Fri Aug 12 13:53:38 CEST 2011.
--------
--- snapper/snapper.changes 2011-08-05 14:41:08.000000000 +0200
+++ /mounts/work_src_done/STABLE/snapper/snapper.changes 2011-08-12 10:58:43.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Aug 11 12:09:19 CEST 2011 - aschnell@suse.de
+
+- improvements to command-line interface
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ snapper.spec ++++++
--- /var/tmp/diff_new_pack.PCpT7x/_old 2011-08-12 13:52:18.000000000 +0200
+++ /var/tmp/diff_new_pack.PCpT7x/_new 2011-08-12 13:52:18.000000000 +0200
@@ -20,7 +20,7 @@
Name: snapper
Version: 0.0.7
-Release: 3
+Release: 5
License: GPL
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ snapper-0.0.7.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/LIBVERSION new/snapper-0.0.7/LIBVERSION
--- old/snapper-0.0.7/LIBVERSION 2011-08-03 14:25:59.000000000 +0200
+++ new/snapper-0.0.7/LIBVERSION 2011-08-11 14:53:42.000000000 +0200
@@ -1 +1 @@
-1.2.0
+1.3.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/doc/snapper.8 new/snapper-0.0.7/doc/snapper.8
--- old/snapper-0.0.7/doc/snapper.8 2011-08-05 14:40:21.000000000 +0200
+++ new/snapper-0.0.7/doc/snapper.8 2011-08-12 10:58:05.000000000 +0200
@@ -13,7 +13,7 @@
.SH "DESCRIPTION"
.LP
Snapper is a command\-line program for filesystem snapshot management. It can
-create, delete and compare snapshots and rollback changes between
+create, delete and compare snapshots and undo changes between
snapshots. Supported filesystems are btrfs and ext4.
.SH CONCEPTS
@@ -156,23 +156,26 @@
Unmount a snapshot. Not required for all filesystem types.
.TP
-.B diff [options] <number1> <number2>
-Compare two snapshots. This will show a list of files and directories
-that have been created, modified or deleted in the time between the two
-snapshots have been made.
+.B diff [options] <number1>..<number2>
+Compare the snapshots number1 and number2. This will show a list of files and
+directories that have been created, modified or deleted in the time between
+the two snapshots have been made.
.TP
\fI\-o, \-\-output\fR <file>
Write output to file <file>.
+
.TP
-\fI\-f, \-\-file\fR <file>
-Compare the file <file> between the two snapshots.
+.B contentdiff [options] <number1>..<number2> [files]
+Compare the snapshots number1 and number2. This will show a diff of the
+content of files and directories that have been created, modified or deleted
+in the time between the two snapshots have been made.
.TP
-.B rollback [options] <number1> <number2>
-Rollback changes between the two snapshots.
+.B undochange [options] <number1>..<number2> [files]
+Undo changes done between snapshot number1 and number2.
.TP
-\fI\-f, \-\-file\fR <file>
-Read the files to rollback from the file <file>.
+\fI\-i, \-\-input\fR <file>
+Read files for which to undo changes from file <file>.
.TP
.B cleanup <cleanup-algorithm>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/doc/snapper.8.in new/snapper-0.0.7/doc/snapper.8.in
--- old/snapper-0.0.7/doc/snapper.8.in 2011-08-05 10:26:24.000000000 +0200
+++ new/snapper-0.0.7/doc/snapper.8.in 2011-08-11 14:53:42.000000000 +0200
@@ -13,7 +13,7 @@
.SH "DESCRIPTION"
.LP
Snapper is a command\-line program for filesystem snapshot management. It can
-create, delete and compare snapshots and rollback changes between
+create, delete and compare snapshots and undo changes between
snapshots. Supported filesystems are btrfs and ext4.
.SH CONCEPTS
@@ -156,23 +156,26 @@
Unmount a snapshot. Not required for all filesystem types.
.TP
-.B diff [options] <number1> <number2>
-Compare two snapshots. This will show a list of files and directories
-that have been created, modified or deleted in the time between the two
-snapshots have been made.
+.B diff [options] <number1>..<number2>
+Compare the snapshots number1 and number2. This will show a list of files and
+directories that have been created, modified or deleted in the time between
+the two snapshots have been made.
.TP
\fI\-o, \-\-output\fR <file>
Write output to file <file>.
+
.TP
-\fI\-f, \-\-file\fR <file>
-Compare the file <file> between the two snapshots.
+.B contentdiff [options] <number1>..<number2> [files]
+Compare the snapshots number1 and number2. This will show a diff of the
+content of files and directories that have been created, modified or deleted
+in the time between the two snapshots have been made.
.TP
-.B rollback [options] <number1> <number2>
-Rollback changes between the two snapshots.
+.B undochange [options] <number1>..<number2> [files]
+Undo changes done between snapshot number1 and number2.
.TP
-\fI\-f, \-\-file\fR <file>
-Read the files to rollback from the file <file>.
+\fI\-i, \-\-input\fR <file>
+Read files for which to undo changes from file <file>.
.TP
.B cleanup <cleanup-algorithm>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/AppUtil.cc new/snapper-0.0.7/snapper/AppUtil.cc
--- old/snapper-0.0.7/snapper/AppUtil.cc 2011-08-04 17:59:55.000000000 +0200
+++ new/snapper-0.0.7/snapper/AppUtil.cc 2011-08-08 11:38:25.000000000 +0200
@@ -174,7 +174,7 @@
switch (level)
{
case DEBUG:
- return curLevel >= ::blocxx::E_DEBUG_LEVEL;
+ return false; // curLevel >= ::blocxx::E_DEBUG_LEVEL;
case MILESTONE:
return curLevel >= ::blocxx::E_INFO_LEVEL;
case WARNING:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/Comparison.cc new/snapper-0.0.7/snapper/Comparison.cc
--- old/snapper-0.0.7/snapper/Comparison.cc 2011-04-21 09:00:40.000000000 +0200
+++ new/snapper-0.0.7/snapper/Comparison.cc 2011-08-11 15:50:15.000000000 +0200
@@ -45,17 +45,17 @@
}
- RollbackStatistic
- Comparison::getRollbackStatistic() const
+ UndoStatistic
+ Comparison::getUndoStatistic() const
{
- return files.getRollbackStatistic();
+ return files.getUndoStatistic();
}
bool
- Comparison::doRollback()
+ Comparison::doUndo()
{
- return files.doRollback();
+ return files.doUndo();
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/Comparison.h new/snapper-0.0.7/snapper/Comparison.h
--- old/snapper-0.0.7/snapper/Comparison.h 2011-03-04 12:23:18.000000000 +0100
+++ new/snapper-0.0.7/snapper/Comparison.h 2011-08-11 14:53:42.000000000 +0200
@@ -47,9 +47,9 @@
Files& getFiles() { return files; }
const Files& getFiles() const { return files; }
- RollbackStatistic getRollbackStatistic() const;
+ UndoStatistic getUndoStatistic() const;
- bool doRollback();
+ bool doUndo();
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/File.cc new/snapper-0.0.7/snapper/File.cc
--- old/snapper-0.0.7/snapper/File.cc 2011-08-03 14:55:29.000000000 +0200
+++ new/snapper-0.0.7/snapper/File.cc 2011-08-11 15:50:15.000000000 +0200
@@ -45,7 +45,7 @@
namespace snapper
{
- std::ostream& operator<<(std::ostream& s, const RollbackStatistic& rs)
+ std::ostream& operator<<(std::ostream& s, const UndoStatistic& rs)
{
s << "numCreate:" << rs.numCreate
<< " numModify:" << rs.numModify
@@ -55,14 +55,14 @@
}
- RollbackStatistic::RollbackStatistic()
+ UndoStatistic::UndoStatistic()
: numCreate(0), numModify(0), numDelete(0)
{
}
bool
- RollbackStatistic::empty() const
+ UndoStatistic::empty() const
{
return numCreate == 0 && numModify == 0 && numDelete == 0;
}
@@ -300,7 +300,7 @@
Files::find(const string& name)
{
iterator ret = lower_bound(entries.begin(), entries.end(), name, file_name_less);
- return ret->getName() == name ? ret : end();
+ return (ret != end() && ret->getName() == name) ? ret : end();
}
@@ -308,7 +308,7 @@
Files::find(const string& name) const
{
const_iterator ret = lower_bound(entries.begin(), entries.end(), name, file_name_less);
- return ret->getName() == name ? ret : end();
+ return (ret != end() && ret->getName() == name) ? ret : end();
}
@@ -641,15 +641,18 @@
bool
- File::doRollback()
+ File::doUndo()
{
- if (getSnapper()->getRollbackCallback())
+ if (comparison->getSnapshot1()->isCurrent())
+ throw IllegalSnapshotException();
+
+ if (getSnapper()->getUndoCallback())
{
switch (getAction())
{
- case CREATE: getSnapper()->getRollbackCallback()->createInfo(name); break;
- case MODIFY: getSnapper()->getRollbackCallback()->modifyInfo(name); break;
- case DELETE: getSnapper()->getRollbackCallback()->deleteInfo(name); break;
+ case CREATE: getSnapper()->getUndoCallback()->createInfo(name); break;
+ case MODIFY: getSnapper()->getUndoCallback()->modifyInfo(name); break;
+ case DELETE: getSnapper()->getUndoCallback()->deleteInfo(name); break;
}
}
@@ -673,13 +676,13 @@
error = true;
}
- if (error && getSnapper()->getRollbackCallback())
+ if (error && getSnapper()->getUndoCallback())
{
switch (getAction())
{
- case CREATE: getSnapper()->getRollbackCallback()->createError(name); break;
- case MODIFY: getSnapper()->getRollbackCallback()->modifyError(name); break;
- case DELETE: getSnapper()->getRollbackCallback()->deleteError(name); break;
+ case CREATE: getSnapper()->getUndoCallback()->createError(name); break;
+ case MODIFY: getSnapper()->getUndoCallback()->modifyError(name); break;
+ case DELETE: getSnapper()->getUndoCallback()->deleteError(name); break;
}
}
@@ -698,14 +701,17 @@
}
- RollbackStatistic
- Files::getRollbackStatistic() const
+ UndoStatistic
+ Files::getUndoStatistic() const
{
- RollbackStatistic rs;
+ if (comparison->getSnapshot1()->isCurrent())
+ throw IllegalSnapshotException();
+
+ UndoStatistic rs;
for (vector<File>::const_iterator it = entries.begin(); it != entries.end(); ++it)
{
- if (it->getRollback())
+ if (it->getUndo())
{
switch (it->getAction())
{
@@ -721,39 +727,42 @@
bool
- Files::doRollback()
+ Files::doUndo()
{
- y2mil("begin rollback");
+ if (comparison->getSnapshot1()->isCurrent())
+ throw IllegalSnapshotException();
+
+ y2mil("begin doUndo");
- if (getSnapper()->getRollbackCallback())
- getSnapper()->getRollbackCallback()->start();
+ if (getSnapper()->getUndoCallback())
+ getSnapper()->getUndoCallback()->start();
for (vector<File>::reverse_iterator it = entries.rbegin(); it != entries.rend(); ++it)
{
- if (it->getRollback())
+ if (it->getUndo())
{
if (it->getPreToPostStatus() == CREATED)
{
- it->doRollback();
+ it->doUndo();
}
}
}
for (vector<File>::iterator it = entries.begin(); it != entries.end(); ++it)
{
- if (it->getRollback())
+ if (it->getUndo())
{
if (it->getPreToPostStatus() != CREATED)
{
- it->doRollback();
+ it->doUndo();
}
}
}
- if (getSnapper()->getRollbackCallback())
- getSnapper()->getRollbackCallback()->stop();
+ if (getSnapper()->getUndoCallback())
+ getSnapper()->getUndoCallback()->stop();
- y2mil("end rollback");
+ y2mil("end doUndo");
return true;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/File.h new/snapper-0.0.7/snapper/File.h
--- old/snapper-0.0.7/snapper/File.h 2011-08-03 14:25:59.000000000 +0200
+++ new/snapper-0.0.7/snapper/File.h 2011-08-11 14:53:42.000000000 +0200
@@ -57,9 +57,9 @@
};
- struct RollbackStatistic
+ struct UndoStatistic
{
- RollbackStatistic();
+ UndoStatistic();
bool empty() const;
@@ -67,7 +67,7 @@
unsigned int numModify;
unsigned int numDelete;
- friend std::ostream& operator<<(std::ostream& s, const RollbackStatistic& rs);
+ friend std::ostream& operator<<(std::ostream& s, const UndoStatistic& rs);
};
@@ -78,7 +78,7 @@
File(const Comparison* comparison, const string& name,
unsigned int pre_to_post_status)
: comparison(comparison), name(name), pre_to_post_status(pre_to_post_status),
- pre_to_system_status(-1), post_to_system_status(-1), rollback(false)
+ pre_to_system_status(-1), post_to_system_status(-1), undo(false)
{}
const string& getName() const { return name; }
@@ -93,10 +93,12 @@
vector<string> getDiff(const string& options) const;
- bool getRollback() const { return rollback; }
- void setRollback(bool value) { rollback = value; }
+ bool getUndo() const { return undo; }
+ void setUndo(bool value) { undo = value; }
+ bool doUndo();
- bool doRollback();
+ void setRollback(bool value) __attribute__ ((deprecated)) { setUndo(value); }
+ bool doRollback() __attribute__ ((deprecated)) { return doUndo(); }
enum Action { CREATE, MODIFY, DELETE };
@@ -127,7 +129,7 @@
unsigned int pre_to_system_status; // -1 if invalid
unsigned int post_to_system_status; // -1 if invalid
- bool rollback;
+ bool undo;
};
@@ -175,9 +177,9 @@
bool save();
void filter();
- RollbackStatistic getRollbackStatistic() const;
+ UndoStatistic getUndoStatistic() const;
- bool doRollback();
+ bool doUndo();
const Comparison* comparison;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/Snapper.cc new/snapper-0.0.7/snapper/Snapper.cc
--- old/snapper-0.0.7/snapper/Snapper.cc 2011-08-05 11:21:57.000000000 +0200
+++ new/snapper-0.0.7/snapper/Snapper.cc 2011-08-11 14:53:42.000000000 +0200
@@ -48,7 +48,7 @@
Snapper::Snapper(const string& config_name, bool disable_filters)
: config_name(config_name), config(NULL), subvolume("/"), filesystem(NULL),
- snapshots(this), compare_callback(NULL), rollback_callback(NULL)
+ snapshots(this), compare_callback(NULL), undo_callback(NULL)
{
y2mil("Snapper constructor");
y2mil("libsnapper version " VERSION);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/snapper/Snapper.h new/snapper-0.0.7/snapper/Snapper.h
--- old/snapper-0.0.7/snapper/Snapper.h 2011-08-02 12:19:16.000000000 +0200
+++ new/snapper-0.0.7/snapper/Snapper.h 2011-08-11 14:53:42.000000000 +0200
@@ -48,10 +48,10 @@
};
- struct RollbackCallback
+ struct UndoCallback
{
- RollbackCallback() {}
- virtual ~RollbackCallback() {}
+ UndoCallback() {}
+ virtual ~UndoCallback() {}
virtual void start() = 0;
virtual void stop() = 0;
@@ -133,8 +133,8 @@
void setCompareCallback(CompareCallback* p) { compare_callback = p; }
CompareCallback* getCompareCallback() const { return compare_callback; }
- void setRollbackCallback(RollbackCallback* p) { rollback_callback = p; }
- RollbackCallback* getRollbackCallback() const { return rollback_callback; }
+ void setUndoCallback(UndoCallback* p) { undo_callback = p; }
+ UndoCallback* getUndoCallback() const { return undo_callback; }
const vector<string>& getIgnorePatterns() const { return ignore_patterns; }
@@ -166,7 +166,7 @@
Snapshots snapshots;
CompareCallback* compare_callback;
- RollbackCallback* rollback_callback;
+ UndoCallback* undo_callback;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/common.cc new/snapper-0.0.7/testsuite-real/common.cc
--- old/snapper-0.0.7/testsuite-real/common.cc 2011-07-29 16:34:02.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/common.cc 2011-08-11 14:53:42.000000000 +0200
@@ -40,10 +40,10 @@
CompareCallbackImpl compare_callback_impl;
-struct RollbackCallbackImpl : public RollbackCallback
+struct UndoCallbackImpl : public UndoCallback
{
- void start() { cout << "running rollback..." << endl; }
- void stop() { cout << "rollback done" << endl; }
+ void start() { cout << "undoing..." << endl; }
+ void stop() { cout << "undoing done" << endl; }
void createInfo(const string& name) { cout << "creating " << name << endl; }
void modifyInfo(const string& name) { cout << "modifying " << name << endl; }
@@ -54,7 +54,7 @@
void deleteError(const string& name) { cout << "failed to delete " << name << endl; numDeleteErrors++; }
};
-RollbackCallbackImpl rollback_callback_impl;
+UndoCallbackImpl undo_callback_impl;
void
@@ -68,7 +68,7 @@
sh = createSnapper("testsuite");
sh->setCompareCallback(&compare_callback_impl);
- sh->setRollbackCallback(&rollback_callback_impl);
+ sh->setUndoCallback(&undo_callback_impl);
}
@@ -89,15 +89,15 @@
void
-check_rollback_statistics(unsigned int numCreate, unsigned int numModify, unsigned int numDelete)
+check_undo_statistics(unsigned int numCreate, unsigned int numModify, unsigned int numDelete)
{
Comparison comparison(sh, first, second);
Files& files = comparison.getFiles();
for (Files::iterator it = files.begin(); it != files.end(); ++it)
- it->setRollback(true);
+ it->setUndo(true);
- RollbackStatistic rs = comparison.getRollbackStatistic();
+ UndoStatistic rs = comparison.getUndoStatistic();
check_equal(rs.numCreate, numCreate);
check_equal(rs.numModify, numModify);
@@ -106,7 +106,7 @@
void
-rollback()
+undo()
{
numCreateErrors = numModifyErrors = numDeleteErrors = 0;
@@ -114,14 +114,14 @@
Files& files = comparison.getFiles();
for (Files::iterator it = files.begin(); it != files.end(); ++it)
- it->setRollback(true);
+ it->setUndo(true);
- comparison.doRollback();
+ comparison.doUndo();
}
void
-check_rollback_errors(unsigned int numCreate, unsigned int numModify, unsigned int numDelete)
+check_undo_errors(unsigned int numCreate, unsigned int numModify, unsigned int numDelete)
{
check_equal(numCreateErrors, numCreate);
check_equal(numModifyErrors, numModify);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/common.h new/snapper-0.0.7/testsuite-real/common.h
--- old/snapper-0.0.7/testsuite-real/common.h 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/common.h 2011-08-11 14:53:42.000000000 +0200
@@ -46,11 +46,11 @@
void setup();
void first_snapshot();
void second_snapshot();
-void check_rollback_statistics(unsigned int numCreate, unsigned int numModify,
- unsigned int numDelete);
-void rollback();
-void check_rollback_errors(unsigned int numCreate, unsigned int numModify,
+void check_undo_statistics(unsigned int numCreate, unsigned int numModify,
unsigned int numDelete);
+void undo();
+void check_undo_errors(unsigned int numCreate, unsigned int numModify,
+ unsigned int numDelete);
void check_first();
void run_command(const char* command);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/directory1.cc new/snapper-0.0.7/testsuite-real/directory1.cc
--- old/snapper-0.0.7/testsuite-real/directory1.cc 2011-05-23 10:06:20.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/directory1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -22,11 +22,11 @@
run_command("mkdir already-here");
- check_rollback_statistics(1, 0, 0);
+ check_undo_statistics(1, 0, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/error1.cc new/snapper-0.0.7/testsuite-real/error1.cc
--- old/snapper-0.0.7/testsuite-real/error1.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/error1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -20,11 +20,11 @@
run_command("touch not-empty/bad");
- check_rollback_statistics(0, 0, 1);
+ check_undo_statistics(0, 0, 1);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 1);
+ check_undo_errors(0, 0, 1);
exit(EXIT_SUCCESS);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/error2.cc new/snapper-0.0.7/testsuite-real/error2.cc
--- old/snapper-0.0.7/testsuite-real/error2.cc 2011-05-12 10:42:14.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/error2.cc 2011-08-11 14:53:42.000000000 +0200
@@ -23,11 +23,11 @@
run_command("rm not-here");
- check_rollback_statistics(0, 1, 0);
+ check_undo_statistics(0, 1, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 1, 0);
+ check_undo_errors(0, 1, 0);
exit(EXIT_SUCCESS);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/error4.cc new/snapper-0.0.7/testsuite-real/error4.cc
--- old/snapper-0.0.7/testsuite-real/error4.cc 2011-05-20 12:32:14.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/error4.cc 2011-08-11 14:53:42.000000000 +0200
@@ -24,11 +24,11 @@
run_command("rmdir wrong-type");
run_command("touch wrong-type");
- check_rollback_statistics(1, 0, 0);
+ check_undo_statistics(1, 0, 0);
- rollback();
+ undo();
- check_rollback_errors(1, 0, 0);
+ check_undo_errors(1, 0, 0);
exit(EXIT_SUCCESS);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/missing-directory1.cc new/snapper-0.0.7/testsuite-real/missing-directory1.cc
--- old/snapper-0.0.7/testsuite-real/missing-directory1.cc 2011-05-20 12:32:14.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/missing-directory1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -25,11 +25,11 @@
run_command("rmdir not-here");
- check_rollback_statistics(2, 0, 0);
+ check_undo_statistics(2, 0, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/owner1.cc new/snapper-0.0.7/testsuite-real/owner1.cc
--- old/snapper-0.0.7/testsuite-real/owner1.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/owner1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -29,11 +29,11 @@
second_snapshot();
- check_rollback_statistics(3, 0, 0);
+ check_undo_statistics(3, 0, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/owner2.cc new/snapper-0.0.7/testsuite-real/owner2.cc
--- old/snapper-0.0.7/testsuite-real/owner2.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/owner2.cc 2011-08-11 14:53:42.000000000 +0200
@@ -24,11 +24,11 @@
second_snapshot();
- check_rollback_statistics(0, 3, 0);
+ check_undo_statistics(0, 3, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/owner3.cc new/snapper-0.0.7/testsuite-real/owner3.cc
--- old/snapper-0.0.7/testsuite-real/owner3.cc 2011-05-20 15:20:53.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/owner3.cc 2011-08-11 14:53:42.000000000 +0200
@@ -23,11 +23,11 @@
second_snapshot();
- check_rollback_statistics(0, 1, 0);
+ check_undo_statistics(0, 1, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/permissions1.cc new/snapper-0.0.7/testsuite-real/permissions1.cc
--- old/snapper-0.0.7/testsuite-real/permissions1.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/permissions1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -30,11 +30,11 @@
second_snapshot();
- check_rollback_statistics(4, 0, 0);
+ check_undo_statistics(4, 0, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/permissions2.cc new/snapper-0.0.7/testsuite-real/permissions2.cc
--- old/snapper-0.0.7/testsuite-real/permissions2.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/permissions2.cc 2011-08-11 14:53:42.000000000 +0200
@@ -24,11 +24,11 @@
second_snapshot();
- check_rollback_statistics(0, 2, 0);
+ check_undo_statistics(0, 2, 0);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/testsuite-real/simple1.cc new/snapper-0.0.7/testsuite-real/simple1.cc
--- old/snapper-0.0.7/testsuite-real/simple1.cc 2011-05-03 15:19:07.000000000 +0200
+++ new/snapper-0.0.7/testsuite-real/simple1.cc 2011-08-11 14:53:42.000000000 +0200
@@ -28,11 +28,11 @@
second_snapshot();
- check_rollback_statistics(3, 0, 3);
+ check_undo_statistics(3, 0, 3);
- rollback();
+ undo();
- check_rollback_errors(0, 0, 0);
+ check_undo_errors(0, 0, 0);
check_first();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.0.7/tools/snapper.cc new/snapper-0.0.7/tools/snapper.cc
--- old/snapper-0.0.7/tools/snapper.cc 2011-08-04 21:12:47.000000000 +0200
+++ new/snapper-0.0.7/tools/snapper.cc 2011-08-11 15:50:15.000000000 +0200
@@ -173,9 +173,15 @@
{
Snapshots& snapshots = sh->getSnapshots();
+ istringstream s(str);
unsigned int num = 0;
- if (str != "current")
- str >> num;
+ s >> num;
+
+ if (s.fail() || !s.eof())
+ {
+ cerr << sformat(_("Invalid snapshot '%s'."), str.c_str()) << endl;
+ exit(EXIT_FAILURE);
+ }
Snapshots::iterator snap = snapshots.find(num);
if (snap == snapshots.end())
@@ -188,6 +194,29 @@
}
+pair