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

Show readonly filename decoration after revert that also resets mtime (fix #221014) #221023

Merged
merged 12 commits into from
Jul 29, 2024

Conversation

gjsjohnmurray
Copy link
Contributor

This PR fixes #221014.

A "reserve-before-edit" type of SCM tool can result in a FileSystemProvider stat result with both an earlier mtime and a changed (set) FilePermission.readonly bit in permissions. VS Code was ignoring this, leaving the reverted document editable.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I like this. Two feedback:

  • I think we can also apply the locked property alongside readonly which is for when a file system marked a file as not writeable
  • could we have 2 tests to test this if possible per text file model and stored file working copy?

@bpasero bpasero added this to the On Deck milestone Jul 9, 2024
@gjsjohnmurray
Copy link
Contributor Author

I have added handling for locked and written tests.

@gjsjohnmurray gjsjohnmurray requested a review from bpasero July 15, 2024 12:34
@gjsjohnmurray
Copy link
Contributor Author

Any chance of merging this for July?

@gjsjohnmurray
Copy link
Contributor Author

@bpasero can this be milestoned for August?

@bpasero bpasero modified the milestones: On Deck, August 2024 Jul 27, 2024
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bpasero bpasero closed this Jul 29, 2024
@bpasero bpasero reopened this Jul 29, 2024
@bpasero bpasero merged commit 0c5af5d into microsoft:main Jul 29, 2024
6 checks passed
@gjsjohnmurray gjsjohnmurray deleted the orange-possum branch July 29, 2024 09:08
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 12, 2024
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.

workbench.action.files.revert doesn't update readonly indicator when file mtime becomes earlier
4 participants