# bogus config files in the -scripts versions of installs. Maybe
# we should check a hash or something?
raise NotImplementedError
+ def researchFilter(self, filename, added, deleted):
+ """
+ Allows an application to selectively ignore certain diffstat signatures
+ during research; for example, configuration files will have a very
+ specific set of changes, so ignore them; certain installation files
+ may be removed, etc. Return ``True`` if a diffstat signature should be
+ ignored,
+ """
+ return False
+ def researchVerbose(self, filename):
+ """
+ Allows an application to exclude certain dirty files from the output
+ report; usually this will just be parametrized files, since those are
+ guaranteed to have changes. Return ``True`` if a file should only
+ be displayed in verbose mode.
+ """
+ return filename in self.parametrized_files
@staticmethod
def make(name):
"""Makes an application, but uses the correct subtype if available."""
app.restore_database(backup_dir, deployment)
def remove(self, deployment, options):
app.remove_database(deployment)
+ def researchFilter(self, filename, added, deleted):
+ if filename == "LocalSettings.php":
+ return added == deleted == 10 or added == deleted == 9
+ elif filename == "AdminSettings.php":
+ return added == 0 and deleted == 20
+ elif filename == "config/index.php" or filename == "config/index.php5":
+ return added == 0
+ return False
Application.resolutions = {
'LocalSettings.php': [
import itertools
import random
-from wizard import command, deploy, shell, util
+from wizard import app, command, deploy, shell, util
def main(argv, baton):
options, show = parse_args(argv, baton)
+ appname = show[0]
+ application = app.applications()[appname]
sh = shell.Shell()
deploys = deploy.parse_install_lines(show, options.versions_path)
stats = {}
if deleted == '-': continue
added = int(added)
deleted = int(deleted)
- # hook
- if filename == "LocalSettings.php":
- if added == deleted == 10:
- continue
- elif added == deleted == 9:
- continue
- elif filename == "AdminSettings.php":
- if added == 0 and deleted == 20:
- continue
- elif filename == "config/index.php" or filename == "config/index.php5":
- if added == 0:
- continue
- if not added and not deleted:
+ if not added and not deleted or application.researchFilter(filename, added, deleted):
continue
results.append((added,deleted,filename))
if len(results) > options.filter:
for added,deleted,filename in results:
stats.setdefault(filename, 0)
stats[filename] += 1
- # hook
- if filename == "LocalSettings.php" and not options.verbose:
+ if application.researchVerbose(filename) and not options.verbose:
continue
print "%-7d %-7d %s/%s" % (added,deleted,d.location,filename)
except (deploy.NotConfiguredError, deploy.NotMigratedError):