Add three enhancements to the pending changes view when merging...
- If a pending merge results in no actual file changes, it doesn't seem possible to back out of the merge if it's not the desired result: the merge link can't be undone without at least one change to a file in the pending merge.
I got into this situation doing a sophisticated merge; a directory in the source branch had been deleted, but a new file has been added on the source branch in that directory that I wanted to merge over into a different location on the target branch.
I chose the merge conflict resolution of preserving the delete for the directory (I had forgotten about the new file) - once I realized my mistake, I couldn't back out of the pending merge.
I tried forcing an undo by shelving and undoing via the shelve - this led to an internal of-by-one indexing error in Plastic.
I also tried switching my workspace to another changeset, hoping that might break the merge link - but Plastic moves the merge link to the new changeset (which is actually the right thing to do).
I also tried committing the pending merge to a new branch with the intention of deleting the branch and thus losing the merge changeset - but this was blocked by Plastic.
In the end I had to destroy the workspace and start a new one - this wasn't that big a problem, as I had no changed files, but is inconvenient.
So it would be good to extend the undo functionality to remove a pending merge link in the absence of file or directory changes.
- I managed to make a poor commit when I made another merge, which went ahead automatically, but had to do some manual edits in the changeset to get my project to build properly - this was not the fault of the merge, simply a case of extra steps being necessary to get a correctly working result. Plastic doesn't monitor externally-made changes in the workspace when one works in the Plastic GUI, so I didn't see some files that had changed due to reconfiguring the NuGet dependencies in my Visual Studio solution. As a result I committed, it which point the GUI updated and showed me the additional changed files that should have been in the commit in the first place. The end result was a broken commit followed by a 'patch-up' commit. Not the end of the world, but messy.
Add an internal pre-commit check in Plastic that re-scans the workspace, popping-up a warning if new pending changes are detected that are not in the commit (or even if the files in the commit have changed from the deltas that Plastic thinks it had at the start of the commit). The workspace view would update before the pop-up, rather than wait until after the commit.
I know that continuous pro-active scanning of the workspace is not something you guys wish to consider, and that makes sense to me - this is just a one-off done as a built-in pre-commit hook.
- Sometimes it's handy to reject changed files individually when doing a merge that has proceeded automatically without conflicts. At the moment I can't do this, because attempting to undo the changes on a single file makes Plastic want to delete the merge link. This makes sense 98% of the time, but would it be possible to tell Plastic when it has successfully merged but has not yet committed to simply through away the changes on a merged file while still keeping the merge link? This is an extreme edge case of when one performs a merge, but needs to 'massage' the resulting files in the pending merge state prior to committing.
Add a retrospective 'choose source or destination' option in the pending changes view when it is showing a pending merge.
Thanks for the detailed explanation Gerard.