pushlog: use modern mechanism for disabling demand importing; r=glandium
This is safer than the alternative, which may enable if we were
disabled going in.
The new API was added in Mercurial 3.5.
MozReview-Commit-ID: CmL3jO8gy2m
--- a/hgext/pushlog-legacy/pushlog-feed.py
+++ b/hgext/pushlog-legacy/pushlog-feed.py
@@ -12,21 +12,20 @@ from mercurial import demandimport
import sys, os.path, re
from datetime import datetime
import time
from math import ceil
sys.path.append(os.path.dirname(__file__))
-demandimport.disable()
-from parsedatetime import parsedatetime as pdt
+with demandimport.deactivated():
+ from parsedatetime import parsedatetime as pdt
import sqlite3
-demandimport.enable()
testedwith = '3.6 3.7'
cal = pdt.Calendar()
PUSHES_PER_PAGE = 10
def addcommand(f, name):
setattr(hgwebprotocol, name, f)