Mercurial > hg
annotate tests/revnamesext.py @ 42307:264a2cbb25d0
graphmod: remove support for graph lines mixing parent/grandparent styles (BC)
Currently, if the configuration for a graph edge draw style has multiple bytes
(at least on python2), it is interpreted as "this is a request to draw the line
partially in the style of the parent, partially in the style of the
grandparent". This precludes the configuration handling unicode characters
(which trigger the `len > 1` check, at least on python2), and I believe was part
of the reason that beautifygraph was written the way it was.
Talking with the person who implemented this, it appears to have been to achieve
feature parity with the rendering of the smartlog extension. I suspect that this
isn't actually used outside of that situation, so I think that we can remove it
without much issue.
This will make it so that multi-character edges are possible, and render any
existing configuration that uses this feature with these multiple characters.
This is *not* going to adjust the width of everything to make it line up
correctly, please see the test that's being modified in this changeset for an
example of how the previous configuration now renders.
Note also that the previous configuration seems to have been broken, or at least
it was behaving in a really non-obvious way - it was avoiding the grandparent
character(s) when it should have been displaying them! This is why so many "!"
characters changed to "3."; I don't know if this was intentional.
Differential Revision: https://phab.mercurial-scm.org/D5112
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Tue, 16 Oct 2018 04:59:36 -0700 |
parents | 086fc71fbb09 |
children | 2372284d9457 |
rev | line source |
---|---|
33048
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 # Dummy extension to define a namespace containing revision names |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 from __future__ import absolute_import |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 from mercurial import ( |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 namespaces, |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 ) |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 def reposetup(ui, repo): |
36548
086fc71fbb09
py3: mark all string literals in test-command-template.t as bytes
Yuya Nishihara <yuya@tcha.org>
parents:
33048
diff
changeset
|
10 names = {b'r%d' % rev: repo[rev].node() for rev in repo} |
33048
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 namemap = lambda r, name: names.get(name) |
36548
086fc71fbb09
py3: mark all string literals in test-command-template.t as bytes
Yuya Nishihara <yuya@tcha.org>
parents:
33048
diff
changeset
|
12 nodemap = lambda r, node: [b'r%d' % repo[node].rev()] |
33048
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 |
36548
086fc71fbb09
py3: mark all string literals in test-command-template.t as bytes
Yuya Nishihara <yuya@tcha.org>
parents:
33048
diff
changeset
|
14 ns = namespaces.namespace(b'revnames', templatename=b'revname', |
086fc71fbb09
py3: mark all string literals in test-command-template.t as bytes
Yuya Nishihara <yuya@tcha.org>
parents:
33048
diff
changeset
|
15 logname=b'revname', |
33048
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 listnames=lambda r: names.keys(), |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 namemap=namemap, nodemap=nodemap) |
46fa46608ca5
namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 repo.names.addnamespace(ns) |