Disable revset and template queries that don't work when database is disabled
authorGregory Szorc <gps@mozilla.com>
Fri, 10 Jan 2014 15:29:44 -0800
changeset 92 45ce73b8f29e
parent 91 3605ab6652f4
child 93 ad8791a58e6e
push id67
push usergszorc@mozilla.com
push dateWed, 22 Jan 2014 23:21:13 +0000
Disable revset and template queries that don't work when database is disabled
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -1225,42 +1225,46 @@ def extsetup(ui):
         pass
 
     extensions.wrapcommand(commands.table, 'pull', pullexpand)
 
     revset.symbols['bug'] = revset_bug
     revset.symbols['dontbuild'] = revset_dontbuild
     revset.symbols['me'] = revset_me
     revset.symbols['nobug'] = revset_nobug
-    revset.symbols['pushhead'] = revset_pushhead
     revset.symbols['reviewer'] = revset_reviewer
     revset.symbols['reviewed'] = revset_reviewed
-    revset.symbols['tree'] = revset_tree
-    revset.symbols['firstpushdate'] = revset_firstpushdate
-    revset.symbols['firstpushtree'] = revset_firstpushtree
-    revset.symbols['pushdate'] = revset_pushdate
+
+    if not ui.configbool('mozext', 'disable_local_database'):
+        revset.symbols['pushhead'] = revset_pushhead
+        revset.symbols['tree'] = revset_tree
+        revset.symbols['firstpushdate'] = revset_firstpushdate
+        revset.symbols['firstpushtree'] = revset_firstpushtree
+        revset.symbols['pushdate'] = revset_pushdate
 
     templatekw.keywords['bug'] = template_bug
     templatekw.keywords['bugs'] = template_bugs
     templatekw.keywords['reviewer'] = template_reviewer
     templatekw.keywords['reviewers'] = template_reviewers
-    templatekw.keywords['firstrelease'] = template_firstrelease
-    templatekw.keywords['firstbeta'] = template_firstbeta
-    templatekw.keywords['firstaurora'] = template_firstaurora
-    templatekw.keywords['firstnightly'] = template_firstnightly
-    templatekw.keywords['auroradate'] = template_auroradate
-    templatekw.keywords['nightlydate'] = template_nightlydate
-    templatekw.keywords['firstpushuser'] = template_firstpushuser
-    templatekw.keywords['firstpushtree'] = template_firstpushtree
-    templatekw.keywords['firstpushtbpl'] = template_firstpushtbpl
-    templatekw.keywords['firstpushdate'] = template_firstpushdate
-    templatekw.keywords['pushdates'] = template_pushdates
-    templatekw.keywords['pushheaddates'] = template_pushheaddates
-    templatekw.keywords['trees'] = template_trees
-    templatekw.keywords['reltrees'] = template_reltrees
+
+    if not ui.configbool('mozext', 'disable_local_database'):
+        templatekw.keywords['firstrelease'] = template_firstrelease
+        templatekw.keywords['firstbeta'] = template_firstbeta
+        templatekw.keywords['firstaurora'] = template_firstaurora
+        templatekw.keywords['firstnightly'] = template_firstnightly
+        templatekw.keywords['auroradate'] = template_auroradate
+        templatekw.keywords['nightlydate'] = template_nightlydate
+        templatekw.keywords['firstpushuser'] = template_firstpushuser
+        templatekw.keywords['firstpushtree'] = template_firstpushtree
+        templatekw.keywords['firstpushtbpl'] = template_firstpushtbpl
+        templatekw.keywords['firstpushdate'] = template_firstpushdate
+        templatekw.keywords['pushdates'] = template_pushdates
+        templatekw.keywords['pushheaddates'] = template_pushheaddates
+        templatekw.keywords['trees'] = template_trees
+        templatekw.keywords['reltrees'] = template_reltrees
 
     templater.funcs['dates'] = template_dates
 
 
 def reposetup(ui, repo):
     """Custom repository implementation.
 
     Our custom repository class tracks remote tree references so users can