Show More
@@ -469,22 +469,6 b' def ascii(ui, state, type, char, text, c' | |||||
469 | while len(text) < len(lines): |
|
469 | while len(text) < len(lines): | |
470 | text.append("") |
|
470 | text.append("") | |
471 |
|
471 | |||
472 | if any(len(char) > 1 for char in edgemap.values()): |
|
|||
473 | # limit drawing an edge to the first or last N lines of the current |
|
|||
474 | # section the rest of the edge is drawn like a parent line. |
|
|||
475 | parent = state['styles'][PARENT][-1:] |
|
|||
476 | def _drawgp(char, i): |
|
|||
477 | # should a grandparent character be drawn for this line? |
|
|||
478 | if len(char) < 2: |
|
|||
479 | return True |
|
|||
480 | num = int(char[:-1]) |
|
|||
481 | # either skip first num lines or take last num lines, based on sign |
|
|||
482 | return -num <= i if num < 0 else (len(lines) - i) <= num |
|
|||
483 | for i, line in enumerate(lines): |
|
|||
484 | line[:] = [c[-1:] if _drawgp(c, i) else parent for c in line] |
|
|||
485 | edgemap.update( |
|
|||
486 | (e, (c if len(c) < 2 else parent)) for e, c in edgemap.items()) |
|
|||
487 |
|
||||
488 | # print lines |
|
472 | # print lines | |
489 | indentation_level = max(ncols, ncols + coldiff) |
|
473 | indentation_level = max(ncols, ncols + coldiff) | |
490 | lines = ["%-*s " % (2 * indentation_level, "".join(line)) for line in lines] |
|
474 | lines = ["%-*s " % (2 * indentation_level, "".join(line)) for line in lines] |
@@ -3028,12 +3028,14 b' Setting HGPLAIN ignores graphmod styling' | |||||
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 |
|
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. |
|
|||
3035 |
|
3034 | |||
3036 | Last 3 lines: |
|
3035 | This was removed, and this test now shows that muliple characters being | |
|
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] | |
@@ -3043,77 +3045,77 b' Last 3 lines:' | |||||
3043 | > EOF |
|
3045 | > EOF | |
3044 |
|
|
3046 | $ hg log -G -r '36:18 & file("a")' -m | |
3045 | @ changeset: 36:08a19a744424 |
|
3047 | @ changeset: 36:08a19a744424 | |
3046 |
|
|
3048 | 3. branch: branch | |
3047 |
|
|
3049 | 3. tag: tip | |
3048 |
|
|
3050 | 3. parent: 35:9159c3644c5e | |
3049 |
|
|
3051 | 3. parent: 35:9159c3644c5e | |
3050 |
|
|
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 |
! |
|
3058 | ! 3. parent: 31:621d83e11f67 | |
3057 |
! |
|
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 |
|
3063 | o 3. changeset: 31:621d83e11f67 | |
3062 |
!\ |
|
3064 | !\3. parent: 21:d42a756af44d | |
3063 |
! |
|
3065 | ! 3. parent: 30:6e11cd4b648f | |
3064 |
! |
|
3066 | ! 3. user: test | |
3065 |
! |
|
3067 | ! 3. date: Thu Jan 01 00:00:31 1970 +0000 | |
3066 |
! |
|
3068 | ! 3. summary: (31) expand | |
3067 |
! |
|
3069 | ! 3. | |
3068 |
o |
|
3070 | o 3. changeset: 30:6e11cd4b648f | |
3069 | !\ \ parent: 28:44ecd0b9ae99 |
|
3071 | !\ \ parent: 28:44ecd0b9ae99 | |
3070 |
! ~ |
|
3072 | ! ~ 3. parent: 29:cd9bb2be7593 | |
3071 |
! |
|
3073 | ! 3. user: test | |
3072 |
! |
|
3074 | ! 3. date: Thu Jan 01 00:00:30 1970 +0000 | |
3073 |
! |
|
3075 | ! 3. summary: (30) expand | |
3074 | ! / |
|
3076 | ! / | |
3075 |
o |
|
3077 | o 3. changeset: 28:44ecd0b9ae99 | |
3076 | !\ \ parent: 1:6db2ef61d156 |
|
3078 | !\ \ parent: 1:6db2ef61d156 | |
3077 |
! ~ |
|
3079 | ! ~ 3. parent: 26:7f25b6c2f0b9 | |
3078 |
! |
|
3080 | ! 3. user: test | |
3079 |
! |
|
3081 | ! 3. date: Thu Jan 01 00:00:28 1970 +0000 | |
3080 |
! |
|
3082 | ! 3. summary: (28) merge zero known | |
3081 | ! / |
|
3083 | ! / | |
3082 |
o |
|
3084 | o 3. changeset: 26:7f25b6c2f0b9 | |
3083 | !\ \ parent: 18:1aa84d96232a |
|
3085 | !\ \ parent: 18:1aa84d96232a | |
3084 |
! ! |
|
3086 | ! ! 3. parent: 25:91da8ed57247 | |
3085 |
! ! |
|
3087 | ! ! 3. user: test | |
3086 |
! ! |
|
3088 | ! ! 3. date: Thu Jan 01 00:00:26 1970 +0000 | |
3087 |
! ! |
|
3089 | ! ! 3. summary: (26) merge one known; far right | |
3088 |
! ! |
|
3090 | ! ! 3. | |
3089 |
! o |
|
3091 | ! o 3. changeset: 25:91da8ed57247 | |
3090 |
! !\ |
|
3092 | ! !\3. parent: 21:d42a756af44d | |
3091 |
! ! |
|
3093 | ! ! 3. parent: 24:a9c19a3d96b7 | |
3092 |
! ! |
|
3094 | ! ! 3. user: test | |
3093 |
! ! |
|
3095 | ! ! 3. date: Thu Jan 01 00:00:25 1970 +0000 | |
3094 |
! ! |
|
3096 | ! ! 3. summary: (25) merge one known; far left | |
3095 |
! ! |
|
3097 | ! ! 3. | |
3096 |
! o |
|
3098 | ! o 3. changeset: 24:a9c19a3d96b7 | |
3097 | ! !\ \ parent: 0:e6eb3150255d |
|
3099 | ! !\ \ parent: 0:e6eb3150255d | |
3098 |
! ! ~ |
|
3100 | ! ! ~ 3. parent: 23:a01cddf0766d | |
3099 |
! ! |
|
3101 | ! ! 3. user: test | |
3100 |
! ! |
|
3102 | ! ! 3. date: Thu Jan 01 00:00:24 1970 +0000 | |
3101 |
! ! |
|
3103 | ! ! 3. summary: (24) merge one known; immediate right | |
3102 | ! ! / |
|
3104 | ! ! / | |
3103 |
! o |
|
3105 | ! o 3. changeset: 23:a01cddf0766d | |
3104 | ! !\ \ parent: 1:6db2ef61d156 |
|
3106 | ! !\ \ parent: 1:6db2ef61d156 | |
3105 |
! ! ~ |
|
3107 | ! ! ~ 3. parent: 22:e0d9cccacb5d | |
3106 |
! ! |
|
3108 | ! ! 3. user: test | |
3107 |
! ! |
|
3109 | ! ! 3. date: Thu Jan 01 00:00:23 1970 +0000 | |
3108 |
! ! |
|
3110 | ! ! 3. summary: (23) merge one known; immediate left | |
3109 | ! ! / |
|
3111 | ! ! / | |
3110 |
! o |
|
3112 | ! o 3. changeset: 22:e0d9cccacb5d | |
3111 |
!/ |
|
3113 | !/3./ parent: 18:1aa84d96232a | |
3112 |
! |
|
3114 | ! 3. parent: 21:d42a756af44d | |
3113 |
! |
|
3115 | ! 3. user: test | |
3114 |
! |
|
3116 | ! 3. date: Thu Jan 01 00:00:22 1970 +0000 | |
3115 |
! |
|
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 | |
@@ -3142,7 +3144,8 b' Last 3 lines:' | |||||
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] | |
@@ -3152,77 +3155,77 b' All but the first 3 lines:' | |||||
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 |
|
|
3158 | -3. branch: branch | |
3156 |
|
|
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 |
! |
|
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 |
|
3173 | o -3. changeset: 31:621d83e11f67 | |
3171 |
!\ |
|
3174 | !\-3. parent: 21:d42a756af44d | |
3172 |
! |
|
3175 | ! -3. parent: 30:6e11cd4b648f | |
3173 |
! |
|
3176 | ! -3. user: test | |
3174 |
! |
|
3177 | ! -3. date: Thu Jan 01 00:00:31 1970 +0000 | |
3175 |
! |
|
3178 | ! -3. summary: (31) expand | |
3176 |
! |
|
3179 | ! -3. | |
3177 |
o |
|
3180 | o -3. changeset: 30:6e11cd4b648f | |
3178 | !\ \ parent: 28:44ecd0b9ae99 |
|
3181 | !\ \ parent: 28:44ecd0b9ae99 | |
3179 |
! ~ |
|
3182 | ! ~ -3. parent: 29:cd9bb2be7593 | |
3180 |
! |
|
3183 | ! -3. user: test | |
3181 |
! |
|
3184 | ! -3. date: Thu Jan 01 00:00:30 1970 +0000 | |
3182 |
! |
|
3185 | ! -3. summary: (30) expand | |
3183 | ! / |
|
3186 | ! / | |
3184 |
o |
|
3187 | o -3. changeset: 28:44ecd0b9ae99 | |
3185 | !\ \ parent: 1:6db2ef61d156 |
|
3188 | !\ \ parent: 1:6db2ef61d156 | |
3186 |
! ~ |
|
3189 | ! ~ -3. parent: 26:7f25b6c2f0b9 | |
3187 |
! |
|
3190 | ! -3. user: test | |
3188 |
! |
|
3191 | ! -3. date: Thu Jan 01 00:00:28 1970 +0000 | |
3189 |
! |
|
3192 | ! -3. summary: (28) merge zero known | |
3190 | ! / |
|
3193 | ! / | |
3191 |
o |
|
3194 | o -3. changeset: 26:7f25b6c2f0b9 | |
3192 | !\ \ parent: 18:1aa84d96232a |
|
3195 | !\ \ parent: 18:1aa84d96232a | |
3193 |
! ! |
|
3196 | ! ! -3. parent: 25:91da8ed57247 | |
3194 |
! ! |
|
3197 | ! ! -3. user: test | |
3195 |
! ! |
|
3198 | ! ! -3. date: Thu Jan 01 00:00:26 1970 +0000 | |
3196 |
! ! |
|
3199 | ! ! -3. summary: (26) merge one known; far right | |
3197 |
! ! |
|
3200 | ! ! -3. | |
3198 |
! o |
|
3201 | ! o -3. changeset: 25:91da8ed57247 | |
3199 |
! !\ |
|
3202 | ! !\-3. parent: 21:d42a756af44d | |
3200 |
! ! |
|
3203 | ! ! -3. parent: 24:a9c19a3d96b7 | |
3201 |
! ! |
|
3204 | ! ! -3. user: test | |
3202 |
! ! |
|
3205 | ! ! -3. date: Thu Jan 01 00:00:25 1970 +0000 | |
3203 |
! ! |
|
3206 | ! ! -3. summary: (25) merge one known; far left | |
3204 |
! ! |
|
3207 | ! ! -3. | |
3205 |
! o |
|
3208 | ! o -3. changeset: 24:a9c19a3d96b7 | |
3206 | ! !\ \ parent: 0:e6eb3150255d |
|
3209 | ! !\ \ parent: 0:e6eb3150255d | |
3207 |
! ! ~ |
|
3210 | ! ! ~ -3. parent: 23:a01cddf0766d | |
3208 |
! ! |
|
3211 | ! ! -3. user: test | |
3209 |
! ! |
|
3212 | ! ! -3. date: Thu Jan 01 00:00:24 1970 +0000 | |
3210 |
! ! |
|
3213 | ! ! -3. summary: (24) merge one known; immediate right | |
3211 | ! ! / |
|
3214 | ! ! / | |
3212 |
! o |
|
3215 | ! o -3. changeset: 23:a01cddf0766d | |
3213 | ! !\ \ parent: 1:6db2ef61d156 |
|
3216 | ! !\ \ parent: 1:6db2ef61d156 | |
3214 |
! ! ~ |
|
3217 | ! ! ~ -3. parent: 22:e0d9cccacb5d | |
3215 |
! ! |
|
3218 | ! ! -3. user: test | |
3216 |
! ! |
|
3219 | ! ! -3. date: Thu Jan 01 00:00:23 1970 +0000 | |
3217 |
! ! |
|
3220 | ! ! -3. summary: (23) merge one known; immediate left | |
3218 | ! ! / |
|
3221 | ! ! / | |
3219 |
! o |
|
3222 | ! o -3. changeset: 22:e0d9cccacb5d | |
3220 |
!/ |
|
3223 | !/-3./ parent: 18:1aa84d96232a | |
3221 |
! |
|
3224 | ! -3. parent: 21:d42a756af44d | |
3222 |
! |
|
3225 | ! -3. user: test | |
3223 |
! |
|
3226 | ! -3. date: Thu Jan 01 00:00:22 1970 +0000 | |
3224 |
! |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now