[Bug 6481] New: graphlog's graphshorten option produces a confusing graph shape with extra line-crossings

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Fri Feb 5 18:22:52 UTC 2021


https://bz.mercurial-scm.org/show_bug.cgi?id=6481

            Bug ID: 6481
           Summary: graphlog's graphshorten option produces a confusing
                    graph shape with extra line-crossings
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: durin42 at gmail.com
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

I'm honestly not sure if this is fixable, but reporting from an internal bug
report:

---- 8< ------
  $ hg init a
  $ cd a
  $ echo r0 > r0; hg ci -qAm "r0, 'level 0'"; hg phase -p .
  $ for i in 1 2 3 4; do
  >   hg co 0; echo r$i > r$i; hg ci -qAm "r$i, 'level 1'"
  > done
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ hg merge -r 1; hg ci -qAm "r5, 'level 2', merge r1 and r4"
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)
  $ echo r6 > r6; hg ci -qAm "r6, 'level 3'"
  $ hg co 0
  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
  $ echo r7 > r7; hg ci -qAm "r7, 'level 1' (again)"

  $ cat >> .hg/hgrc <<'EOF'
  > [experimental]
  > graphshorten=1
  > 
  > [templates]
  > tmpl="<<<{label("desc.{phase}", desc)}>>>; parents: {revset("parents(%d)",
rev) % "({label("desc.{phase}", desc)})  "}"
  > 
  > [alias]
  > xl = log -G -T"{tmpl}" -r'sort(all(), topo)'
  > 
  > [color]
  > desc.draft=bold green
  > desc.public=bold white
  > EOF

 $ hg log -G --style compact
  @  7[tip]:0   87679442b769   1970-01-01 00:00 +0000   test
  |    r7, 'level 1' (again)
  |
  | o  6   f06f5b90f5b7   1970-01-01 00:00 +0000   test
  | |    r6, 'level 3'
  | |
  | o    5:4,1   edcefd3216e0   1970-01-01 00:00 +0000   test
  | |\     r5, 'level 2', merge r1 and r4
  | | |
  +---o  4:0   1b64d1e0d0df   1970-01-01 00:00 +0000   test
  | |      r4, 'level 1'
  | |
  +---o  3:0   d392f3869b4c   1970-01-01 00:00 +0000   test
  | |      r3, 'level 1'
  | |
  +---o  2:0   3f2d8a334ec1   1970-01-01 00:00 +0000   test
  | |      r2, 'level 1'
  | |
  | o  1   fec040477454   1970-01-01 00:00 +0000   test
  |/     r1, 'level 1'
  |
  o  0   5135cd150024   1970-01-01 00:00 +0000   test
       r0, 'level 0'

Confusing output: even though r2 and r3 are heads, it looks like they're
ancestors of r4.
  $ hg xl
  @  <<<r7, 'level 1' (again)>>>; parents: (r0, 'level 0')
  | o  <<<r6, 'level 3'>>>; parents: (r5, 'level 2', merge r1 and r4)
  | o    <<<r5, 'level 2', merge r1 and r4>>>; parents: (r1, 'level 1')  (r4,
'level 1')
  | |\
  +---o  <<<r4, 'level 1'>>>; parents: (r0, 'level 0')
  +---o  <<<r3, 'level 1'>>>; parents: (r0, 'level 0')
  +---o  <<<r2, 'level 1'>>>; parents: (r0, 'level 0')
  | o  <<<r1, 'level 1'>>>; parents: (r0, 'level 0')
  |/
  o  <<<r0, 'level 0'>>>; parents:


---- 8< ------

I'm honestly not sure this is fixable, but if anyone has ideas I'm open to
suggestions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list