diff rhodecode/controllers/files.py @ 1664:65386911df2a beta

fixes issue with mercurial 2.0 and archival of subrepos. - Disable hooks when doing archive commandsvovercome mercurial problem of hook propagation to subrepos
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 11 Nov 2011 18:16:14 +0200
parents 6a44904838e9
children 61eda8bf70d0
line wrap: on
line diff
--- a/rhodecode/controllers/files.py	Thu Nov 10 21:25:36 2011 +0200
+++ b/rhodecode/controllers/files.py	Fri Nov 11 18:16:14 2011 +0200
@@ -367,6 +367,11 @@
             if dbrepo.enable_downloads is False:
                 return _('downloads disabled')
 
+            # patch and reset hooks section of UI config to not run any 
+            # hooks on fetching archives with subrepos
+            for k, v in c.rhodecode_repo._repo.ui.configitems('hooks'):
+                c.rhodecode_repo._repo.ui.setconfig('hooks', k, None)
+
             cs = c.rhodecode_repo.get_changeset(revision)
             content_type = settings.ARCHIVE_SPECS[fileformat][0]
         except ChangesetDoesNotExistError: