Show More
@@ -32,7 +32,9 b" PARENT = 'P'" | |||
|
32 | 32 | GRANDPARENT = 'G' |
|
33 | 33 | MISSINGPARENT = 'M' |
|
34 | 34 | # Style of line to draw. None signals a line that ends and is removed at this |
|
35 | # point. | |
|
35 | # point. A number prefix means only the last N characters of the current block | |
|
36 | # will use that style, the rest will use the PARENT style. Add a - sign | |
|
37 | # (so making N negative) and all but the first N characters use that style. | |
|
36 | 38 | EDGES = {PARENT: '|', GRANDPARENT: ':', MISSINGPARENT: None} |
|
37 | 39 | |
|
38 | 40 | def groupbranchiter(revs, parentsfunc, firstbranch=()): |
@@ -653,6 +655,22 b' def ascii(ui, state, type, char, text, c' | |||
|
653 | 655 | while len(text) < len(lines): |
|
654 | 656 | text.append("") |
|
655 | 657 | |
|
658 | if any(len(char) > 1 for char in edgemap.values()): | |
|
659 | # limit drawing an edge to the first or last N lines of the current | |
|
660 | # section the rest of the edge is drawn like a parent line. | |
|
661 | parent = state['styles'][PARENT][-1] | |
|
662 | def _drawgp(char, i): | |
|
663 | # should a grandparent character be drawn for this line? | |
|
664 | if len(char) < 2: | |
|
665 | return True | |
|
666 | num = int(char[:-1]) | |
|
667 | # either skip first num lines or take last num lines, based on sign | |
|
668 | return -num <= i if num < 0 else (len(lines) - i) <= num | |
|
669 | for i, line in enumerate(lines): | |
|
670 | line[:] = [c[-1] if _drawgp(c, i) else parent for c in line] | |
|
671 | edgemap = dict( | |
|
672 | (e, c if len(c) < 2 else parent) for e, c in edgemap.items()) | |
|
673 | ||
|
656 | 674 | # print lines |
|
657 | 675 | indentation_level = max(ncols, ncols + coldiff) |
|
658 | 676 | for (line, logstr) in zip(lines, text): |
@@ -3036,6 +3036,228 b' Setting HGPLAIN ignores graphmod styling' | |||
|
3036 | 3036 | date: Thu Jan 01 00:00:04 1970 +0000 |
|
3037 | 3037 | summary: (4) merge two known; one immediate left, one immediate right |
|
3038 | 3038 | |
|
3039 | Draw only part of a grandparent line differently with "<N><char>"; only the | |
|
3040 | last N lines (for positive N) or everything but the first N lines (for | |
|
3041 | negative N) along the current node use the style, the rest of the edge uses | |
|
3042 | the parent edge styling. | |
|
3043 | ||
|
3044 | Last 3 lines: | |
|
3045 | ||
|
3046 | $ cat << EOF >> $HGRCPATH | |
|
3047 | > [experimental] | |
|
3048 | > graphstyle.parent = ! | |
|
3049 | > graphstyle.grandparent = 3. | |
|
3050 | > graphstyle.missing = | |
|
3051 | > EOF | |
|
3052 | $ hg log -G -r '36:18 & file("a")' -m | |
|
3053 | @ changeset: 36:08a19a744424 | |
|
3054 | ! branch: branch | |
|
3055 | ! tag: tip | |
|
3056 | ! parent: 35:9159c3644c5e | |
|
3057 | ! parent: 35:9159c3644c5e | |
|
3058 | ! user: test | |
|
3059 | . date: Thu Jan 01 00:00:36 1970 +0000 | |
|
3060 | . summary: (36) buggy merge: identical parents | |
|
3061 | . | |
|
3062 | o changeset: 32:d06dffa21a31 | |
|
3063 | !\ parent: 27:886ed638191b | |
|
3064 | ! ! parent: 31:621d83e11f67 | |
|
3065 | ! ! user: test | |
|
3066 | ! . date: Thu Jan 01 00:00:32 1970 +0000 | |
|
3067 | ! . summary: (32) expand | |
|
3068 | ! . | |
|
3069 | o ! changeset: 31:621d83e11f67 | |
|
3070 | !\! parent: 21:d42a756af44d | |
|
3071 | ! ! parent: 30:6e11cd4b648f | |
|
3072 | ! ! user: test | |
|
3073 | ! . date: Thu Jan 01 00:00:31 1970 +0000 | |
|
3074 | ! . summary: (31) expand | |
|
3075 | ! . | |
|
3076 | o ! changeset: 30:6e11cd4b648f | |
|
3077 | !\ \ parent: 28:44ecd0b9ae99 | |
|
3078 | ! ~ ! parent: 29:cd9bb2be7593 | |
|
3079 | ! ! user: test | |
|
3080 | ! . date: Thu Jan 01 00:00:30 1970 +0000 | |
|
3081 | ! . summary: (30) expand | |
|
3082 | ! / | |
|
3083 | o ! changeset: 28:44ecd0b9ae99 | |
|
3084 | !\ \ parent: 1:6db2ef61d156 | |
|
3085 | ! ~ ! parent: 26:7f25b6c2f0b9 | |
|
3086 | ! ! user: test | |
|
3087 | ! . date: Thu Jan 01 00:00:28 1970 +0000 | |
|
3088 | ! . summary: (28) merge zero known | |
|
3089 | ! / | |
|
3090 | o ! changeset: 26:7f25b6c2f0b9 | |
|
3091 | !\ \ parent: 18:1aa84d96232a | |
|
3092 | ! ! ! parent: 25:91da8ed57247 | |
|
3093 | ! ! ! user: test | |
|
3094 | ! ! . date: Thu Jan 01 00:00:26 1970 +0000 | |
|
3095 | ! ! . summary: (26) merge one known; far right | |
|
3096 | ! ! . | |
|
3097 | ! o ! changeset: 25:91da8ed57247 | |
|
3098 | ! !\! parent: 21:d42a756af44d | |
|
3099 | ! ! ! parent: 24:a9c19a3d96b7 | |
|
3100 | ! ! ! user: test | |
|
3101 | ! ! . date: Thu Jan 01 00:00:25 1970 +0000 | |
|
3102 | ! ! . summary: (25) merge one known; far left | |
|
3103 | ! ! . | |
|
3104 | ! o ! changeset: 24:a9c19a3d96b7 | |
|
3105 | ! !\ \ parent: 0:e6eb3150255d | |
|
3106 | ! ! ~ ! parent: 23:a01cddf0766d | |
|
3107 | ! ! ! user: test | |
|
3108 | ! ! . date: Thu Jan 01 00:00:24 1970 +0000 | |
|
3109 | ! ! . summary: (24) merge one known; immediate right | |
|
3110 | ! ! / | |
|
3111 | ! o ! changeset: 23:a01cddf0766d | |
|
3112 | ! !\ \ parent: 1:6db2ef61d156 | |
|
3113 | ! ! ~ ! parent: 22:e0d9cccacb5d | |
|
3114 | ! ! ! user: test | |
|
3115 | ! ! . date: Thu Jan 01 00:00:23 1970 +0000 | |
|
3116 | ! ! . summary: (23) merge one known; immediate left | |
|
3117 | ! ! / | |
|
3118 | ! o ! changeset: 22:e0d9cccacb5d | |
|
3119 | !/!/ parent: 18:1aa84d96232a | |
|
3120 | ! ! parent: 21:d42a756af44d | |
|
3121 | ! ! user: test | |
|
3122 | ! . date: Thu Jan 01 00:00:22 1970 +0000 | |
|
3123 | ! . summary: (22) merge two known; one far left, one far right | |
|
3124 | ! . | |
|
3125 | ! o changeset: 21:d42a756af44d | |
|
3126 | ! !\ parent: 19:31ddc2c1573b | |
|
3127 | ! ! ! parent: 20:d30ed6450e32 | |
|
3128 | ! ! ! user: test | |
|
3129 | ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 | |
|
3130 | ! ! ! summary: (21) expand | |
|
3131 | ! ! ! | |
|
3132 | +---o changeset: 20:d30ed6450e32 | |
|
3133 | ! ! | parent: 0:e6eb3150255d | |
|
3134 | ! ! ~ parent: 18:1aa84d96232a | |
|
3135 | ! ! user: test | |
|
3136 | ! ! date: Thu Jan 01 00:00:20 1970 +0000 | |
|
3137 | ! ! summary: (20) merge two known; two far right | |
|
3138 | ! ! | |
|
3139 | ! o changeset: 19:31ddc2c1573b | |
|
3140 | ! |\ parent: 15:1dda3f72782d | |
|
3141 | ! ~ ~ parent: 17:44765d7c06e0 | |
|
3142 | ! user: test | |
|
3143 | ! date: Thu Jan 01 00:00:19 1970 +0000 | |
|
3144 | ! summary: (19) expand | |
|
3145 | ! | |
|
3146 | o changeset: 18:1aa84d96232a | |
|
3147 | |\ parent: 1:6db2ef61d156 | |
|
3148 | ~ ~ parent: 15:1dda3f72782d | |
|
3149 | user: test | |
|
3150 | date: Thu Jan 01 00:00:18 1970 +0000 | |
|
3151 | summary: (18) merge two known; two far left | |
|
3152 | ||
|
3153 | All but the first 3 lines: | |
|
3154 | ||
|
3155 | $ cat << EOF >> $HGRCPATH | |
|
3156 | > [experimental] | |
|
3157 | > graphstyle.parent = ! | |
|
3158 | > graphstyle.grandparent = -3. | |
|
3159 | > graphstyle.missing = | |
|
3160 | > EOF | |
|
3161 | $ hg log -G -r '36:18 & file("a")' -m | |
|
3162 | @ changeset: 36:08a19a744424 | |
|
3163 | ! branch: branch | |
|
3164 | ! tag: tip | |
|
3165 | . parent: 35:9159c3644c5e | |
|
3166 | . parent: 35:9159c3644c5e | |
|
3167 | . user: test | |
|
3168 | . date: Thu Jan 01 00:00:36 1970 +0000 | |
|
3169 | . summary: (36) buggy merge: identical parents | |
|
3170 | . | |
|
3171 | o changeset: 32:d06dffa21a31 | |
|
3172 | !\ parent: 27:886ed638191b | |
|
3173 | ! ! parent: 31:621d83e11f67 | |
|
3174 | ! . user: test | |
|
3175 | ! . date: Thu Jan 01 00:00:32 1970 +0000 | |
|
3176 | ! . summary: (32) expand | |
|
3177 | ! . | |
|
3178 | o ! changeset: 31:621d83e11f67 | |
|
3179 | !\! parent: 21:d42a756af44d | |
|
3180 | ! ! parent: 30:6e11cd4b648f | |
|
3181 | ! . user: test | |
|
3182 | ! . date: Thu Jan 01 00:00:31 1970 +0000 | |
|
3183 | ! . summary: (31) expand | |
|
3184 | ! . | |
|
3185 | o ! changeset: 30:6e11cd4b648f | |
|
3186 | !\ \ parent: 28:44ecd0b9ae99 | |
|
3187 | ! ~ ! parent: 29:cd9bb2be7593 | |
|
3188 | ! . user: test | |
|
3189 | ! . date: Thu Jan 01 00:00:30 1970 +0000 | |
|
3190 | ! . summary: (30) expand | |
|
3191 | ! / | |
|
3192 | o ! changeset: 28:44ecd0b9ae99 | |
|
3193 | !\ \ parent: 1:6db2ef61d156 | |
|
3194 | ! ~ ! parent: 26:7f25b6c2f0b9 | |
|
3195 | ! . user: test | |
|
3196 | ! . date: Thu Jan 01 00:00:28 1970 +0000 | |
|
3197 | ! . summary: (28) merge zero known | |
|
3198 | ! / | |
|
3199 | o ! changeset: 26:7f25b6c2f0b9 | |
|
3200 | !\ \ parent: 18:1aa84d96232a | |
|
3201 | ! ! ! parent: 25:91da8ed57247 | |
|
3202 | ! ! . user: test | |
|
3203 | ! ! . date: Thu Jan 01 00:00:26 1970 +0000 | |
|
3204 | ! ! . summary: (26) merge one known; far right | |
|
3205 | ! ! . | |
|
3206 | ! o ! changeset: 25:91da8ed57247 | |
|
3207 | ! !\! parent: 21:d42a756af44d | |
|
3208 | ! ! ! parent: 24:a9c19a3d96b7 | |
|
3209 | ! ! . user: test | |
|
3210 | ! ! . date: Thu Jan 01 00:00:25 1970 +0000 | |
|
3211 | ! ! . summary: (25) merge one known; far left | |
|
3212 | ! ! . | |
|
3213 | ! o ! changeset: 24:a9c19a3d96b7 | |
|
3214 | ! !\ \ parent: 0:e6eb3150255d | |
|
3215 | ! ! ~ ! parent: 23:a01cddf0766d | |
|
3216 | ! ! . user: test | |
|
3217 | ! ! . date: Thu Jan 01 00:00:24 1970 +0000 | |
|
3218 | ! ! . summary: (24) merge one known; immediate right | |
|
3219 | ! ! / | |
|
3220 | ! o ! changeset: 23:a01cddf0766d | |
|
3221 | ! !\ \ parent: 1:6db2ef61d156 | |
|
3222 | ! ! ~ ! parent: 22:e0d9cccacb5d | |
|
3223 | ! ! . user: test | |
|
3224 | ! ! . date: Thu Jan 01 00:00:23 1970 +0000 | |
|
3225 | ! ! . summary: (23) merge one known; immediate left | |
|
3226 | ! ! / | |
|
3227 | ! o ! changeset: 22:e0d9cccacb5d | |
|
3228 | !/!/ parent: 18:1aa84d96232a | |
|
3229 | ! ! parent: 21:d42a756af44d | |
|
3230 | ! . user: test | |
|
3231 | ! . date: Thu Jan 01 00:00:22 1970 +0000 | |
|
3232 | ! . summary: (22) merge two known; one far left, one far right | |
|
3233 | ! . | |
|
3234 | ! o changeset: 21:d42a756af44d | |
|
3235 | ! !\ parent: 19:31ddc2c1573b | |
|
3236 | ! ! ! parent: 20:d30ed6450e32 | |
|
3237 | ! ! ! user: test | |
|
3238 | ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 | |
|
3239 | ! ! ! summary: (21) expand | |
|
3240 | ! ! ! | |
|
3241 | +---o changeset: 20:d30ed6450e32 | |
|
3242 | ! ! | parent: 0:e6eb3150255d | |
|
3243 | ! ! ~ parent: 18:1aa84d96232a | |
|
3244 | ! ! user: test | |
|
3245 | ! ! date: Thu Jan 01 00:00:20 1970 +0000 | |
|
3246 | ! ! summary: (20) merge two known; two far right | |
|
3247 | ! ! | |
|
3248 | ! o changeset: 19:31ddc2c1573b | |
|
3249 | ! |\ parent: 15:1dda3f72782d | |
|
3250 | ! ~ ~ parent: 17:44765d7c06e0 | |
|
3251 | ! user: test | |
|
3252 | ! date: Thu Jan 01 00:00:19 1970 +0000 | |
|
3253 | ! summary: (19) expand | |
|
3254 | ! | |
|
3255 | o changeset: 18:1aa84d96232a | |
|
3256 | |\ parent: 1:6db2ef61d156 | |
|
3257 | ~ ~ parent: 15:1dda3f72782d | |
|
3258 | user: test | |
|
3259 | date: Thu Jan 01 00:00:18 1970 +0000 | |
|
3260 | summary: (18) merge two known; two far left | |
|
3039 | 3261 | |
|
3040 | 3262 | $ cd .. |
|
3041 | 3263 |
General Comments 0
You need to be logged in to leave comments.
Login now