Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revset_graph: split graph into linear segments, emit nodes per segment
The original idea was similar to Mercurial's "topo" sorting, but it couldn't reorder merge-heavy history. In order to render merges of topic branches nicely, we need to roughly reorder branches at merge point, not at fork point. To achieve that, we build a graph of linear segments, and walk them from the head towards the root of the second branch. While walking, descendant segments of the current segment will also be visited. Compared to Sapling's beautify_graph(), this is lazy, and can roughly preserve the index (or chronological) order. I tried beautify_graph() with prioritizing the @ commit, but the result seemed too aggressively reordered. Perhaps, for merge-heavy history, beautify_graph() will produce a better result. For my wip branches (~30 branches, a couple of commits per branch), this works pretty well. Closes jj-vcs#242
- Loading branch information