{"action":"created","comment":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/116725120","pull_request_review_id":38367412,"id":116725120,"diff_hunk":"@@ -0,0 +1,234 @@\n+/**\n+ * This file is part of the CernVM File System.\n+ */\n+\n+#include \"catalog_merge_tool.h\"\n+\n+#include \"catalog.h\"\n+#include \"hash.h\"\n+#include \"logging.h\"\n+#include \"manifest.h\"\n+#include \"options.h\"\n+#include \"upload.h\"\n+#include \"util/posix.h\"\n+\n+namespace {\n+\n+PathString MakeRelative(const PathString& path) {\n+  std::string rel_path;\n+  std::string abs_path = path.ToString();\n+  if (abs_path[0] == '/') {\n+    rel_path = abs_path.substr(1);\n+  } else {\n+    rel_path = abs_path;\n+  }\n+  return PathString(rel_path);\n+}\n+\n+}  // namespace\n+\n+namespace receiver {\n+\n+CatalogMergeTool::ChangeItem::ChangeItem(ChangeType type,\n+                                         const PathString& path,\n+                                         const catalog::DirectoryEntry& entry1)\n+    : type_(type),\n+      path_(path),\n+      xattrs_(),\n+      entry1_(new catalog::DirectoryEntry(entry1)),\n+      entry2_(NULL) {}\n+\n+CatalogMergeTool::ChangeItem::ChangeItem(ChangeType type,\n+                                         const PathString& path,\n+                                         const catalog::DirectoryEntry& entry1,\n+                                         const XattrList& xattrs)\n+    : type_(type),\n+      path_(path),\n+      xattrs_(xattrs),\n+      entry1_(new catalog::DirectoryEntry(entry1)),\n+      entry2_(NULL) {}\n+\n+CatalogMergeTool::ChangeItem::ChangeItem(ChangeType type,\n+                                         const PathString& path,\n+                                         const catalog::DirectoryEntry& entry1,\n+                                         const catalog::DirectoryEntry& entry2)\n+    : type_(type),\n+      path_(path),\n+      xattrs_(),\n+      entry1_(new catalog::DirectoryEntry(entry1)),\n+      entry2_(new catalog::DirectoryEntry(entry2)) {}\n+\n+CatalogMergeTool::ChangeItem::ChangeItem(const ChangeItem& other)\n+    : type_(other.type_),\n+      path_(other.path_),\n+      xattrs_(other.xattrs_),\n+      entry1_(new catalog::DirectoryEntry(*(other.entry1_))),\n+      entry2_(other.entry2_ ? new catalog::DirectoryEntry(*(other.entry2_))\n+                            : NULL) {}\n+\n+CatalogMergeTool::ChangeItem::~ChangeItem() {\n+  if (entry1_) {\n+    delete entry1_;\n+    entry1_ = NULL;","path":"cvmfs/receiver/catalog_merge_tool.cc","position":72,"original_position":72,"commit_id":"c723166e13139a155f4056597d14ba8966ad4979","original_commit_id":"e1aed62f4468272b26fb3c95f470ef9f8c4556ef","user":{"login":"radupopescu","id":528669,"avatar_url":"https://avatars1.githubusercontent.com/u/528669?v=3","gravatar_id":"","url":"https://api.github.com/users/radupopescu","html_url":"https://github.com/radupopescu","followers_url":"https://api.github.com/users/radupopescu/followers","following_url":"https://api.github.com/users/radupopescu/following{/other_user}","gists_url":"https://api.github.com/users/radupopescu/gists{/gist_id}","starred_url":"https://api.github.com/users/radupopescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radupopescu/subscriptions","organizations_url":"https://api.github.com/users/radupopescu/orgs","repos_url":"https://api.github.com/users/radupopescu/repos","events_url":"https://api.github.com/users/radupopescu/events{/privacy}","received_events_url":"https://api.github.com/users/radupopescu/received_events","type":"User","site_admin":false},"body":"I think this is necessary. Instances of `ChangeItem` are supposed to go into a `std::vector` so I can't use `UniquePtr` inside them. I'm using raw pointers since `entry2_` can be NULL.","created_at":"2017-05-16T12:12:54Z","updated_at":"2017-05-16T12:12:54Z","html_url":"https://github.com/cvmfs/cvmfs/pull/1861#discussion_r116725120","pull_request_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861","_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/116725120"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/1861#discussion_r116725120"},"pull_request":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861"}}},"pull_request":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861","id":120283093,"html_url":"https://github.com/cvmfs/cvmfs/pull/1861","diff_url":"https://github.com/cvmfs/cvmfs/pull/1861.diff","patch_url":"https://github.com/cvmfs/cvmfs/pull/1861.patch","issue_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/1861","number":1861,"state":"open","locked":false,"title":"CVM-1195","user":{"login":"radupopescu","id":528669,"avatar_url":"https://avatars1.githubusercontent.com/u/528669?v=3","gravatar_id":"","url":"https://api.github.com/users/radupopescu","html_url":"https://github.com/radupopescu","followers_url":"https://api.github.com/users/radupopescu/followers","following_url":"https://api.github.com/users/radupopescu/following{/other_user}","gists_url":"https://api.github.com/users/radupopescu/gists{/gist_id}","starred_url":"https://api.github.com/users/radupopescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radupopescu/subscriptions","organizations_url":"https://api.github.com/users/radupopescu/orgs","repos_url":"https://api.github.com/users/radupopescu/repos","events_url":"https://api.github.com/users/radupopescu/events{/privacy}","received_events_url":"https://api.github.com/users/radupopescu/received_events","type":"User","site_admin":false},"body":"This PR contains the implementation of the catalog reconciliation logic in the gateway services [CVM-1195](https://sft.its.cern.ch/jira/browse/CVM-1195).\r\n\r\nThis closes the operation \"pipeline\" of the new workflow based on multiple release manager machines and gateway services.","created_at":"2017-05-12T09:29:53Z","updated_at":"2017-05-16T12:12:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17b737922496ddb7e2aa725f06a1e5e76dc54949","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861/commits","review_comments_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861/comments","review_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/1861/comments","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/c723166e13139a155f4056597d14ba8966ad4979","head":{"label":"cvmfs:CVM-1195","ref":"CVM-1195","sha":"c723166e13139a155f4056597d14ba8966ad4979","user":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars3.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"repo":{"id":3784908,"name":"cvmfs","full_name":"cvmfs/cvmfs","owner":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars3.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cvmfs/cvmfs","description":"The CernVM File System","fork":false,"url":"https://api.github.com/repos/cvmfs/cvmfs","forks_url":"https://api.github.com/repos/cvmfs/cvmfs/forks","keys_url":"https://api.github.com/repos/cvmfs/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvmfs/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvmfs/cvmfs/teams","hooks_url":"https://api.github.com/repos/cvmfs/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/cvmfs/cvmfs/events","assignees_url":"https://api.github.com/repos/cvmfs/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/cvmfs/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/cvmfs/cvmfs/tags","blobs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvmfs/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvmfs/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/cvmfs/cvmfs/languages","stargazers_url":"https://api.github.com/repos/cvmfs/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/cvmfs/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/cvmfs/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/cvmfs/cvmfs/subscription","commits_url":"https://api.github.com/repos/cvmfs/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvmfs/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvmfs/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/cvmfs/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvmfs/cvmfs/merges","archive_url":"https://api.github.com/repos/cvmfs/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvmfs/cvmfs/downloads","issues_url":"https://api.github.com/repos/cvmfs/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/cvmfs/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/cvmfs/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvmfs/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/cvmfs/cvmfs/releases{/id}","deployments_url":"https://api.github.com/repos/cvmfs/cvmfs/deployments","created_at":"2012-03-21T09:10:41Z","updated_at":"2017-05-04T14:34:04Z","pushed_at":"2017-05-16T11:35:21Z","git_url":"git://github.com/cvmfs/cvmfs.git","ssh_url":"git@github.com:cvmfs/cvmfs.git","clone_url":"https://github.com/cvmfs/cvmfs.git","svn_url":"https://github.com/cvmfs/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":115873,"stargazers_count":63,"watchers_count":63,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":6,"forks":51,"open_issues":6,"watchers":63,"default_branch":"devel"}},"base":{"label":"cvmfs:devel","ref":"devel","sha":"88230e7cb8a0bb433eee15164e523559fbda8379","user":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars3.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"repo":{"id":3784908,"name":"cvmfs","full_name":"cvmfs/cvmfs","owner":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars3.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cvmfs/cvmfs","description":"The CernVM File System","fork":false,"url":"https://api.github.com/repos/cvmfs/cvmfs","forks_url":"https://api.github.com/repos/cvmfs/cvmfs/forks","keys_url":"https://api.github.com/repos/cvmfs/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvmfs/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvmfs/cvmfs/teams","hooks_url":"https://api.github.com/repos/cvmfs/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/cvmfs/cvmfs/events","assignees_url":"https://api.github.com/repos/cvmfs/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/cvmfs/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/cvmfs/cvmfs/tags","blobs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvmfs/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvmfs/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/cvmfs/cvmfs/languages","stargazers_url":"https://api.github.com/repos/cvmfs/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/cvmfs/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/cvmfs/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/cvmfs/cvmfs/subscription","commits_url":"https://api.github.com/repos/cvmfs/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvmfs/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvmfs/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/cvmfs/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvmfs/cvmfs/merges","archive_url":"https://api.github.com/repos/cvmfs/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvmfs/cvmfs/downloads","issues_url":"https://api.github.com/repos/cvmfs/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/cvmfs/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/cvmfs/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvmfs/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/cvmfs/cvmfs/releases{/id}","deployments_url":"https://api.github.com/repos/cvmfs/cvmfs/deployments","created_at":"2012-03-21T09:10:41Z","updated_at":"2017-05-04T14:34:04Z","pushed_at":"2017-05-16T11:35:21Z","git_url":"git://github.com/cvmfs/cvmfs.git","ssh_url":"git@github.com:cvmfs/cvmfs.git","clone_url":"https://github.com/cvmfs/cvmfs.git","svn_url":"https://github.com/cvmfs/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":115873,"stargazers_count":63,"watchers_count":63,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":6,"forks":51,"open_issues":6,"watchers":63,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/1861"},"issue":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/1861"},"comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/1861/comments"},"review_comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861/comments"},"review_comment":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1861/commits"},"statuses":{"href":"https://api.github.com/repos/cvmfs/cvmfs/statuses/c723166e13139a155f4056597d14ba8966ad4979"}}}}
{"actor":{"display_login":"radupopescu"}}