Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Notify PullRequestSessionManager when branch changes #1409

Closed
wants to merge 4 commits into from

Conversation

jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Jan 5, 2018

  • The PullRequestSessionManager needs to be notified when a branch changes.
  • ITeamExplorerServiceHolder only fires when moving to a new repo.
  • IVSGitExt.ActiveRepositoriesChanged also fires when a branch changes.

I've changed PullRequestSessionManager to use a new ITeamExplorerContext service rather than ITeamExplorerServiceHolder. TeamExplorerContext simple facade on top of IVSGitExt and ITeamExplorerServiceHolder.

It notifies of any change to the active repository using the StatusChanged event and exposes an up to date ILocalRepositoryModel via GetActiveRepository.

Ultimately it would be nice if ActiveRepository was a property and the LocalRepositoryModel was updated rather than recreated when its status changes.

This PR is simply intended to unblock #1396. I'm reluctant to attempt any more radical refactoring without @shana's input.

Fixes #1408

We need to be notified when a branch changes.
ITeamExplorerServiceHolder only fires when moving to a new repo.
IVSGitExt.ActiveRepositoriesChanged also fires when a branch changes.
TeamExplorerContext uses IVSGitExt and ITeamExplorerServiceHolder to expose all status change events.
Delegate `ActiveRepository` property to `ITeamExplorerServiceHolder.ActiveRepo`.
@jcansdale
Copy link
Collaborator Author

Came across this one while testing:

image

repository.CloneUrl can be null. Strange. 😕

return repository.CloneUrl.ToRepositoryUrl() == pullRequest.Head.RepositoryCloneUrl.ToRepositoryUrl();

TeamExplorerContext is now a simple wrapper on top TeamExplorerServiceHolder that exposes events.
@jcansdale
Copy link
Collaborator Author

jcansdale commented Jan 11, 2018

I seem to be breaking more than I'm fixing with this PR. I'm going to bail and bring in team members who understand ITeamExplorerServiceHolder and PullRequestSessionManager better!

//cc @shana @grokys

@jcansdale jcansdale closed this Jan 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant