moinsetup

Changeset

49:65e9878b1625
2011-09-25 Paul Boddie raw files shortlog changelog graph Added support for preserving the site files when migrating Wiki instances.
moinsetup.py (file)
     1.1 --- a/moinsetup.py	Sun Sep 25 22:01:59 2011 +0200
     1.2 +++ b/moinsetup.py	Sun Sep 25 22:18:26 2011 +0200
     1.3 @@ -1062,12 +1062,18 @@
     1.4          finally:
     1.5              wikiconfig.close()
     1.6  
     1.7 -    def migrate_instance(self, test=0):
     1.8 +    def migrate_instance(self, test=0, change_site=0):
     1.9  
    1.10          """
    1.11          Migrate the Wiki to the currently supported layout. If 'test' is
    1.12 -        specified and set to a true value, only print whether the migration can
    1.13 -        be performed.
    1.14 +        specified and set to a non-empty or true value, only print whether the
    1.15 +        migration can be performed.
    1.16 +
    1.17 +        If 'change_site' is specified and set to a non-empty or true value, the
    1.18 +        site definitions will be updated; this will overwrite any changes made
    1.19 +        to the site definitions after they were last produced by moinsetup, and
    1.20 +        care must be taken to ensure that things like access controls are
    1.21 +        re-added to the definitions after this action is performed.
    1.22          """
    1.23  
    1.24          conf_dir = join(self.common_dir, "conf")
    1.25 @@ -1117,11 +1123,12 @@
    1.26  
    1.27          # Now attempt to reconfigure the Wiki.
    1.28  
    1.29 -        print "Reconfigure the Wiki, the Web script and the site files."
    1.30 +        print "Reconfigure the Wiki, the Web script%s." % (change_site and " and the site files" or "")
    1.31          if not test:
    1.32              self.configure_moin()
    1.33              self.edit_moin_web_script()
    1.34 -            self.make_site_files()
    1.35 +            if change_site:
    1.36 +                self.make_site_files()
    1.37  
    1.38      def install_theme(self, theme_dir, theme_name=None):
    1.39