Mercurial > hg
comparison tests/test-glog.t @ 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 | 5abc47d4ca6b |
children | 99ebde4fec99 |
comparison
equal
deleted
inserted
replaced
42306:181583d30539 | 42307:264a2cbb25d0 |
---|---|
3026 ~ ~ parent: 3:27eef8ed80b4 | 3026 ~ ~ parent: 3:27eef8ed80b4 |
3027 user: test | 3027 user: test |
3028 date: Thu Jan 01 00:00:04 1970 +0000 | 3028 date: Thu Jan 01 00:00:04 1970 +0000 |
3029 summary: (4) merge two known; one immediate left, one immediate right | 3029 summary: (4) merge two known; one immediate left, one immediate right |
3030 | 3030 |
3031 Draw only part of a grandparent line differently with "<N><char>"; only the | 3031 Previously, one could specify graphstyle.grandparent = <N><char> to draw <char> |
3032 last N lines (for positive N) or everything but the first N lines (for | 3032 on only the last N lines (for positive N) or everything but the first N lines |
3033 negative N) along the current node use the style, the rest of the edge uses | 3033 (for negative N), with the rest of the edge using the parent edge styling. |
3034 the parent edge styling. | 3034 |
3035 | 3035 This was removed, and this test now shows that muliple characters being |
3036 Last 3 lines: | 3036 specified in graphstyle.grandparent aren't treated specially (including in width |
3037 calculations; there's no specific reason to *avoid* handling the width | |
3038 calculations, but it's difficult to do correctly and efficiently). | |
3037 | 3039 |
3038 $ cat << EOF >> $HGRCPATH | 3040 $ cat << EOF >> $HGRCPATH |
3039 > [experimental] | 3041 > [experimental] |
3040 > graphstyle.parent = ! | 3042 > graphstyle.parent = ! |
3041 > graphstyle.grandparent = 3. | 3043 > graphstyle.grandparent = 3. |
3042 > graphstyle.missing = | 3044 > graphstyle.missing = |
3043 > EOF | 3045 > EOF |
3044 $ hg log -G -r '36:18 & file("a")' -m | 3046 $ hg log -G -r '36:18 & file("a")' -m |
3045 @ changeset: 36:08a19a744424 | 3047 @ changeset: 36:08a19a744424 |
3046 ! branch: branch | 3048 3. branch: branch |
3047 ! tag: tip | 3049 3. tag: tip |
3048 ! parent: 35:9159c3644c5e | 3050 3. parent: 35:9159c3644c5e |
3049 ! parent: 35:9159c3644c5e | 3051 3. parent: 35:9159c3644c5e |
3050 ! user: test | 3052 3. user: test |
3051 . date: Thu Jan 01 00:00:36 1970 +0000 | 3053 3. date: Thu Jan 01 00:00:36 1970 +0000 |
3052 . summary: (36) buggy merge: identical parents | 3054 3. summary: (36) buggy merge: identical parents |
3053 . | 3055 3. |
3054 o changeset: 32:d06dffa21a31 | 3056 o changeset: 32:d06dffa21a31 |
3055 !\ parent: 27:886ed638191b | 3057 !\ parent: 27:886ed638191b |
3056 ! ! parent: 31:621d83e11f67 | 3058 ! 3. parent: 31:621d83e11f67 |
3057 ! ! user: test | 3059 ! 3. user: test |
3058 ! . date: Thu Jan 01 00:00:32 1970 +0000 | 3060 ! 3. date: Thu Jan 01 00:00:32 1970 +0000 |
3059 ! . summary: (32) expand | 3061 ! 3. summary: (32) expand |
3060 ! . | 3062 ! 3. |
3061 o ! changeset: 31:621d83e11f67 | 3063 o 3. changeset: 31:621d83e11f67 |
3062 !\! parent: 21:d42a756af44d | 3064 !\3. parent: 21:d42a756af44d |
3063 ! ! parent: 30:6e11cd4b648f | 3065 ! 3. parent: 30:6e11cd4b648f |
3064 ! ! user: test | 3066 ! 3. user: test |
3065 ! ! date: Thu Jan 01 00:00:31 1970 +0000 | 3067 ! 3. date: Thu Jan 01 00:00:31 1970 +0000 |
3066 ! ! summary: (31) expand | 3068 ! 3. summary: (31) expand |
3067 ! ! | 3069 ! 3. |
3068 o ! changeset: 30:6e11cd4b648f | 3070 o 3. changeset: 30:6e11cd4b648f |
3069 !\ \ parent: 28:44ecd0b9ae99 | 3071 !\ \ parent: 28:44ecd0b9ae99 |
3070 ! ~ ! parent: 29:cd9bb2be7593 | 3072 ! ~ 3. parent: 29:cd9bb2be7593 |
3071 ! ! user: test | 3073 ! 3. user: test |
3072 ! ! date: Thu Jan 01 00:00:30 1970 +0000 | 3074 ! 3. date: Thu Jan 01 00:00:30 1970 +0000 |
3073 ! ! summary: (30) expand | 3075 ! 3. summary: (30) expand |
3074 ! / | 3076 ! / |
3075 o ! changeset: 28:44ecd0b9ae99 | 3077 o 3. changeset: 28:44ecd0b9ae99 |
3076 !\ \ parent: 1:6db2ef61d156 | 3078 !\ \ parent: 1:6db2ef61d156 |
3077 ! ~ ! parent: 26:7f25b6c2f0b9 | 3079 ! ~ 3. parent: 26:7f25b6c2f0b9 |
3078 ! ! user: test | 3080 ! 3. user: test |
3079 ! ! date: Thu Jan 01 00:00:28 1970 +0000 | 3081 ! 3. date: Thu Jan 01 00:00:28 1970 +0000 |
3080 ! ! summary: (28) merge zero known | 3082 ! 3. summary: (28) merge zero known |
3081 ! / | 3083 ! / |
3082 o ! changeset: 26:7f25b6c2f0b9 | 3084 o 3. changeset: 26:7f25b6c2f0b9 |
3083 !\ \ parent: 18:1aa84d96232a | 3085 !\ \ parent: 18:1aa84d96232a |
3084 ! ! ! parent: 25:91da8ed57247 | 3086 ! ! 3. parent: 25:91da8ed57247 |
3085 ! ! ! user: test | 3087 ! ! 3. user: test |
3086 ! ! ! date: Thu Jan 01 00:00:26 1970 +0000 | 3088 ! ! 3. date: Thu Jan 01 00:00:26 1970 +0000 |
3087 ! ! ! summary: (26) merge one known; far right | 3089 ! ! 3. summary: (26) merge one known; far right |
3088 ! ! ! | 3090 ! ! 3. |
3089 ! o ! changeset: 25:91da8ed57247 | 3091 ! o 3. changeset: 25:91da8ed57247 |
3090 ! !\! parent: 21:d42a756af44d | 3092 ! !\3. parent: 21:d42a756af44d |
3091 ! ! ! parent: 24:a9c19a3d96b7 | 3093 ! ! 3. parent: 24:a9c19a3d96b7 |
3092 ! ! ! user: test | 3094 ! ! 3. user: test |
3093 ! ! ! date: Thu Jan 01 00:00:25 1970 +0000 | 3095 ! ! 3. date: Thu Jan 01 00:00:25 1970 +0000 |
3094 ! ! ! summary: (25) merge one known; far left | 3096 ! ! 3. summary: (25) merge one known; far left |
3095 ! ! ! | 3097 ! ! 3. |
3096 ! o ! changeset: 24:a9c19a3d96b7 | 3098 ! o 3. changeset: 24:a9c19a3d96b7 |
3097 ! !\ \ parent: 0:e6eb3150255d | 3099 ! !\ \ parent: 0:e6eb3150255d |
3098 ! ! ~ ! parent: 23:a01cddf0766d | 3100 ! ! ~ 3. parent: 23:a01cddf0766d |
3099 ! ! ! user: test | 3101 ! ! 3. user: test |
3100 ! ! ! date: Thu Jan 01 00:00:24 1970 +0000 | 3102 ! ! 3. date: Thu Jan 01 00:00:24 1970 +0000 |
3101 ! ! ! summary: (24) merge one known; immediate right | 3103 ! ! 3. summary: (24) merge one known; immediate right |
3102 ! ! / | 3104 ! ! / |
3103 ! o ! changeset: 23:a01cddf0766d | 3105 ! o 3. changeset: 23:a01cddf0766d |
3104 ! !\ \ parent: 1:6db2ef61d156 | 3106 ! !\ \ parent: 1:6db2ef61d156 |
3105 ! ! ~ ! parent: 22:e0d9cccacb5d | 3107 ! ! ~ 3. parent: 22:e0d9cccacb5d |
3106 ! ! ! user: test | 3108 ! ! 3. user: test |
3107 ! ! ! date: Thu Jan 01 00:00:23 1970 +0000 | 3109 ! ! 3. date: Thu Jan 01 00:00:23 1970 +0000 |
3108 ! ! ! summary: (23) merge one known; immediate left | 3110 ! ! 3. summary: (23) merge one known; immediate left |
3109 ! ! / | 3111 ! ! / |
3110 ! o ! changeset: 22:e0d9cccacb5d | 3112 ! o 3. changeset: 22:e0d9cccacb5d |
3111 !/!/ parent: 18:1aa84d96232a | 3113 !/3./ parent: 18:1aa84d96232a |
3112 ! ! parent: 21:d42a756af44d | 3114 ! 3. parent: 21:d42a756af44d |
3113 ! ! user: test | 3115 ! 3. user: test |
3114 ! ! date: Thu Jan 01 00:00:22 1970 +0000 | 3116 ! 3. date: Thu Jan 01 00:00:22 1970 +0000 |
3115 ! ! summary: (22) merge two known; one far left, one far right | 3117 ! 3. summary: (22) merge two known; one far left, one far right |
3116 ! ! | 3118 ! 3. |
3117 ! o changeset: 21:d42a756af44d | 3119 ! o changeset: 21:d42a756af44d |
3118 ! !\ parent: 19:31ddc2c1573b | 3120 ! !\ parent: 19:31ddc2c1573b |
3119 ! ! ! parent: 20:d30ed6450e32 | 3121 ! ! ! parent: 20:d30ed6450e32 |
3120 ! ! ! user: test | 3122 ! ! ! user: test |
3121 ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 | 3123 ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 |
3140 ~ ~ parent: 15:1dda3f72782d | 3142 ~ ~ parent: 15:1dda3f72782d |
3141 user: test | 3143 user: test |
3142 date: Thu Jan 01 00:00:18 1970 +0000 | 3144 date: Thu Jan 01 00:00:18 1970 +0000 |
3143 summary: (18) merge two known; two far left | 3145 summary: (18) merge two known; two far left |
3144 | 3146 |
3145 All but the first 3 lines: | 3147 (This formerly tested "All but the first 3 lines", but is now showing that it's |
3148 still not treated any differently): | |
3146 | 3149 |
3147 $ cat << EOF >> $HGRCPATH | 3150 $ cat << EOF >> $HGRCPATH |
3148 > [experimental] | 3151 > [experimental] |
3149 > graphstyle.parent = ! | 3152 > graphstyle.parent = ! |
3150 > graphstyle.grandparent = -3. | 3153 > graphstyle.grandparent = -3. |
3151 > graphstyle.missing = | 3154 > graphstyle.missing = |
3152 > EOF | 3155 > EOF |
3153 $ hg log -G -r '36:18 & file("a")' -m | 3156 $ hg log -G -r '36:18 & file("a")' -m |
3154 @ changeset: 36:08a19a744424 | 3157 @ changeset: 36:08a19a744424 |
3155 ! branch: branch | 3158 -3. branch: branch |
3156 ! tag: tip | 3159 -3. tag: tip |
3157 . parent: 35:9159c3644c5e | 3160 -3. parent: 35:9159c3644c5e |
3158 . parent: 35:9159c3644c5e | 3161 -3. parent: 35:9159c3644c5e |
3159 . user: test | 3162 -3. user: test |
3160 . date: Thu Jan 01 00:00:36 1970 +0000 | 3163 -3. date: Thu Jan 01 00:00:36 1970 +0000 |
3161 . summary: (36) buggy merge: identical parents | 3164 -3. summary: (36) buggy merge: identical parents |
3162 . | 3165 -3. |
3163 o changeset: 32:d06dffa21a31 | 3166 o changeset: 32:d06dffa21a31 |
3164 !\ parent: 27:886ed638191b | 3167 !\ parent: 27:886ed638191b |
3165 ! ! parent: 31:621d83e11f67 | 3168 ! -3. parent: 31:621d83e11f67 |
3166 ! . user: test | 3169 ! -3. user: test |
3167 ! . date: Thu Jan 01 00:00:32 1970 +0000 | 3170 ! -3. date: Thu Jan 01 00:00:32 1970 +0000 |
3168 ! . summary: (32) expand | 3171 ! -3. summary: (32) expand |
3169 ! . | 3172 ! -3. |
3170 o ! changeset: 31:621d83e11f67 | 3173 o -3. changeset: 31:621d83e11f67 |
3171 !\! parent: 21:d42a756af44d | 3174 !\-3. parent: 21:d42a756af44d |
3172 ! ! parent: 30:6e11cd4b648f | 3175 ! -3. parent: 30:6e11cd4b648f |
3173 ! ! user: test | 3176 ! -3. user: test |
3174 ! ! date: Thu Jan 01 00:00:31 1970 +0000 | 3177 ! -3. date: Thu Jan 01 00:00:31 1970 +0000 |
3175 ! ! summary: (31) expand | 3178 ! -3. summary: (31) expand |
3176 ! ! | 3179 ! -3. |
3177 o ! changeset: 30:6e11cd4b648f | 3180 o -3. changeset: 30:6e11cd4b648f |
3178 !\ \ parent: 28:44ecd0b9ae99 | 3181 !\ \ parent: 28:44ecd0b9ae99 |
3179 ! ~ ! parent: 29:cd9bb2be7593 | 3182 ! ~ -3. parent: 29:cd9bb2be7593 |
3180 ! ! user: test | 3183 ! -3. user: test |
3181 ! ! date: Thu Jan 01 00:00:30 1970 +0000 | 3184 ! -3. date: Thu Jan 01 00:00:30 1970 +0000 |
3182 ! ! summary: (30) expand | 3185 ! -3. summary: (30) expand |
3183 ! / | 3186 ! / |
3184 o ! changeset: 28:44ecd0b9ae99 | 3187 o -3. changeset: 28:44ecd0b9ae99 |
3185 !\ \ parent: 1:6db2ef61d156 | 3188 !\ \ parent: 1:6db2ef61d156 |
3186 ! ~ ! parent: 26:7f25b6c2f0b9 | 3189 ! ~ -3. parent: 26:7f25b6c2f0b9 |
3187 ! ! user: test | 3190 ! -3. user: test |
3188 ! ! date: Thu Jan 01 00:00:28 1970 +0000 | 3191 ! -3. date: Thu Jan 01 00:00:28 1970 +0000 |
3189 ! ! summary: (28) merge zero known | 3192 ! -3. summary: (28) merge zero known |
3190 ! / | 3193 ! / |
3191 o ! changeset: 26:7f25b6c2f0b9 | 3194 o -3. changeset: 26:7f25b6c2f0b9 |
3192 !\ \ parent: 18:1aa84d96232a | 3195 !\ \ parent: 18:1aa84d96232a |
3193 ! ! ! parent: 25:91da8ed57247 | 3196 ! ! -3. parent: 25:91da8ed57247 |
3194 ! ! ! user: test | 3197 ! ! -3. user: test |
3195 ! ! ! date: Thu Jan 01 00:00:26 1970 +0000 | 3198 ! ! -3. date: Thu Jan 01 00:00:26 1970 +0000 |
3196 ! ! ! summary: (26) merge one known; far right | 3199 ! ! -3. summary: (26) merge one known; far right |
3197 ! ! ! | 3200 ! ! -3. |
3198 ! o ! changeset: 25:91da8ed57247 | 3201 ! o -3. changeset: 25:91da8ed57247 |
3199 ! !\! parent: 21:d42a756af44d | 3202 ! !\-3. parent: 21:d42a756af44d |
3200 ! ! ! parent: 24:a9c19a3d96b7 | 3203 ! ! -3. parent: 24:a9c19a3d96b7 |
3201 ! ! ! user: test | 3204 ! ! -3. user: test |
3202 ! ! ! date: Thu Jan 01 00:00:25 1970 +0000 | 3205 ! ! -3. date: Thu Jan 01 00:00:25 1970 +0000 |
3203 ! ! ! summary: (25) merge one known; far left | 3206 ! ! -3. summary: (25) merge one known; far left |
3204 ! ! ! | 3207 ! ! -3. |
3205 ! o ! changeset: 24:a9c19a3d96b7 | 3208 ! o -3. changeset: 24:a9c19a3d96b7 |
3206 ! !\ \ parent: 0:e6eb3150255d | 3209 ! !\ \ parent: 0:e6eb3150255d |
3207 ! ! ~ ! parent: 23:a01cddf0766d | 3210 ! ! ~ -3. parent: 23:a01cddf0766d |
3208 ! ! ! user: test | 3211 ! ! -3. user: test |
3209 ! ! ! date: Thu Jan 01 00:00:24 1970 +0000 | 3212 ! ! -3. date: Thu Jan 01 00:00:24 1970 +0000 |
3210 ! ! ! summary: (24) merge one known; immediate right | 3213 ! ! -3. summary: (24) merge one known; immediate right |
3211 ! ! / | 3214 ! ! / |
3212 ! o ! changeset: 23:a01cddf0766d | 3215 ! o -3. changeset: 23:a01cddf0766d |
3213 ! !\ \ parent: 1:6db2ef61d156 | 3216 ! !\ \ parent: 1:6db2ef61d156 |
3214 ! ! ~ ! parent: 22:e0d9cccacb5d | 3217 ! ! ~ -3. parent: 22:e0d9cccacb5d |
3215 ! ! ! user: test | 3218 ! ! -3. user: test |
3216 ! ! ! date: Thu Jan 01 00:00:23 1970 +0000 | 3219 ! ! -3. date: Thu Jan 01 00:00:23 1970 +0000 |
3217 ! ! ! summary: (23) merge one known; immediate left | 3220 ! ! -3. summary: (23) merge one known; immediate left |
3218 ! ! / | 3221 ! ! / |
3219 ! o ! changeset: 22:e0d9cccacb5d | 3222 ! o -3. changeset: 22:e0d9cccacb5d |
3220 !/!/ parent: 18:1aa84d96232a | 3223 !/-3./ parent: 18:1aa84d96232a |
3221 ! ! parent: 21:d42a756af44d | 3224 ! -3. parent: 21:d42a756af44d |
3222 ! ! user: test | 3225 ! -3. user: test |
3223 ! ! date: Thu Jan 01 00:00:22 1970 +0000 | 3226 ! -3. date: Thu Jan 01 00:00:22 1970 +0000 |
3224 ! ! summary: (22) merge two known; one far left, one far right | 3227 ! -3. summary: (22) merge two known; one far left, one far right |
3225 ! ! | 3228 ! -3. |
3226 ! o changeset: 21:d42a756af44d | 3229 ! o changeset: 21:d42a756af44d |
3227 ! !\ parent: 19:31ddc2c1573b | 3230 ! !\ parent: 19:31ddc2c1573b |
3228 ! ! ! parent: 20:d30ed6450e32 | 3231 ! ! ! parent: 20:d30ed6450e32 |
3229 ! ! ! user: test | 3232 ! ! ! user: test |
3230 ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 | 3233 ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 |