{"action":"closed","issue":{"url":"https://api.github.com/repos/mattsawyer77/atom-perforce/issues/26","labels_url":"https://api.github.com/repos/mattsawyer77/atom-perforce/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/mattsawyer77/atom-perforce/issues/26/comments","events_url":"https://api.github.com/repos/mattsawyer77/atom-perforce/issues/26/events","html_url":"https://github.com/mattsawyer77/atom-perforce/issues/26","id":98733613,"number":26,"title":"Reverting a file whilst open causes the file to not subsequently check out","user":{"login":"toeryn","id":13624296,"avatar_url":"https://avatars.githubusercontent.com/u/13624296?v=3","gravatar_id":"","url":"https://api.github.com/users/toeryn","html_url":"https://github.com/toeryn","followers_url":"https://api.github.com/users/toeryn/followers","following_url":"https://api.github.com/users/toeryn/following{/other_user}","gists_url":"https://api.github.com/users/toeryn/gists{/gist_id}","starred_url":"https://api.github.com/users/toeryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toeryn/subscriptions","organizations_url":"https://api.github.com/users/toeryn/orgs","repos_url":"https://api.github.com/users/toeryn/repos","events_url":"https://api.github.com/users/toeryn/events{/privacy}","received_events_url":"https://api.github.com/users/toeryn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mattsawyer77/atom-perforce/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"mattsawyer77","id":236582,"avatar_url":"https://avatars.githubusercontent.com/u/236582?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsawyer77","html_url":"https://github.com/mattsawyer77","followers_url":"https://api.github.com/users/mattsawyer77/followers","following_url":"https://api.github.com/users/mattsawyer77/following{/other_user}","gists_url":"https://api.github.com/users/mattsawyer77/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsawyer77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsawyer77/subscriptions","organizations_url":"https://api.github.com/users/mattsawyer77/orgs","repos_url":"https://api.github.com/users/mattsawyer77/repos","events_url":"https://api.github.com/users/mattsawyer77/events{/privacy}","received_events_url":"https://api.github.com/users/mattsawyer77/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-08-03T12:30:32Z","updated_at":"2015-11-08T19:55:55Z","closed_at":"2015-11-08T19:55:55Z","body":"\r\n## Steps\r\n\r\n* Open a file\r\n* Make changes \r\n* atom-perforce automatically checks out the file\r\n* Save changes\r\n* Open command panel and revert file\r\n* File updates to reflect reverted changes\r\n* Make more changes \r\n\r\n### Expected Behaviour\r\n* File checks out\r\n\r\n### Actual Behaviour\r\n* Nothing happens and on save you get a can not override warning\r\n\r\n## Investigation\r\nThe issue is caused in the editor.buffer.onDidChange callback in main.js, the watcher is unregistered as the assumption is made that once the file is checked out there will be no need to do so again.\r\n\r\nHowever in this circumstance the file is reverted.\r\n\r\n## Possible Solution\r\nDo not remove the listener, but check if the file is already checked out before attempting to check it out again ?\r\n"}}