Mercurial > public > mercurial-scm > hg
comparison mercurial/graphmod.py @ 29184:09d0022cad83
graphmod: update edgemap in-place
The edgemap update was not actually propagated to future asciiedge calls;
update the edge state dictionary in-place instead.
author | Martijn Pieters <mjpieters@fb.com> |
---|---|
date | Mon, 16 May 2016 16:41:26 +0100 |
parents | 8d5584d8345b |
children | 98535ad46fc0 |
comparison
equal
deleted
inserted
replaced
29183:6def44ab4769 | 29184:09d0022cad83 |
---|---|
666 num = int(char[:-1]) | 666 num = int(char[:-1]) |
667 # either skip first num lines or take last num lines, based on sign | 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 | 668 return -num <= i if num < 0 else (len(lines) - i) <= num |
669 for i, line in enumerate(lines): | 669 for i, line in enumerate(lines): |
670 line[:] = [c[-1] if _drawgp(c, i) else parent for c in line] | 670 line[:] = [c[-1] if _drawgp(c, i) else parent for c in line] |
671 edgemap = dict( | 671 edgemap.update( |
672 (e, c if len(c) < 2 else parent) for e, c in edgemap.items()) | 672 (e, (c if len(c) < 2 else parent)) for e, c in edgemap.items()) |
673 | 673 |
674 # print lines | 674 # print lines |
675 indentation_level = max(ncols, ncols + coldiff) | 675 indentation_level = max(ncols, ncols + coldiff) |
676 for (line, logstr) in zip(lines, text): | 676 for (line, logstr) in zip(lines, text): |
677 ln = "%-*s %s" % (2 * indentation_level, "".join(line), logstr) | 677 ln = "%-*s %s" % (2 * indentation_level, "".join(line), logstr) |