Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph: sort parents from farthest to closest #3070

Closed
wants to merge 1 commit into from

Conversation

zummenix
Copy link
Contributor

This is a follow up of #3048

Please note that I don't fully understand what I'm doing here, bear with me :)

Currently, as I understand, the edges for children with multiple parents are "drawn" in exact order they appear in the graph, which leads to cases like this:

@   merge
├─╮
◉ │  fix
├─╯
◉  initial
│
◉

First parent of merge is fix and second is initial.

More visually appealing graph would be (in my opinion) when merge has first parent initial (oldest/farthest) and second parent fix (newest/closest). If we sort parents by their position we get:

@    merge
├─╮
│ ◉  fix
├─╯
◉  initial
│
◉

I've added the change in RevsetGraphIterator (I'm not sure if this is the right place) and two tests to check that the order of commits in a merge does not matter. The other changes are test snapshots (which I've checked only briefly).

I'd like to hear your feedback.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@zummenix
Copy link
Contributor Author

I've looked into several repos with heavy branching and came to conclusion that this solution is wrong. Closing

@zummenix zummenix closed this Feb 17, 2024
@zummenix zummenix deleted the graph-sort-parents branch February 17, 2024 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant