Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending changes window sometimes not showing all modified files #15

Open
JFreyberger opened this issue Apr 28, 2020 · 12 comments
Open

Pending changes window sometimes not showing all modified files #15

JFreyberger opened this issue Apr 28, 2020 · 12 comments

Comments

@JFreyberger
Copy link

Hi Phil,

first of all a big thank you for continuing AnkhSVN for VS2019. Unfortunately sometimes the pending changes window doesn't list all the modified files. So sometimes a modified file is missing in this list while in the project explorer the icon shows the file is modified and also the Source Control Info window show it as modified. When I restart VS2019 in such a situation the pending changes window is also correct again.

Thanks and again and best regards,
Johannes

@IXOFIXOF
Copy link

IXOFIXOF commented May 5, 2020

Hi Phil, Hi Johannes.
In our company we are improving visual studio 2019 in profesional version, and we also have the same problem as Johannes. We are working with c++ and MFC ( yes, MFC ). I have recognized, that files .vcxproj are correctly filled in Pending Changes after any change. Other files ( .cpp, .h .. ) are filled in Pending Changes after restart VS ( as said Johannes ), or after unload and reload project - then restart VS is no needed.

Regards,
Michal

@Anton-Nikishkin
Copy link

Hi Phil,

Thank you so much for your work on AnkhSVN.
I have the same problems as the commentators above on the Community and Professional versions of VS 2019.

@jeholsa
Copy link

jeholsa commented Jun 18, 2020

I have the same issue in VS 2019 Professional when working on C++ MFC project. It shows some of changes in 'Pending changes', but not all of them. For me re-starting VS2019 doesn't help so much. I have a feeling this was working at the beginning better - so I relied on 'Pending changes' window in January-February 2020. Now have been using TortoiseSVN to commit changes because of this. It can be it's nothing to do with AnkhSVN2019 version, but my project gets somehow 'contaminated' and stops updating 'Pending changes' properly. Now today when tested this again, 'Pending changes' didn't get updated and when pressed the button 'Refresh Pending Changes' it just fired the following error message:

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
at Ankh.UI.PendingChanges.PendingCommitsPage.RefreshList()
at Ankh.UI.PendingChanges.Commands.RefreshPendingChanges.OnExecute(CommandEventArgs e)
at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

@PhilJollans
Copy link
Owner

I have also received this Email report on 4-June-2020 which appears to be identical to the above error:

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.UI.PendingChanges.PendingCommitsPage.RefreshList()
   at Ankh.UI.PendingChanges.Commands.RefreshPendingChanges.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.9.5
os-version=10.0.18363.0
ankh-version=1.0.0.9
sharpsvn-version=1.9005.3940.224
command=RefreshPendingChanges
vs-version=16.0.30114.105

@PhilJollans
Copy link
Owner

And this very similar error report on 13-June-2020

After "refresh status" at solution level just after the creation of the
repository. Thank you

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext( )
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.Commands.UI.RefreshCommand.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.9.5
os-version=10.0.18363.0
ankh-version=1.0.0.9
sharpsvn-version=1.9005.3940.224
command=Refresh
vs-version=16.0.30204.135

@noobwu
Copy link

noobwu commented Aug 27, 2020

image

@PhilJollans
Copy link
Owner

PhilJollans commented Apr 10, 2021

And this one on 13.October.2020

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.UI.PendingChanges.PendingCommitsPage.RefreshList()
   at Ankh.UI.PendingChanges.Commands.RefreshPendingChanges.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.12.0
os-version=10.0.19041.0
ankh-version=1.0.0.12
sharpsvn-version=1.12.0.1
command=RefreshPendingChanges
vs-version=16.0.30413.136

and on 3-November-2020

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.Commands.UI.RefreshCommand.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.12.0
os-version=10.0.18363.0
ankh-version=1.0.0.12
sharpsvn-version=1.12.0.1
command=Refresh
vs-version=16.0.30611.6

and on 27-January-2021

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.UI.PendingChanges.PendingCommitsPage.RefreshList()
   at Ankh.UI.PendingChanges.Commands.RefreshPendingChanges.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.12.0
os-version=6.3.9600.0
ankh-version=1.0.0.12
sharpsvn-version=1.12.0.1
command=RefreshPendingChanges
vs-version=16.0.30907.39

and on 16-March-2021

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Ankh.Scc.OpenDocumentTracker.RefreshDirtyState()
   at Ankh.UI.PendingChanges.PendingCommitsPage.RefreshList()
   at Ankh.UI.PendingChanges.Commands.RefreshPendingChanges.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapItem.OnExecute(CommandEventArgs e)
   at Ankh.Commands.CommandMapper.Execute(AnkhCommand command, CommandEventArgs e)

svn-version=1.12.0
os-version=10.0.18363.0
ankh-version=1.0.0.12
sharpsvn-version=1.12.0.1
command=RefreshPendingChanges
vs-version=16.0.30611.6

PhilJollans added a commit that referenced this issue May 2, 2021
The original post in Issue #15 is about the pending changes not updating correctly.
This change probably does not fix that.

Later posts, initially from jeholsa, but later multiple errors from email reports are an InvalidOperationException in the function RefreshDirtyState().

I think that this change will fix that error.
@blazicekj
Copy link

Hello, since this renders SVN in Visual Studio unusable for us I tried debugging the issue, but I am not able to attach to services codes, so I cannot get to the bottom of this fully, but I still managed to get some useful info.

The problem only affects files that are added under filter in c++ projects. E.g. I have a project g5_plugin_storm_new which contains file g5_JobTaskNode_STORMAcq.cpp. If the file is added directly under g5_plugin_storm_new in solution explorer there is no problem, it is registered with Ankh. When it is added under a filter "g5_plugin_storm_new\Tasks" it is ignored. Real path of the cpp does not seem to matter.

When debugging I came across function
private void ItemRefresh(string file)
where the inProject and inExtra bools are false so it is removed from _pendingChanges.

Same goes for void InnerRefresh() where most such files (not all of them though) are not in the list returned by Mapper.GetAllFilesOfAllProjects().

The file is listed in vcxproj as and loaded without issues and has an entry in vcxproj.filters.

This problem does not seem to affect header files as heavily (or at all) as cpp.

Any ideas?

Thanks,
Jan.

@blazicekj
Copy link

All filtered files are also not listed under ProjectMap in IProjectFileMapper.ContainsPath

@blazicekj
Copy link

Managed to get the services symbols working. Found out that
if (VSErr.Succeeded(hr = sccProject.GetSccFiles(id, str, dw))) called in Ankh.VS.Selection.SelectionUtils never returns files under filters. I am not completely sure if it should be called with a different ID to return these files or if it is a bug. It returns success and no files.

@jeholsa
Copy link

jeholsa commented Sep 2, 2021

I have noticed that when a file doesn't appear on 'Pending Changes' list, it do can be added there by going to tab-header (with the filename on it) right-mouse click and choose 'Subversion'-'Add to Pending Changes'. Files without changes don't have this choice available.
Another strange thing after this is that now when a file luckily is on 'Pending Changes' its 'Project' is displayed as "< none >". But it can now be successfully 'Commit'.

image

image

@blazicekj
Copy link

@jeholsa Very nice catch, this could potentially save us in the end as Microsoft is silent on the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants