Closed stefanhahmann closed 2 months ago
@tinevez I am not sure, if this PR would contradict what you had in mind earlier, when you introduced the strategy to frequently update the branch graph to have it up-to-date in as many situations as possible?
This Pull Request changes behavior of the
BranchGraphSynchronizer
. TheBranchGraphSynchronizer
is set to optimistically assume that the branch graph isup-to-date = true
at the time the synchronizer is created. Thesync()
method evaluates theup-to-date
flag and only performs the rebuilt, if theup-to-date
flag is set tofalse
, which is usually the case, after the notifiers have informed the synchronizer that the graph had been changed.By this change, it can be achieved that, the branch features are not reset/lost after saving and re-opening a project or by just opening a track scheme branch view.
This Pull Request adds some unit tests to test the indented behavior:
testBranchFeaturesAfterSaveAndReload
inProjectLoaderTest
tests, if previously computed branch feature still exist, if the project has only been saved and reloadedtestBranchFeaturesAfterOpeningBranchView
inMamutBranchViewTrackSchemeTest
tests, if previously computed branch features still exist, after a TrackSchemeBranchView window was openedtestKeepBranchFeaturesAfterSyncWithoutChanges
inBranchGraphSynchronizerTest
tests, if previously computed branch features still exist, after thesync()
method ofBranchGraphSynchronizer
was called without any previously notified changes to the graphtestKeepBranchFeaturesAfterSyncWithChanges
inBranchGraphSynchronizerTest
tests, if previously computed branch features still exist, after thesync()
method ofBranchGraphSynchronizer
was called with previously notified changes to the graph. Since this is a current known issue, this test is ignored.Resolves #279