Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 45235:91aa9bba3dc9
templater: make templatepaths() return a single path, or None
The function returns either a singleton list or an empty list, so it
makes more sense to return a value or None. The plural in the name
also doesn't make sense, but `templatepath()` is already taken, so I
renamed it to `templatedir()` instead.
Differential Revision: https://phab.mercurial-scm.org/D8786
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 21 Jul 2020 13:11:49 -0700 |
parents | 87047efbc6a6 |
children | d5ccc059fbcd |
comparison
equal
deleted
inserted
replaced
45234:e2ec36167151 | 45235:91aa9bba3dc9 |
---|---|
1666 re2 = b'available' | 1666 re2 = b'available' |
1667 fm.plain(_(b'checking "re2" regexp engine (%s)\n') % re2) | 1667 fm.plain(_(b'checking "re2" regexp engine (%s)\n') % re2) |
1668 fm.data(re2=bool(util._re2)) | 1668 fm.data(re2=bool(util._re2)) |
1669 | 1669 |
1670 # templates | 1670 # templates |
1671 p = templater.templatepaths() | 1671 p = templater.templatedir() |
1672 fm.write(b'templatedirs', b'checking templates (%s)...\n', b' '.join(p)) | 1672 fm.write(b'templatedirs', b'checking templates (%s)...\n', p) |
1673 fm.condwrite(not p, b'', _(b" no template directories found\n")) | 1673 fm.condwrite(not p, b'', _(b" no template directories found\n")) |
1674 if p: | 1674 if p: |
1675 m = templater.templatepath(b"map-cmdline.default") | 1675 m = templater.templatepath(b"map-cmdline.default") |
1676 if m: | 1676 if m: |
1677 # template found, check if it is working | 1677 # template found, check if it is working |