{"action":"created","comment":{"url":"https://api.github.com/repos/enthought/sat-solver/pulls/comments/52307001","id":52307001,"diff_hunk":"@@ -73,6 +78,44 @@ def to_simple_string(self):\n \n         return \"\\n\".join(lines)\n \n+    def install(self, package):\n+        self.pretty_operations.append(InstallOperation(package))\n+\n+    def remove(self, package):\n+        self.pretty_operations.append(RemoveOperation(package))\n+\n+    def update(self, from_package, to_package):\n+        operation = UpdateOperation(to_package, from_package)\n+        self.pretty_operations.append(operation)\n+\n+    def _safe_operations(self, pool, decisions, installed_map):\n+        graph = package_lit_dependency_graph(pool, decisions, closed=True)\n+        removals = []\n+        installs = []\n+        operations = []\n+\n+        # This builds from the bottom (no dependencies) up\n+        for group in toposort(graph):\n+            # Sort the set of independent packages for determinism\n+            for package_id in sorted(group):\n+                assert package_id in decisions\n+                if package_id < 0 and -package_id in installed_map:\n+                    removals.append(-package_id)\n+                elif package_id > 0 and package_id not in installed_map:\n+                    installs.append(package_id)\n+\n+        # Removals should happen top down","path":"simplesat/transaction.py","position":63,"original_position":63,"commit_id":"4d26685eb2e71af0be1477c9fe5d3c85a408e4f6","original_commit_id":"4d26685eb2e71af0be1477c9fe5d3c85a408e4f6","user":{"login":"cournape","id":25111,"avatar_url":"https://avatars.githubusercontent.com/u/25111?v=3","gravatar_id":"","url":"https://api.github.com/users/cournape","html_url":"https://github.com/cournape","followers_url":"https://api.github.com/users/cournape/followers","following_url":"https://api.github.com/users/cournape/following{/other_user}","gists_url":"https://api.github.com/users/cournape/gists{/gist_id}","starred_url":"https://api.github.com/users/cournape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cournape/subscriptions","organizations_url":"https://api.github.com/users/cournape/orgs","repos_url":"https://api.github.com/users/cournape/repos","events_url":"https://api.github.com/users/cournape/events{/privacy}","received_events_url":"https://api.github.com/users/cournape/received_events","type":"User","site_admin":false},"body":"Can we have some explicit unit test for this feature ?","created_at":"2016-02-09T13:32:34Z","updated_at":"2016-02-09T13:32:34Z","html_url":"https://github.com/enthought/sat-solver/pull/123#discussion_r52307001","pull_request_url":"https://api.github.com/repos/enthought/sat-solver/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/comments/52307001"},"html":{"href":"https://github.com/enthought/sat-solver/pull/123#discussion_r52307001"},"pull_request":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/enthought/sat-solver/pulls/123","id":56718469,"html_url":"https://github.com/enthought/sat-solver/pull/123","diff_url":"https://github.com/enthought/sat-solver/pull/123.diff","patch_url":"https://github.com/enthought/sat-solver/pull/123.patch","issue_url":"https://api.github.com/repos/enthought/sat-solver/issues/123","number":123,"state":"open","locked":false,"title":"[WIP] Add support for explicit package conflicts.","user":{"login":"johntyree","id":108972,"avatar_url":"https://avatars.githubusercontent.com/u/108972?v=3","gravatar_id":"","url":"https://api.github.com/users/johntyree","html_url":"https://github.com/johntyree","followers_url":"https://api.github.com/users/johntyree/followers","following_url":"https://api.github.com/users/johntyree/following{/other_user}","gists_url":"https://api.github.com/users/johntyree/gists{/gist_id}","starred_url":"https://api.github.com/users/johntyree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johntyree/subscriptions","organizations_url":"https://api.github.com/users/johntyree/orgs","repos_url":"https://api.github.com/users/johntyree/repos","events_url":"https://api.github.com/users/johntyree/events{/privacy}","received_events_url":"https://api.github.com/users/johntyree/received_events","type":"User","site_admin":false},"body":"This adds explicit package conflicts to scenario files and rule generation. :dancer:\r\n\r\nThe format is just as with dependencies and it fully supports inequalities, e.g.\r\n\r\n```\r\nbrowsey 1.2.0-3;\r\n    depends (click >= 1.1);\r\n    conflicts (click <= 2.0, click > 1.3, zope ^= 0.19.3)\r\n```\r\n\r\nIt includes unit tests and a test scenario file. If there's another conflicting scenario that should be included in here, please share it.\r\n\r\n@cournape","created_at":"2016-01-21T08:34:38Z","updated_at":"2016-02-09T13:32:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9a29714fec6e024026c2736cf705e3fd2d05cbe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enthought/sat-solver/pulls/123/commits","review_comments_url":"https://api.github.com/repos/enthought/sat-solver/pulls/123/comments","review_comment_url":"https://api.github.com/repos/enthought/sat-solver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enthought/sat-solver/issues/123/comments","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/4d26685eb2e71af0be1477c9fe5d3c85a408e4f6","head":{"label":"enthought:enh/conflicts","ref":"enh/conflicts","sha":"4d26685eb2e71af0be1477c9fe5d3c85a408e4f6","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":27783212,"name":"sat-solver","full_name":"enthought/sat-solver","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/sat-solver","description":"SAT solver for use in Enstaller, based on the MiniSat implementation","fork":false,"url":"https://api.github.com/repos/enthought/sat-solver","forks_url":"https://api.github.com/repos/enthought/sat-solver/forks","keys_url":"https://api.github.com/repos/enthought/sat-solver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/sat-solver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/sat-solver/teams","hooks_url":"https://api.github.com/repos/enthought/sat-solver/hooks","issue_events_url":"https://api.github.com/repos/enthought/sat-solver/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/sat-solver/events","assignees_url":"https://api.github.com/repos/enthought/sat-solver/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/sat-solver/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/sat-solver/tags","blobs_url":"https://api.github.com/repos/enthought/sat-solver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/sat-solver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/sat-solver/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/sat-solver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/sat-solver/languages","stargazers_url":"https://api.github.com/repos/enthought/sat-solver/stargazers","contributors_url":"https://api.github.com/repos/enthought/sat-solver/contributors","subscribers_url":"https://api.github.com/repos/enthought/sat-solver/subscribers","subscription_url":"https://api.github.com/repos/enthought/sat-solver/subscription","commits_url":"https://api.github.com/repos/enthought/sat-solver/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/sat-solver/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/sat-solver/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/sat-solver/issues/comments{/number}","contents_url":"https://api.github.com/repos/enthought/sat-solver/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/sat-solver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/sat-solver/merges","archive_url":"https://api.github.com/repos/enthought/sat-solver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/sat-solver/downloads","issues_url":"https://api.github.com/repos/enthought/sat-solver/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/sat-solver/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/sat-solver/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/sat-solver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/sat-solver/labels{/name}","releases_url":"https://api.github.com/repos/enthought/sat-solver/releases{/id}","deployments_url":"https://api.github.com/repos/enthought/sat-solver/deployments","created_at":"2014-12-09T19:31:39Z","updated_at":"2016-01-13T07:34:16Z","pushed_at":"2016-02-05T20:36:00Z","git_url":"git://github.com/enthought/sat-solver.git","ssh_url":"git@github.com:enthought/sat-solver.git","clone_url":"https://github.com/enthought/sat-solver.git","svn_url":"https://github.com/enthought/sat-solver","homepage":"","size":807,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":3,"default_branch":"master"}},"base":{"label":"enthought:master","ref":"master","sha":"c493a601f8f9a9a64f344b789213c17147d16351","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":27783212,"name":"sat-solver","full_name":"enthought/sat-solver","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/sat-solver","description":"SAT solver for use in Enstaller, based on the MiniSat implementation","fork":false,"url":"https://api.github.com/repos/enthought/sat-solver","forks_url":"https://api.github.com/repos/enthought/sat-solver/forks","keys_url":"https://api.github.com/repos/enthought/sat-solver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/sat-solver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/sat-solver/teams","hooks_url":"https://api.github.com/repos/enthought/sat-solver/hooks","issue_events_url":"https://api.github.com/repos/enthought/sat-solver/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/sat-solver/events","assignees_url":"https://api.github.com/repos/enthought/sat-solver/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/sat-solver/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/sat-solver/tags","blobs_url":"https://api.github.com/repos/enthought/sat-solver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/sat-solver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/sat-solver/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/sat-solver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/sat-solver/languages","stargazers_url":"https://api.github.com/repos/enthought/sat-solver/stargazers","contributors_url":"https://api.github.com/repos/enthought/sat-solver/contributors","subscribers_url":"https://api.github.com/repos/enthought/sat-solver/subscribers","subscription_url":"https://api.github.com/repos/enthought/sat-solver/subscription","commits_url":"https://api.github.com/repos/enthought/sat-solver/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/sat-solver/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/sat-solver/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/sat-solver/issues/comments{/number}","contents_url":"https://api.github.com/repos/enthought/sat-solver/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/sat-solver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/sat-solver/merges","archive_url":"https://api.github.com/repos/enthought/sat-solver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/sat-solver/downloads","issues_url":"https://api.github.com/repos/enthought/sat-solver/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/sat-solver/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/sat-solver/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/sat-solver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/sat-solver/labels{/name}","releases_url":"https://api.github.com/repos/enthought/sat-solver/releases{/id}","deployments_url":"https://api.github.com/repos/enthought/sat-solver/deployments","created_at":"2014-12-09T19:31:39Z","updated_at":"2016-01-13T07:34:16Z","pushed_at":"2016-02-05T20:36:00Z","git_url":"git://github.com/enthought/sat-solver.git","ssh_url":"git@github.com:enthought/sat-solver.git","clone_url":"https://github.com/enthought/sat-solver.git","svn_url":"https://github.com/enthought/sat-solver","homepage":"","size":807,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/123"},"html":{"href":"https://github.com/enthought/sat-solver/pull/123"},"issue":{"href":"https://api.github.com/repos/enthought/sat-solver/issues/123"},"comments":{"href":"https://api.github.com/repos/enthought/sat-solver/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/enthought/sat-solver/statuses/4d26685eb2e71af0be1477c9fe5d3c85a408e4f6"}}}}