AnkhSVN2019 icon indicating copy to clipboard operation
AnkhSVN2019 copied to clipboard

Pending changes window sometimes not showing all modified files

Open JFreyberger opened this issue 4 years ago • 12 comments

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

JFreyberger avatar Apr 28 '20 17:04 JFreyberger

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

IXOFIXOF avatar May 05 '20 07:05 IXOFIXOF

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.

Anton-Nikishkin avatar May 08 '20 12:05 Anton-Nikishkin

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)

jeholsa avatar Jun 18 '20 06:06 jeholsa

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 avatar Jul 12 '20 07:07 PhilJollans

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

PhilJollans avatar Jul 12 '20 07:07 PhilJollans

image

noobwu avatar Aug 27 '20 01:08 noobwu

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 avatar Apr 10 '21 08:04 PhilJollans

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 <ClCompile Include="Tasks\g5_JobTaskNode_STORMAcq.cpp" /> 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 avatar Jul 26 '21 13:07 blazicekj

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

blazicekj avatar Jul 26 '21 13:07 blazicekj

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.

blazicekj avatar Jul 27 '21 06:07 blazicekj

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

jeholsa avatar Sep 02 '21 13:09 jeholsa

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

blazicekj avatar Sep 03 '21 05:09 blazicekj