{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2528","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2528/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2528/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2528/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/2528","id":118455248,"number":2528,"title":"hg: discard changes without changing the current revision","user":{"login":"jordiecometrica","id":13576896,"avatar_url":"https://avatars.githubusercontent.com/u/13576896?v=3","gravatar_id":"","url":"https://api.github.com/users/jordiecometrica","html_url":"https://github.com/jordiecometrica","followers_url":"https://api.github.com/users/jordiecometrica/followers","following_url":"https://api.github.com/users/jordiecometrica/following{/other_user}","gists_url":"https://api.github.com/users/jordiecometrica/gists{/gist_id}","starred_url":"https://api.github.com/users/jordiecometrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordiecometrica/subscriptions","organizations_url":"https://api.github.com/users/jordiecometrica/orgs","repos_url":"https://api.github.com/users/jordiecometrica/repos","events_url":"https://api.github.com/users/jordiecometrica/events{/privacy}","received_events_url":"https://api.github.com/users/jordiecometrica/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/needs_info","name":"needs_info","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-23T19:34:26Z","updated_at":"2016-01-12T14:28:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/2528","html_url":"https://github.com/ansible/ansible-modules-core/pull/2528","diff_url":"https://github.com/ansible/ansible-modules-core/pull/2528.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/2528.patch"},"body":"hg: discard changes without changing the current revision\r\n\r\nThe command `hg up -C` by default moves to the latest revision on the\r\ncurrent branch. The `discard` function was trying to update to a\r\ndifferent branch, in case it was provided, by passing a `-r REVISION`\r\nargument. Not only is this not the intended effect of the `discard`\r\nfunction, but this also could update to a different branch that hasn't\r\nbeen pulled yet, which is how we were experiencing trouble.\r\n\r\nInstead, we unconditionally do `hg up -C -r .` to \"update\" to the\r\ncurrent revision (i.e. to \".\"), while `-C/--clean`ing the current\r\ndirectory. This is similar to `hg revert --all`, except that it also\r\nundoes the merge state of the working directory, in case there was\r\nany."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/170927042","html_url":"https://github.com/ansible/ansible-modules-core/pull/2528#issuecomment-170927042","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2528","id":170927042,"user":{"login":"jordiecometrica","id":13576896,"avatar_url":"https://avatars.githubusercontent.com/u/13576896?v=3","gravatar_id":"","url":"https://api.github.com/users/jordiecometrica","html_url":"https://github.com/jordiecometrica","followers_url":"https://api.github.com/users/jordiecometrica/followers","following_url":"https://api.github.com/users/jordiecometrica/following{/other_user}","gists_url":"https://api.github.com/users/jordiecometrica/gists{/gist_id}","starred_url":"https://api.github.com/users/jordiecometrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordiecometrica/subscriptions","organizations_url":"https://api.github.com/users/jordiecometrica/orgs","repos_url":"https://api.github.com/users/jordiecometrica/repos","events_url":"https://api.github.com/users/jordiecometrica/events{/privacy}","received_events_url":"https://api.github.com/users/jordiecometrica/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T14:28:32Z","updated_at":"2016-01-12T14:28:32Z","body":"It's a bugfix. The only user-visible change is that if the hg repo's working directory is dirty, it's now possible via `force` to update to a branch that hasn't been pulled yet."}}