Anonymous committed 1b00fec

Added a new "wiki upgrade" command to trac-admin. This command
will refresh all "Trac-specific" pages. This closes #179.
The file "UPGRADE" also prepared for the 0.6 release.

Comments (0)

Files changed (3)

 Upgrade Instructions
-Upgrading to 0.5.2 from 0.5 and 0.5.1  
+Upgrading to 0.6 from 0.5.x  
-* There are no changes to the database schema in 0.5.2, so existing Trac
+* There are no changes to the database schema in 0.6, so existing Trac
   databases don't require any extra steps.
   Just install the new version of Trac by running:  ./ install 
        2. Use trac-admin to load the wiki pages. 
-            trac-admin myproject.db wiki load /usr/share/trac/wiki-default/
+            trac-admin myproject.db wiki upgrade
        3. All done. Please note that you have to repeat this step for each
           Trac database you wish to upgrade.


             elif arg[0] == 'load' and len(arg) in [1,2]:
                 dir = (len(arg) == 2 and arg[1]) or ''
+            elif arg[0] == 'upgrade' and len(arg) == 1:
+                self._do_wiki_load(trac.siteconfig.__default_wiki_dir__,
+                                   ignore=['WikiStart'])
                 self.do_help ('wiki')
         except Exception, e:
             print " %s => %s" % (p, dst)
             self._do_wiki_export(p, dst)
-    def _do_wiki_load(self, dir,cursor=None):
+    def _do_wiki_load(self, dir,cursor=None, ignore=[]):
         for page in os.listdir(dir):
+            if page in ignore:
+                continue
             filename = os.path.join(dir, page)
             if os.path.isfile(filename):
                 print " %s => %s" % (filename, page)
       data_files=[(_p('share/trac/templates'), glob('templates/*')),
                   (_p('share/trac/htdocs'), glob(_p('htdocs/*.*')) + [_p('htdocs/README')]),
                   (_p('share/trac/htdocs/css'), glob(_p('htdocs/css/*'))),
-                  (_p('share/trac/wiki-default'), glob(_p('wiki-default/*')))],
+                  (_p('share/trac/wiki-default'), glob(_p('wiki-default/[A-Z]*')))],
       scripts=[_p('scripts/trac-admin'), _p('cgi-bin/trac.cgi')],
       cmdclass = {'install': my_install,
                   'install_scripts': my_install_scripts})