Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Refactoring RepositoryManager and Repository#324

Merged
shana merged 77 commits intomasterfrom
fixes/repository-refactor
Oct 17, 2017
Merged

Refactoring RepositoryManager and Repository#324
shana merged 77 commits intomasterfrom
fixes/repository-refactor

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Sep 15, 2017

  • Chose to centralize around the terms ActiveBranch and ActiveRemote instead of CurrentBranch and CurrentRemote
  • Moved fields that contain information about the current state from RepositoryManager to Repository
  • Refactored names of methods and events on RepositoryManager to reflect the concept of "Updates"
  • Refactored names of events on Repository to reflect the concept of "Changes"
  • Removed RepositoryManagerTests unit tests as they were disabled and getting out of date
  • Removed code that checks the state of the Repository in integration tests RepositoryManagerTests
  • Added initial RepositoryTests

Depends on:

Copy link
Contributor Author

@StanleyGoldman StanleyGoldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documenting changes of Active to Current

Copy link
Contributor Author

@StanleyGoldman StanleyGoldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explaining the crux of these changes

@StanleyGoldman StanleyGoldman force-pushed the fixes/repository-refactor branch from a9f7492 to 3e940a6 Compare September 15, 2017 14:17
@StanleyGoldman StanleyGoldman force-pushed the fixes/repository-refactor branch from 3e940a6 to 45a0150 Compare September 15, 2017 14:17
Copy link
Contributor Author

@StanleyGoldman StanleyGoldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documenting some simpler function moves


private Action<string> Repository_OnCurrentBranchChanged()
{
return s => Refresh();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't call Refresh directly here, this is triggered from a different thread, you need to shuffle it off to the UI thread.

{
base.OnEnable();
AttachHandlers(Repository);
UpdateLog();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be updating the log here, this gets called every time Unity goes into play mode. The history view should only be loading the log if there's nothing in it, otherwise it should listen for a log update event from the repository and updating the UI only then.

@shana shana merged commit c977479 into master Oct 17, 2017
@StanleyGoldman StanleyGoldman deleted the fixes/repository-refactor branch October 17, 2017 19:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants