![]() The topological sort algorithm in TopoSortGenerator for RevWalk may mix multiple lines of history, producing results that differ from C git's git log whose man page states: "Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed." Lines of history are mixed because TopoSortGenerator merely delays a commit until all of its children have been produced; it does not immediately produce a commit after its last child has been produced. Therefore, when the last child of a commit has been produced, unpop the commit so that it will be returned upon the subsequent call to next() in TopoSortGenerator. To avoid producing duplicates, mark commits that have not yet been produced as TOPO_QUEUED so that when a commit is popped, it is produced if and only if TOPO_QUEUED is set. To support nesting with other generators that may produce the same commit multiple times like DepthGenerator (for example, StartGenerator does this), do not increment parent inDegree for the same child commit more than once. Modify tests that assert that TopoSortGenerator mixes lines of commit history. Change-Id: I4ee03c7a8e5265d61230b2a01ae3858745b2432b Signed-off-by: Alex Spradlin <alexaspradlin@google.com> |
||
---|---|---|
.. | ||
.settings | ||
META-INF | ||
findBugs | ||
resources | ||
src/org/eclipse/jgit | ||
.classpath | ||
.fbprefs | ||
.gitignore | ||
.project | ||
BUILD | ||
about.html | ||
build.properties | ||
plugin.properties | ||
pom.xml |