Show More
@@ -2227,6 +2227,8 b' def displaygraph(ui, repo, dag, displaye' | |||
|
2227 | 2227 | for name, key in edgetypes.items(): |
|
2228 | 2228 | # experimental config: ui.graphstyle.* |
|
2229 | 2229 | styles[key] = ui.config('ui', 'graphstyle.%s' % name, styles[key]) |
|
2230 | if not styles[key]: | |
|
2231 | styles[key] = None | |
|
2230 | 2232 | for rev, type, ctx, parents in dag: |
|
2231 | 2233 | char = formatnode(repo, ctx) |
|
2232 | 2234 | copies = None |
@@ -31,6 +31,8 b" CHANGESET = 'C'" | |||
|
31 | 31 | PARENT = 'P' |
|
32 | 32 | GRANDPARENT = 'G' |
|
33 | 33 | MISSINGPARENT = 'M' |
|
34 | # Style of line to draw. None signals a line that ends and is removed at this | |
|
35 | # point. | |
|
34 | 36 | EDGES = {PARENT: '|', GRANDPARENT: '|', MISSINGPARENT: '|'} |
|
35 | 37 | |
|
36 | 38 | def groupbranchiter(revs, parentsfunc, firstbranch=()): |
@@ -483,6 +485,56 b' def _getpaddingline(echars, idx, ncols, ' | |||
|
483 | 485 | line.extend(echars[-(remainder * 2):]) |
|
484 | 486 | return line |
|
485 | 487 | |
|
488 | def _drawendinglines(lines, extra, edgemap, seen): | |
|
489 | """Draw ending lines for missing parent edges | |
|
490 | ||
|
491 | None indicates an edge that ends at between this node and the next | |
|
492 | Replace with a short line ending in ~ and add / lines to any edges to | |
|
493 | the right. | |
|
494 | ||
|
495 | """ | |
|
496 | if None not in edgemap.values(): | |
|
497 | return | |
|
498 | ||
|
499 | # Check for more edges to the right of our ending edges. | |
|
500 | # We need enough space to draw adjustment lines for these. | |
|
501 | edgechars = extra[::2] | |
|
502 | while edgechars and edgechars[-1] is None: | |
|
503 | edgechars.pop() | |
|
504 | shift_size = max((edgechars.count(None) * 2) - 1, 0) | |
|
505 | while len(lines) < 3 + shift_size: | |
|
506 | lines.append(extra[:]) | |
|
507 | ||
|
508 | if shift_size: | |
|
509 | empties = [] | |
|
510 | toshift = [] | |
|
511 | first_empty = extra.index(None) | |
|
512 | for i, c in enumerate(extra[first_empty::2], first_empty // 2): | |
|
513 | if c is None: | |
|
514 | empties.append(i * 2) | |
|
515 | else: | |
|
516 | toshift.append(i * 2) | |
|
517 | targets = list(range(first_empty, first_empty + len(toshift) * 2, 2)) | |
|
518 | positions = toshift[:] | |
|
519 | for line in lines[-shift_size:]: | |
|
520 | line[first_empty:] = [' '] * (len(line) - first_empty) | |
|
521 | for i in range(len(positions)): | |
|
522 | pos = positions[i] - 1 | |
|
523 | positions[i] = max(pos, targets[i]) | |
|
524 | line[pos] = '/' if pos > targets[i] else extra[toshift[i]] | |
|
525 | ||
|
526 | map = {1: '|', 2: '~'} | |
|
527 | for i, line in enumerate(lines): | |
|
528 | if None not in line: | |
|
529 | continue | |
|
530 | line[:] = [c or map.get(i, ' ') for c in line] | |
|
531 | ||
|
532 | # remove edges that ended | |
|
533 | remove = [p for p, c in edgemap.items() if c is None] | |
|
534 | for parent in remove: | |
|
535 | del edgemap[parent] | |
|
536 | seen.remove(parent) | |
|
537 | ||
|
486 | 538 | def asciistate(): |
|
487 | 539 | """returns the initial value for the "state" argument to ascii()""" |
|
488 | 540 | return { |
@@ -582,12 +634,15 b' def ascii(ui, state, type, char, text, c' | |||
|
582 | 634 | |
|
583 | 635 | # make sure that there are as many graph lines as there are |
|
584 | 636 | # log strings |
|
637 | extra_interline = echars[:(ncols + coldiff) * 2] | |
|
638 | if len(lines) < len(text): | |
|
639 | while len(lines) < len(text): | |
|
640 | lines.append(extra_interline[:]) | |
|
641 | ||
|
642 | _drawendinglines(lines, extra_interline, edgemap, seen) | |
|
643 | ||
|
585 | 644 | while len(text) < len(lines): |
|
586 | 645 | text.append("") |
|
587 | if len(lines) < len(text): | |
|
588 | extra_interline = echars[:(ncols + coldiff) * 2] | |
|
589 | while len(lines) < len(text): | |
|
590 | lines.append(extra_interline) | |
|
591 | 646 | |
|
592 | 647 | # print lines |
|
593 | 648 | indentation_level = max(ncols, ncols + coldiff) |
@@ -2423,7 +2423,7 b' change graph edge styling' | |||
|
2423 | 2423 | > [ui] |
|
2424 | 2424 | > graphstyle.parent = | |
|
2425 | 2425 | > graphstyle.grandparent = : |
|
2426 |
> graphstyle.missing = |
|
|
2426 | > graphstyle.missing = | |
|
2427 | 2427 | > EOF |
|
2428 | 2428 | $ hg log -G -r 'file("a")' -m |
|
2429 | 2429 | @ changeset: 36:08a19a744424 |
@@ -2451,178 +2451,178 b' change graph edge styling' | |||
|
2451 | 2451 | | : |
|
2452 | 2452 | o : changeset: 30:6e11cd4b648f |
|
2453 | 2453 | |\ \ parent: 28:44ecd0b9ae99 |
|
2454 |
| |
|
|
2455 |
| |
|
|
2456 |
| |
|
|
2457 |
| |
|
|
2458 |
| |
|
|
2459 |
o |
|
|
2460 |
|\ \ |
|
|
2461 |
| |
|
|
2462 |
| |
|
|
2463 |
| |
|
|
2464 |
| |
|
|
2465 |
| |
|
|
2466 |
o |
|
|
2467 |
| |
|
|
2468 |
| | |
|
|
2469 |
| | |
|
|
2470 |
| | |
|
|
2471 |
| | |
|
|
2472 |
| | |
|
|
2473 |
| o |
|
|
2474 |
| | |
|
|
2475 |
| | |
|
|
2476 |
| | |
|
|
2477 |
| | |
|
|
2478 |
| | |
|
|
2479 |
| | |
|
|
2480 |
| o |
|
|
2481 |
| | |
|
|
2482 |
| | |
|
|
2483 |
| | |
|
|
2484 |
| | |
|
|
2485 |
| | |
|
|
2486 |
| | |
|
|
2487 |
|
|
|
2488 |
| | |
|
|
2489 |
| | |
|
|
2490 |
| | |
|
|
2491 |
| | |
|
|
2492 |
| | |
|
|
2493 |
| | |
|
|
2494 |
|
|
|
2495 |
| |
|
|
2496 |
| |
|
|
2497 |
| |
|
|
2498 |
| |
|
|
2499 |
| |
|
|
2500 |
| |
|
|
2501 |
| |
|
|
2502 |
| |
|
|
2503 |
| |
|
|
2504 |
| |
|
|
2505 |
| |
|
|
2506 |
| |
|
|
2507 |
| |
|
|
2508 |
+ |
|
|
2509 |
| |
|
|
2510 |
| |
|
|
2511 |
| |
|
|
2512 |
| |
|
|
2513 |
| |
|
|
2514 |
| |
|
|
2515 |
| |
|
|
2516 |
| |
|
|
2517 |
| |
|
|
2518 |
| |
|
|
2519 |
| |
|
|
2520 |
| |
|
|
2521 |
| |
|
|
2522 |
o |
|
|
2523 |
|
|
|
2524 |
|
|
|
2525 |
|
|
|
2526 |
|
|
|
2527 |
|
|
|
2528 | . . . | | | |
|
2529 |
|
|
|
2530 |
|
|
|
2531 |
|
|
|
2532 |
|
|
|
2533 |
|
|
|
2534 |
|
|
|
2535 |
|
|
|
2536 |
|
|
|
2537 |
|
|
|
2538 |
|
|
|
2539 |
|
|
|
2540 |
|
|
|
2541 |
|
|
|
2542 |
|
|
|
2543 |
|
|
|
2544 |
|
|
|
2545 |
|
|
|
2546 |
|
|
|
2547 |
|
|
|
2548 |
|
|
|
2549 |
|
|
|
2550 |
|
|
|
2551 |
|
|
|
2552 |
|
|
|
2553 |
|
|
|
2554 |
|
|
|
2555 |
|
|
|
2556 | . . . | | | |
|
2557 |
|
|
|
2558 |
|
|
|
2559 |
|
|
|
2560 |
|
|
|
2561 |
|
|
|
2562 |
|
|
|
2563 |
|
|
|
2564 |
|
|
|
2565 |
|
|
|
2566 |
|
|
|
2567 |
|
|
|
2568 |
|
|
|
2569 |
|
|
|
2570 |
|
|
|
2571 |
|
|
|
2572 |
|
|
|
2573 |
|
|
|
2574 |
|
|
|
2575 |
|
|
|
2576 |
|
|
|
2577 |
|
|
|
2578 |
|
|
|
2579 |
|
|
|
2580 |
|
|
|
2581 |
|
|
|
2582 |
|
|
|
2583 |
|
|
|
2584 |
|
|
|
2585 |
|
|
|
2586 |
|
|
|
2587 |
|
|
|
2588 |
|
|
|
2589 |
|
|
|
2590 |
|
|
|
2591 |
|
|
|
2592 |
|
|
|
2593 |
|
|
|
2594 |
|
|
|
2595 |
|
|
|
2596 |
|
|
|
2597 |
|
|
|
2598 | . . . | | | |
|
2599 |
|
|
|
2600 |
|
|
|
2601 |
|
|
|
2602 |
|
|
|
2603 |
|
|
|
2604 |
|
|
|
2605 | . . . | . | | |
|
2606 |
|
|
|
2607 |
|
|
|
2608 |
|
|
|
2609 |
|
|
|
2610 |
|
|
|
2611 |
|
|
|
2612 | . . . | . | |
|
2613 |
|
|
|
2614 |
|
|
|
2615 |
|
|
|
2616 |
|
|
|
2617 |
|
|
|
2618 |
|
|
|
2619 | . . . | . . | |
|
2620 |
|
|
|
2621 |
|
|
|
2622 |
|
|
|
2623 |
|
|
|
2624 |
|
|
|
2625 |
|
|
|
2626 | . . . . . | |
|
2454 | | ~ : parent: 29:cd9bb2be7593 | |
|
2455 | | : user: test | |
|
2456 | | : date: Thu Jan 01 00:00:30 1970 +0000 | |
|
2457 | | : summary: (30) expand | |
|
2458 | | / | |
|
2459 | o : changeset: 28:44ecd0b9ae99 | |
|
2460 | |\ \ parent: 1:6db2ef61d156 | |
|
2461 | | ~ : parent: 26:7f25b6c2f0b9 | |
|
2462 | | : user: test | |
|
2463 | | : date: Thu Jan 01 00:00:28 1970 +0000 | |
|
2464 | | : summary: (28) merge zero known | |
|
2465 | | / | |
|
2466 | o : changeset: 26:7f25b6c2f0b9 | |
|
2467 | |\ \ parent: 18:1aa84d96232a | |
|
2468 | | | : parent: 25:91da8ed57247 | |
|
2469 | | | : user: test | |
|
2470 | | | : date: Thu Jan 01 00:00:26 1970 +0000 | |
|
2471 | | | : summary: (26) merge one known; far right | |
|
2472 | | | : | |
|
2473 | | o : changeset: 25:91da8ed57247 | |
|
2474 | | |\: parent: 21:d42a756af44d | |
|
2475 | | | : parent: 24:a9c19a3d96b7 | |
|
2476 | | | : user: test | |
|
2477 | | | : date: Thu Jan 01 00:00:25 1970 +0000 | |
|
2478 | | | : summary: (25) merge one known; far left | |
|
2479 | | | : | |
|
2480 | | o : changeset: 24:a9c19a3d96b7 | |
|
2481 | | |\ \ parent: 0:e6eb3150255d | |
|
2482 | | | ~ : parent: 23:a01cddf0766d | |
|
2483 | | | : user: test | |
|
2484 | | | : date: Thu Jan 01 00:00:24 1970 +0000 | |
|
2485 | | | : summary: (24) merge one known; immediate right | |
|
2486 | | | / | |
|
2487 | | o : changeset: 23:a01cddf0766d | |
|
2488 | | |\ \ parent: 1:6db2ef61d156 | |
|
2489 | | | ~ : parent: 22:e0d9cccacb5d | |
|
2490 | | | : user: test | |
|
2491 | | | : date: Thu Jan 01 00:00:23 1970 +0000 | |
|
2492 | | | : summary: (23) merge one known; immediate left | |
|
2493 | | | / | |
|
2494 | | o : changeset: 22:e0d9cccacb5d | |
|
2495 | |/:/ parent: 18:1aa84d96232a | |
|
2496 | | : parent: 21:d42a756af44d | |
|
2497 | | : user: test | |
|
2498 | | : date: Thu Jan 01 00:00:22 1970 +0000 | |
|
2499 | | : summary: (22) merge two known; one far left, one far right | |
|
2500 | | : | |
|
2501 | | o changeset: 21:d42a756af44d | |
|
2502 | | |\ parent: 19:31ddc2c1573b | |
|
2503 | | | | parent: 20:d30ed6450e32 | |
|
2504 | | | | user: test | |
|
2505 | | | | date: Thu Jan 01 00:00:21 1970 +0000 | |
|
2506 | | | | summary: (21) expand | |
|
2507 | | | | | |
|
2508 | +---o changeset: 20:d30ed6450e32 | |
|
2509 | | | | parent: 0:e6eb3150255d | |
|
2510 | | | ~ parent: 18:1aa84d96232a | |
|
2511 | | | user: test | |
|
2512 | | | date: Thu Jan 01 00:00:20 1970 +0000 | |
|
2513 | | | summary: (20) merge two known; two far right | |
|
2514 | | | | |
|
2515 | | o changeset: 19:31ddc2c1573b | |
|
2516 | | |\ parent: 15:1dda3f72782d | |
|
2517 | | | | parent: 17:44765d7c06e0 | |
|
2518 | | | | user: test | |
|
2519 | | | | date: Thu Jan 01 00:00:19 1970 +0000 | |
|
2520 | | | | summary: (19) expand | |
|
2521 | | | | | |
|
2522 | o | | changeset: 18:1aa84d96232a | |
|
2523 | |\| | parent: 1:6db2ef61d156 | |
|
2524 | ~ | | parent: 15:1dda3f72782d | |
|
2525 | | | user: test | |
|
2526 | | | date: Thu Jan 01 00:00:18 1970 +0000 | |
|
2527 | | | summary: (18) merge two known; two far left | |
|
2528 | / / | |
|
2529 | | o changeset: 17:44765d7c06e0 | |
|
2530 | | |\ parent: 12:86b91144a6e9 | |
|
2531 | | | | parent: 16:3677d192927d | |
|
2532 | | | | user: test | |
|
2533 | | | | date: Thu Jan 01 00:00:17 1970 +0000 | |
|
2534 | | | | summary: (17) expand | |
|
2535 | | | | | |
|
2536 | | | o changeset: 16:3677d192927d | |
|
2537 | | | |\ parent: 0:e6eb3150255d | |
|
2538 | | | ~ ~ parent: 1:6db2ef61d156 | |
|
2539 | | | user: test | |
|
2540 | | | date: Thu Jan 01 00:00:16 1970 +0000 | |
|
2541 | | | summary: (16) merge two known; one immediate right, one near right | |
|
2542 | | | | |
|
2543 | o | changeset: 15:1dda3f72782d | |
|
2544 | |\ \ parent: 13:22d8966a97e3 | |
|
2545 | | | | parent: 14:8eac370358ef | |
|
2546 | | | | user: test | |
|
2547 | | | | date: Thu Jan 01 00:00:15 1970 +0000 | |
|
2548 | | | | summary: (15) expand | |
|
2549 | | | | | |
|
2550 | | o | changeset: 14:8eac370358ef | |
|
2551 | | |\| parent: 0:e6eb3150255d | |
|
2552 | | ~ | parent: 12:86b91144a6e9 | |
|
2553 | | | user: test | |
|
2554 | | | date: Thu Jan 01 00:00:14 1970 +0000 | |
|
2555 | | | summary: (14) merge two known; one immediate right, one far right | |
|
2556 | | / | |
|
2557 | o | changeset: 13:22d8966a97e3 | |
|
2558 | |\ \ parent: 9:7010c0af0a35 | |
|
2559 | | | | parent: 11:832d76e6bdf2 | |
|
2560 | | | | user: test | |
|
2561 | | | | date: Thu Jan 01 00:00:13 1970 +0000 | |
|
2562 | | | | summary: (13) expand | |
|
2563 | | | | | |
|
2564 | +---o changeset: 12:86b91144a6e9 | |
|
2565 | | | | parent: 1:6db2ef61d156 | |
|
2566 | | | ~ parent: 9:7010c0af0a35 | |
|
2567 | | | user: test | |
|
2568 | | | date: Thu Jan 01 00:00:12 1970 +0000 | |
|
2569 | | | summary: (12) merge two known; one immediate right, one far left | |
|
2570 | | | | |
|
2571 | | o changeset: 11:832d76e6bdf2 | |
|
2572 | | |\ parent: 6:b105a072e251 | |
|
2573 | | | | parent: 10:74c64d036d72 | |
|
2574 | | | | user: test | |
|
2575 | | | | date: Thu Jan 01 00:00:11 1970 +0000 | |
|
2576 | | | | summary: (11) expand | |
|
2577 | | | | | |
|
2578 | | | o changeset: 10:74c64d036d72 | |
|
2579 | | |/| parent: 0:e6eb3150255d | |
|
2580 | | | ~ parent: 6:b105a072e251 | |
|
2581 | | | user: test | |
|
2582 | | | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
2583 | | | summary: (10) merge two known; one immediate left, one near right | |
|
2584 | | | | |
|
2585 | o | changeset: 9:7010c0af0a35 | |
|
2586 | |\ \ parent: 7:b632bb1b1224 | |
|
2587 | | | | parent: 8:7a0b11f71937 | |
|
2588 | | | | user: test | |
|
2589 | | | | date: Thu Jan 01 00:00:09 1970 +0000 | |
|
2590 | | | | summary: (9) expand | |
|
2591 | | | | | |
|
2592 | | o | changeset: 8:7a0b11f71937 | |
|
2593 | |/| | parent: 0:e6eb3150255d | |
|
2594 | | ~ | parent: 7:b632bb1b1224 | |
|
2595 | | | user: test | |
|
2596 | | | date: Thu Jan 01 00:00:08 1970 +0000 | |
|
2597 | | | summary: (8) merge two known; one immediate left, one far right | |
|
2598 | | / | |
|
2599 | o | changeset: 7:b632bb1b1224 | |
|
2600 | |\ \ parent: 2:3d9a33b8d1e1 | |
|
2601 | | ~ | parent: 5:4409d547b708 | |
|
2602 | | | user: test | |
|
2603 | | | date: Thu Jan 01 00:00:07 1970 +0000 | |
|
2604 | | | summary: (7) expand | |
|
2605 | | / | |
|
2606 | | o changeset: 6:b105a072e251 | |
|
2607 | |/| parent: 2:3d9a33b8d1e1 | |
|
2608 | | ~ parent: 5:4409d547b708 | |
|
2609 | | user: test | |
|
2610 | | date: Thu Jan 01 00:00:06 1970 +0000 | |
|
2611 | | summary: (6) merge two known; one immediate left, one far left | |
|
2612 | | | |
|
2613 | o changeset: 5:4409d547b708 | |
|
2614 | |\ parent: 3:27eef8ed80b4 | |
|
2615 | | ~ parent: 4:26a8bac39d9f | |
|
2616 | | user: test | |
|
2617 | | date: Thu Jan 01 00:00:05 1970 +0000 | |
|
2618 | | summary: (5) expand | |
|
2619 | | | |
|
2620 | o changeset: 4:26a8bac39d9f | |
|
2621 | |\ parent: 1:6db2ef61d156 | |
|
2622 | ~ ~ parent: 3:27eef8ed80b4 | |
|
2623 | user: test | |
|
2624 | date: Thu Jan 01 00:00:04 1970 +0000 | |
|
2625 | summary: (4) merge two known; one immediate left, one immediate right | |
|
2626 | ||
|
2627 | 2627 | |
|
2628 | 2628 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now