Bug 3173 - Deleting a directory from the project does not reflect immediately
Summary: Deleting a directory from the project does not reflect immediately
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-01 09:00 UTC by Alan McGovern
Modified: 2015-07-31 10:16 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alan McGovern 2012-02-01 09:00:16 UTC
If a directory is right clicked and deleted from a project under version control, it does not vanish from the solution pane immediately.
Comment 1 Alan McGovern 2012-02-01 09:38:02 UTC
This was an issue only when using the 'Add existing directory' command which failed to create a ProjectFile for the directory itself which resulted in this inconsistent state. Fixed in git master.
Comment 2 Mikayla Hutchinson [MSFT] 2012-02-01 11:24:16 UTC
Are you sure this fix is correct? There is no requirement for a directory to have a ProjectFile - if the files within it are in the project, then the directory is implicit. In general, ProjectFiles for directories are only created when a new directory is created, a directory is added but the files within it are not, or when the last file is removed from a directory.
Comment 3 Alan McGovern 2012-02-01 11:31:48 UTC
The code executed when a directory was deleted was checking for the existence of the corresponding ProjectFile and then removing it if it existed, so it appeared like the bug was simply that the 'else' was mismatched in this statement:

https://github.com/mono/monodevelop/commit/3610ff42d544946b689a4315562c4cde99341408

as the code added a ProjectFile for the new directory only if there was already a ProjectFile for the directory in the solution.

If the actual issue is simply that the treeview has not refreshed properly to clear out the stale empty directory then i can revert that fix and work on making the treeview refresh correctly when an implicit directory vanishes.
Comment 4 Mikayla Hutchinson [MSFT] 2012-02-01 12:34:19 UTC
It looks like you fixed a problem, just not the problem you thought you were fixing :)

The if definitely looks like it was mismatched, I guess that code was intended to always add a ProjectFile for the directory even when the user chose not to actually import any files? Though TBH that would have made more sense to do later if the dialog returned Ok but had no selected files.