diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py --- a/mercurial/graphmod.py +++ b/mercurial/graphmod.py @@ -281,7 +281,7 @@ line.extend(echars[-(remainder * 2):]) return line -def _drawendinglines(lines, extra, edgemap, seen): +def _drawendinglines(lines, extra, edgemap, seen, state): """Draw ending lines for missing parent edges None indicates an edge that ends at between this node and the next @@ -298,7 +298,8 @@ while edgechars and edgechars[-1] is None: edgechars.pop() shift_size = max((edgechars.count(None) * 2) - 1, 0) - while len(lines) < 3 + shift_size: + minlines = 3 if not state['graphshorten'] else 2 + while len(lines) < minlines + shift_size: lines.append(extra[:]) if shift_size: @@ -319,7 +320,7 @@ positions[i] = max(pos, targets[i]) line[pos] = '/' if pos > targets[i] else extra[toshift[i]] - map = {1: '|', 2: '~'} + map = {1: '|', 2: '~'} if not state['graphshorten'] else {1: '~'} for i, line in enumerate(lines): if None not in line: continue @@ -463,7 +464,7 @@ while len(lines) < len(text): lines.append(extra_interline[:]) - _drawendinglines(lines, extra_interline, edgemap, seen) + _drawendinglines(lines, extra_interline, edgemap, seen, state) while len(text) < len(lines): text.append("") diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t --- a/tests/test-logexchange.t +++ b/tests/test-logexchange.t @@ -77,10 +77,8 @@ $ hg show work o 3e14 (wat) (default/wat) added bar - | ~ @ ec24 (default/default) Added h - | ~ $ hg update "default/wat" diff --git a/tests/test-show-work.t b/tests/test-show-work.t --- a/tests/test-show-work.t +++ b/tests/test-show-work.t @@ -57,7 +57,6 @@ $ hg show work @ 128c commit 2 o 181c commit 1 - | ~ Multiple DAG heads will be shown @@ -72,7 +71,6 @@ | o 128c commit 2 |/ o 181c commit 1 - | ~ Even when wdir is something else @@ -84,7 +82,6 @@ | o 128c commit 2 |/ o 181c commit 1 - | ~ Draft child shows public head (multiple heads) @@ -131,7 +128,6 @@ | o 128c commit 2 |/ o 181c commit 1 - | ~ $ cd .. @@ -162,7 +158,6 @@ | o 128c (@) commit 2 |/ o 181c commit 1 - | ~ $ cd .. @@ -185,7 +180,6 @@ @ 3758 Added tag 0.2 for changeset 6379c25b76f1 o 6379 (0.2) commit 3 o a2ad Added tag 0.1 for changeset 6a75536ea0b1 - | ~ $ cd .. @@ -246,7 +240,6 @@ $ hg show work --color=debug @ [log.changeset changeset.draft changeset.unstable instability.orphan|32f3] [log.description|commit 3] x [log.changeset changeset.draft changeset.obsolete|6a75] [log.description|commit 2] - | ~ $ cd ..