How to keep a mercury graph "flat"

I have a "master" repository, I clone it and make some changes to the clone. Meanwhile, there are other changes in "main", so I pull them out and merge them into my clone. I make more changes in the clone and merge any other new changes with "main". It gives me this graph:

enter image description here

When I finish my work in the clone, I click on the main repository and now the graph in "main" looks like this:

enter image description here

I know they are topologically the same, but for me the first one is clearer (this is a very simple case, but things can get complicated).

Is there a way to prevent this? I found this question about reordering the graph after the fact, but I thought maybe there is a problem in my workflow or something I could change to prevent it.

+3


source to share


1 answer


The problem is that the graph is sorted by revision number and not by revision date. This effectively sorts by the date / time when the changes appeared in the current repository. The thg project has an unresolved issue allowing the list to be sorted by revision date, but one developer said that this change would require linking the graph as he thinks rewriting the graph would be too difficult for too little gain (problem here ).

There is no merge-related workflow that I know of to fix it because changes will never be in the same order across different repositories if the work is done on multiple repositories.



One way to accumulate the tree would be to use rebase

instead of merge

after pulling your changes. This will lead to a single branch without any merges, as it rewrites history to look as if your changes draft

were implemented after the changes you just pulled. If you want to read rebase

this information here .

+4


source







All Articles