Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/namespaces.py @ 35222:c7b45db8f317
log: translate column labels at once (issue5750)
This makes sure that all columns are aligned. getlogcolumns() is hosted by
templatekw so the namespaces module can see it.
i18n/de.po is updated so test-log.t passes with no error. "obsolete:" and
"instability:" are kept untranslated.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 02 Dec 2017 16:29:49 +0900 |
parents | 46fa46608ca5 |
children | b0054f3c055a |
comparison
equal
deleted
inserted
replaced
35221:1df2f0e1dfd2 | 35222:c7b45db8f317 |
---|---|
23 | 23 |
24 _names_version = 0 | 24 _names_version = 0 |
25 | 25 |
26 def __init__(self): | 26 def __init__(self): |
27 self._names = util.sortdict() | 27 self._names = util.sortdict() |
28 columns = templatekw.getlogcolumns() | |
28 | 29 |
29 # we need current mercurial named objects (bookmarks, tags, and | 30 # we need current mercurial named objects (bookmarks, tags, and |
30 # branches) to be initialized somewhere, so that place is here | 31 # branches) to be initialized somewhere, so that place is here |
31 bmknames = lambda repo: repo._bookmarks.keys() | 32 bmknames = lambda repo: repo._bookmarks.keys() |
32 bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name)) | 33 bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name)) |
33 bmknodemap = lambda repo, node: repo.nodebookmarks(node) | 34 bmknodemap = lambda repo, node: repo.nodebookmarks(node) |
34 n = namespace("bookmarks", templatename="bookmark", | 35 n = namespace("bookmarks", templatename="bookmark", |
35 # i18n: column positioning for "hg log" | 36 logfmt=columns['bookmark'], |
36 logfmt=_("bookmark: %s\n"), | |
37 listnames=bmknames, | 37 listnames=bmknames, |
38 namemap=bmknamemap, nodemap=bmknodemap, | 38 namemap=bmknamemap, nodemap=bmknodemap, |
39 builtin=True) | 39 builtin=True) |
40 self.addnamespace(n) | 40 self.addnamespace(n) |
41 | 41 |
42 tagnames = lambda repo: [t for t, n in repo.tagslist()] | 42 tagnames = lambda repo: [t for t, n in repo.tagslist()] |
43 tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name)) | 43 tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name)) |
44 tagnodemap = lambda repo, node: repo.nodetags(node) | 44 tagnodemap = lambda repo, node: repo.nodetags(node) |
45 n = namespace("tags", templatename="tag", | 45 n = namespace("tags", templatename="tag", |
46 # i18n: column positioning for "hg log" | 46 logfmt=columns['tag'], |
47 logfmt=_("tag: %s\n"), | |
48 listnames=tagnames, | 47 listnames=tagnames, |
49 namemap=tagnamemap, nodemap=tagnodemap, | 48 namemap=tagnamemap, nodemap=tagnodemap, |
50 deprecated={'tip'}, | 49 deprecated={'tip'}, |
51 builtin=True) | 50 builtin=True) |
52 self.addnamespace(n) | 51 self.addnamespace(n) |
53 | 52 |
54 bnames = lambda repo: repo.branchmap().keys() | 53 bnames = lambda repo: repo.branchmap().keys() |
55 bnamemap = lambda repo, name: tolist(repo.branchtip(name, True)) | 54 bnamemap = lambda repo, name: tolist(repo.branchtip(name, True)) |
56 bnodemap = lambda repo, node: [repo[node].branch()] | 55 bnodemap = lambda repo, node: [repo[node].branch()] |
57 n = namespace("branches", templatename="branch", | 56 n = namespace("branches", templatename="branch", |
58 # i18n: column positioning for "hg log" | 57 logfmt=columns['branch'], |
59 logfmt=_("branch: %s\n"), | |
60 listnames=bnames, | 58 listnames=bnames, |
61 namemap=bnamemap, nodemap=bnodemap, | 59 namemap=bnamemap, nodemap=bnodemap, |
62 builtin=True) | 60 builtin=True) |
63 self.addnamespace(n) | 61 self.addnamespace(n) |
64 | 62 |