1276 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"), |
1276 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"), |
1277 policy.policy) |
1277 policy.policy) |
1278 fm.write('hgmodules', _("checking installed modules (%s)...\n"), |
1278 fm.write('hgmodules', _("checking installed modules (%s)...\n"), |
1279 os.path.dirname(pycompat.fsencode(__file__))) |
1279 os.path.dirname(pycompat.fsencode(__file__))) |
1280 |
1280 |
1281 if policy.policy in ('c', 'allow'): |
1281 rustandc = policy.policy in ('rust+c', 'rust+c-allow') |
|
1282 rustext = rustandc # for now, that's the only case |
|
1283 cext = policy.policy in ('c', 'allow') or rustandc |
|
1284 nopure = cext or rustext |
|
1285 if nopure: |
1282 err = None |
1286 err = None |
1283 try: |
1287 try: |
1284 from .cext import ( |
1288 if cext: |
1285 base85, |
1289 from .cext import ( |
1286 bdiff, |
1290 base85, |
1287 mpatch, |
1291 bdiff, |
1288 osutil, |
1292 mpatch, |
1289 ) |
1293 osutil, |
1290 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes |
1294 ) |
|
1295 # quiet pyflakes |
|
1296 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) |
|
1297 if rustext: |
|
1298 from .rustext import ( |
|
1299 ancestor, |
|
1300 dirstate, |
|
1301 ) |
|
1302 dir(ancestor), dir(dirstate) # quiet pyflakes |
1291 except Exception as inst: |
1303 except Exception as inst: |
1292 err = stringutil.forcebytestr(inst) |
1304 err = stringutil.forcebytestr(inst) |
1293 problems += 1 |
1305 problems += 1 |
1294 fm.condwrite(err, 'extensionserror', " %s\n", err) |
1306 fm.condwrite(err, 'extensionserror', " %s\n", err) |
1295 |
1307 |