##// END OF EJS Templates
graphmod: remove support for graph lines mixing parent/grandparent styles (BC)...
Kyle Lippincott -
r42494:2e97640c default draft
parent child Browse files
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 (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.
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 $ 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
@@ -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 ! 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
General Comments 0
You need to be logged in to leave comments. Login now