{"action":"created","comment":{"url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/comments/89003107","pull_request_review_id":9557030,"id":89003107,"diff_hunk":"@@ -179,6 +200,39 @@ FSTree.defaultIsEqual = function defaultIsEqual(entryA, entryB) {\n   return equal;\n };\n \n+FSTree.applyPatch = function(input, output, patch, _delegate) {\n+  var delegate = assign({}, DEFAULT_DELEGATE, _delegate);\n+  for (var i = 0; i < patch.length; i++) {\n+    applyOperation(input, output, patch[i], delegate);\n+  }\n+};\n+\n+function applyOperation(input, output, operation, delegate) {\n+  var method = operation[0];\n+  var relativePath = operation[1];\n+  var inputPath = path.join(input, relativePath);\n+  var outputPath = path.join(output, relativePath);\n+\n+  if (delegate[method]) {\n+    delegate[method](inputPath, outputPath, relativePath);\n+  } else {\n+    throw new Error('Unknown patch operation method: ' + method);\n+  }\n+}\n+\n+function copy(sourcePath, outputPath) {\n+  var outputDir = path.dirname(outputPath);\n+  try {\n+    symlinkOrCopy.sync(sourcePath, outputPath);\n+  } catch (e) {\n+    try {","path":"lib/index.js","position":63,"original_position":63,"commit_id":"a7725c608195f6ac00a8e9c6a34c805b14e9d505","original_commit_id":"a7725c608195f6ac00a8e9c6a34c805b14e9d505","user":{"login":"hjdivad","id":17980,"avatar_url":"https://avatars.githubusercontent.com/u/17980?v=3","gravatar_id":"","url":"https://api.github.com/users/hjdivad","html_url":"https://github.com/hjdivad","followers_url":"https://api.github.com/users/hjdivad/followers","following_url":"https://api.github.com/users/hjdivad/following{/other_user}","gists_url":"https://api.github.com/users/hjdivad/gists{/gist_id}","starred_url":"https://api.github.com/users/hjdivad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjdivad/subscriptions","organizations_url":"https://api.github.com/users/hjdivad/orgs","repos_url":"https://api.github.com/users/hjdivad/repos","events_url":"https://api.github.com/users/hjdivad/events{/privacy}","received_events_url":"https://api.github.com/users/hjdivad/received_events","type":"User","site_admin":false},"body":"@trentmwillis any objections to getting rid of the exception swallowing per ^?","created_at":"2016-11-21T22:25:23Z","updated_at":"2016-11-21T22:25:23Z","html_url":"https://github.com/stefanpenner/fs-tree-diff/pull/40#discussion_r89003107","pull_request_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/comments/89003107"},"html":{"href":"https://github.com/stefanpenner/fs-tree-diff/pull/40#discussion_r89003107"},"pull_request":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40","id":94455720,"html_url":"https://github.com/stefanpenner/fs-tree-diff/pull/40","diff_url":"https://github.com/stefanpenner/fs-tree-diff/pull/40.diff","patch_url":"https://github.com/stefanpenner/fs-tree-diff/pull/40.patch","issue_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/40","number":40,"state":"open","locked":false,"title":"Add applyPatch function","user":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"body":"As mentioned super briefly yesterday, adding a function to make it easier to apply patches returned from `calculatePatch`. You would provide a patch and the source directory as well as an output directory.\r\n\r\n","created_at":"2016-11-18T23:33:20Z","updated_at":"2016-11-21T22:25:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1198b3e72695553aa3be81bb935ec6fbd9dfcec7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40/commits","review_comments_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40/comments","review_comment_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/40/comments","statuses_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/statuses/a7725c608195f6ac00a8e9c6a34c805b14e9d505","head":{"label":"trentmwillis:apply-patch","ref":"apply-patch","sha":"a7725c608195f6ac00a8e9c6a34c805b14e9d505","user":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"repo":{"id":74173776,"name":"fs-tree-diff","full_name":"trentmwillis/fs-tree-diff","owner":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trentmwillis/fs-tree-diff","description":null,"fork":true,"url":"https://api.github.com/repos/trentmwillis/fs-tree-diff","forks_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/forks","keys_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/teams","hooks_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/hooks","issue_events_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/issues/events{/number}","events_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/events","assignees_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/assignees{/user}","branches_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/branches{/branch}","tags_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/tags","blobs_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/git/refs{/sha}","trees_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/statuses/{sha}","languages_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/languages","stargazers_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/stargazers","contributors_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/contributors","subscribers_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/subscribers","subscription_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/subscription","commits_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/commits{/sha}","git_commits_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/git/commits{/sha}","comments_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/comments{/number}","issue_comment_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/issues/comments{/number}","contents_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/contents/{+path}","compare_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/merges","archive_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/downloads","issues_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/issues{/number}","pulls_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/pulls{/number}","milestones_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/milestones{/number}","notifications_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/labels{/name}","releases_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/releases{/id}","deployments_url":"https://api.github.com/repos/trentmwillis/fs-tree-diff/deployments","created_at":"2016-11-18T23:12:43Z","updated_at":"2016-11-18T23:12:44Z","pushed_at":"2016-11-21T19:38:15Z","git_url":"git://github.com/trentmwillis/fs-tree-diff.git","ssh_url":"git@github.com:trentmwillis/fs-tree-diff.git","clone_url":"https://github.com/trentmwillis/fs-tree-diff.git","svn_url":"https://github.com/trentmwillis/fs-tree-diff","homepage":null,"size":127,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stefanpenner:master","ref":"master","sha":"d74a3cf875b696d039425038f82f0987062cd90e","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"repo":{"id":43385153,"name":"fs-tree-diff","full_name":"stefanpenner/fs-tree-diff","owner":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanpenner/fs-tree-diff","description":null,"fork":false,"url":"https://api.github.com/repos/stefanpenner/fs-tree-diff","forks_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/forks","keys_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/teams","hooks_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/hooks","issue_events_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/events{/number}","events_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/events","assignees_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/assignees{/user}","branches_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/branches{/branch}","tags_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/tags","blobs_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/languages","stargazers_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/stargazers","contributors_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/contributors","subscribers_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/subscribers","subscription_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/subscription","commits_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/contents/{+path}","compare_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/merges","archive_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/downloads","issues_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues{/number}","pulls_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/labels{/name}","releases_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/releases{/id}","deployments_url":"https://api.github.com/repos/stefanpenner/fs-tree-diff/deployments","created_at":"2015-09-29T18:07:20Z","updated_at":"2016-11-17T16:17:02Z","pushed_at":"2016-11-21T19:38:15Z","git_url":"git://github.com/stefanpenner/fs-tree-diff.git","ssh_url":"git@github.com:stefanpenner/fs-tree-diff.git","clone_url":"https://github.com/stefanpenner/fs-tree-diff.git","svn_url":"https://github.com/stefanpenner/fs-tree-diff","homepage":null,"size":135,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40"},"html":{"href":"https://github.com/stefanpenner/fs-tree-diff/pull/40"},"issue":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/40"},"comments":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/stefanpenner/fs-tree-diff/statuses/a7725c608195f6ac00a8e9c6a34c805b14e9d505"}}}}
{"actor":{"display_login":"hjdivad"}}