Kaydet (Commit) 4158e197 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

History reset added.

üst a8c6862b
......@@ -138,5 +138,12 @@ Lists previous operations.""")
if opno != -1:
self.takeback(opno)
return
elif ctx.get_option('reset'):
util.clean_dir(ctx.config.history_dir())
util.makedirs(ctx.config.history_dir())
import inary.data.history as History
history = History.History()
history.add("reset")
return
self.redirect_output(self.print_history())
......@@ -122,7 +122,7 @@ class History(xmlfile.XmlFile, metaclass=autoxml.autoxml):
# @param otype is currently only used to hold if an upgrade is from "delta"
def add(self, pkgBefore=None, pkgAfter=None, operation=None, otype=None):
if operation not in ["upgrade", "remove", "install", "reinstall", "downgrade", "snapshot"]:
if operation not in ["upgrade", "remove", "install", "reinstall", "downgrade", "snapshot", "reset"]:
raise Exception(_("Unknown package operation"))
package = Package()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment