Source

trac-hgdirmanager / hgdirmanager / hgdirmanager.py

Diff from to

hgdirmanager/hgdirmanager.py

 from trac.util.translation import _
 from trac.web import IRequestHandler, HTTPNotFound
 from trac.web.chrome import ITemplateProvider, add_warning, add_notice
-from trac.versioncontrol.api import IRepositoryProvider
+from trac.versioncontrol.api import IRepositoryProvider, RepositoryManager
 
 import os, os.path
 from string import ascii_lowercase, digits
                     except Exception, e:
                         add_warning(req, _('Failed to create repository: ') + str(e))
                     else:
+                        RepositoryManager(self.env).reload_repositories()
                         req.redirect(req.href.wiki())
 
         return 'newhgrepo.html', {}, None
             import shutil
             add_notice(req, _('Removed repository: ') + reponame)
             shutil.rmtree(repodir)
+            RepositoryManager(self.env).reload_repositories()
             req.redirect(req.href.wiki())
 
         return 'deletehgrepo.html', {'reponame': reponame, 'nonempty': nonempty}, None