diff --git a/tests/phabricator/accept-4564.json b/tests/phabricator/accept-4564.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/accept-4564.json @@ -0,0 +1,141 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:57 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"4564\",\"phid\":\"PHID-DREV-6cgnf5fyeeqhntbxgfb7\",\"title\":\"localrepo: move some vfs initialization out of __init__\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D4564\",\"dateCreated\":\"1536856174\",\"dateModified\":\"1537307962\",\"authorPHID\":\"PHID-USER-p54bpwbifxx7sbgpx47d\",\"status\":\"3\",\"statusName\":\"Closed\",\"properties\":{\"wasAcceptedBeforeClose\":true},\"branch\":null,\"summary\":\"In order to make repository types more dynamic, we'll need to move the\\nlogic for determining repository behavior out of\\nlocalrepository.__init__ so we can influence behavior before the type\\nis instantiated.\\n\\nThis commit starts that process by moving working directory and .hg\\/\\nvfs initialization to our new standalone function for instantiating\\nlocal repositories.\\n\\nAside from API changes, behavior should be fully backwards compatible.\\n\\n.. api::\\n\\n localrepository.__init__ now does less work and accepts new args\\n\\n Use ``hg.repository()``, ``localrepo.instance()``, or\\n ``localrepo.makelocalrepository()`` to obtain a new local repository\\n instance instead of calling the ``localrepository`` constructor\\n directly.\",\"testPlan\":\"\",\"lineCount\":\"64\",\"activeDiffPHID\":\"PHID-DIFF-7m4gug2nq4zt7jwxzqg2\",\"diffs\":[\"11162\",\"11002\"],\"commits\":[\"PHID-CMIT-xknk3j65xkoirmrpelni\"],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\",\"PHID-USER-cgcdlc6c3gpxapbmkwa2\":\"PHID-USER-cgcdlc6c3gpxapbmkwa2\"},\"ccs\":[\"PHID-USER-cgcdlc6c3gpxapbmkwa2\",\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[\"PHID-DREV-gqp33hnxg65vkl3xioka\"]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B4564%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:57 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":\"ERR-CONDUIT-CORE\",\"error_info\":\"Validation errors:\\n - You can not accept this revision because it has already been closed. Only open revisions can be accepted.\"}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "402" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22objectIdentifier%22%3A+%22PHID-DREV-6cgnf5fyeeqhntbxgfb7%22%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22accept%22%2C+%22value%22%3A+true%7D%2C+%7B%22type%22%3A+%22comment%22%2C+%22value%22%3A+%22I+think+I+like+where+this+is+headed.+Will+read+rest+of+series+later.%22%7D%5D%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/accept-7913.json b/tests/phabricator/accept-7913.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/accept-7913.json @@ -0,0 +1,141 @@ +{ + "version": 1, + "interactions": [ + { + "response": { + "status": { + "message": "OK", + "code": 200 + }, + "body": { + "string": "{\"result\":[{\"id\":\"7913\",\"phid\":\"PHID-DREV-s4borg2nl7ay2mskktwq\",\"title\":\"cext: fix compiler warning about sign changing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7913\",\"dateCreated\":\"1579207172\",\"dateModified\":\"1579207173\",\"authorPHID\":\"PHID-USER-5iutahkpkhvnxfimqjbk\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":6,\"lines.removed\":6},\"branch\":\"default\",\"summary\":\"line.len is a Py_ssize_t, and we're casing to size_t (unsigned). On my compiler,\\nthis causes a warning to be emitted:\\n\\n```\\nmercurial\\/cext\\/manifest.c: In function 'pathlen':\\nmercurial\\/cext\\/manifest.c:48:44: warning: operand of ?: changes signedness from 'Py_ssize_t' {aka 'long int'} to 'long unsigned int' due to unsignedness of other operand [-Wsign-compare]\\n return (end) ? (size_t)(end - l-\\u003estart) : l-\\u003elen;\\n ^~~~~~\\n```\",\"testPlan\":\"\",\"lineCount\":\"12\",\"activeDiffPHID\":\"PHID-DIFF-vms2yu54d7di7r332dbs\",\"diffs\":[\"19380\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\"}],\"error_code\":null,\"error_info\":null}" + }, + "headers": { + "content-type": [ + "application/json" + ], + "cache-control": [ + "no-store" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "date": [ + "Fri, 17 Jan 2020 01:03:23 GMT" + ], + "referrer-policy": [ + "no-referrer" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "Deny" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "transfer-encoding": [ + "chunked" + ] + } + }, + "request": { + "body": "output=json&__conduit__=1¶ms=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7913%5D%7D", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "content-length": [ + "146" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+621-e7ba2449a883)" + ], + "host": [ + "phab.mercurial-scm.org" + ], + "accept": [ + "application/mercurial-0.1" + ] + }, + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query" + } + }, + { + "response": { + "status": { + "message": "OK", + "code": 200 + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7913,\"phid\":\"PHID-DREV-s4borg2nl7ay2mskktwq\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-7fwthnytbq3bw2p\"},{\"phid\":\"PHID-XACT-DREV-lno5olcencqrgnh\"},{\"phid\":\"PHID-XACT-DREV-uanndmc3t3onueu\"}]},\"error_code\":null,\"error_info\":null}" + }, + "headers": { + "content-type": [ + "application/json" + ], + "cache-control": [ + "no-store" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "date": [ + "Fri, 17 Jan 2020 01:03:23 GMT" + ], + "referrer-policy": [ + "no-referrer" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "Deny" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "transfer-encoding": [ + "chunked" + ] + } + }, + "request": { + "body": "output=json&__conduit__=1¶ms=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22objectIdentifier%22%3A+%22PHID-DREV-s4borg2nl7ay2mskktwq%22%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22accept%22%2C+%22value%22%3A+true%7D%2C+%7B%22type%22%3A+%22comment%22%2C+%22value%22%3A+%22LGTM%22%7D%5D%7D", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "content-length": [ + "338" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+621-e7ba2449a883)" + ], + "host": [ + "phab.mercurial-scm.org" + ], + "accept": [ + "application/mercurial-0.1" + ] + }, + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit" + } + } + ] +} \ No newline at end of file diff --git a/tests/phabricator/phab-conduit.json b/tests/phabricator/phab-conduit.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phab-conduit.json @@ -0,0 +1,73 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:52 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/user.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "169" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22isBot%22%3A+true%7D%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabread-4480.json b/tests/phabricator/phabread-4480.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabread-4480.json @@ -0,0 +1,209 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:54 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"4480\",\"phid\":\"PHID-DREV-gsa7dkuimmam7nafw7h3\",\"title\":\"exchangev2: start to implement pull with wire protocol v2\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D4480\",\"dateCreated\":\"1536164431\",\"dateModified\":\"1536981352\",\"authorPHID\":\"PHID-USER-p54bpwbifxx7sbgpx47d\",\"status\":\"3\",\"statusName\":\"Closed\",\"properties\":{\"wasAcceptedBeforeClose\":false},\"branch\":null,\"summary\":\"Wire protocol version 2 will take a substantially different\\napproach to exchange than version 1 (at least as far as pulling\\nis concerned).\\n\\nThis commit establishes a new exchangev2 module for holding\\ncode related to exchange using wire protocol v2. I could have\\nadded things to the existing exchange module. But it is already\\nquite big. And doing things inline isn't in question because\\nthe existing code is already littered with conditional code\\nfor various states of support for the existing wire protocol\\nas it evolved over 10+ years. A new module gives us a chance\\nto make a clean break.\\n\\nThis approach does mean we'll end up writing some duplicate\\ncode. And there's a significant chance we'll miss functionality\\nas code is ported. The plan is to eventually add #testcase's\\nto existing tests so the new wire protocol is tested side-by-side\\nwith the existing one. This will hopefully tease out any\\nfeatures that weren't ported properly. But before we get there,\\nwe need to build up support for the new exchange methods.\\n\\nOur journey towards implementing a new exchange begins with pulling.\\nAnd pulling begins with discovery.\\n\\nThe discovery code added to exchangev2 is heavily drawn from\\nthe following functions:\\n\\n* exchange._pulldiscoverychangegroup\\n* discovery.findcommonincoming\\n\\nFor now, we build on top of existing discovery mechanisms. The\\nnew wire protocol should be capable of doing things more efficiently.\\nBut I'd rather defer on this problem.\\n\\nTo foster the transition, we invent a fake capability on the HTTPv2\\npeer and have the main pull code in exchange.py call into exchangev2\\nwhen the new wire protocol is being used.\",\"testPlan\":\"\",\"lineCount\":\"145\",\"activeDiffPHID\":\"PHID-DIFF-kg2rt6kiekgo5rgyeu5n\",\"diffs\":[\"11058\",\"10961\",\"10793\"],\"commits\":[\"PHID-CMIT-kvz2f3rczvi6exmvtyaq\"],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-cgcdlc6c3gpxapbmkwa2\",\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[\"PHID-DREV-a77jfv32jtxfwxngd6bd\"]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B4480%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:55 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"11058\":{\"id\":\"11058\",\"revisionID\":\"4480\",\"dateCreated\":\"1536771503\",\"dateModified\":\"1536981352\",\"sourceControlBaseRevision\":\"a5de21c9e3703f8e8eb064bd7d893ff2f703c66a\",\"sourceControlPath\":null,\"sourceControlSystem\":\"hg\",\"branch\":null,\"bookmark\":null,\"creationMethod\":\"commit\",\"description\":\"rHGa86d21e70b2b79d5e7e1085e5e755b4b26b8676d\",\"unitStatus\":\"6\",\"lintStatus\":\"6\",\"changes\":[{\"id\":\"24371\",\"metadata\":{\"line:first\":59},\"oldPath\":\"tests\\/wireprotohelpers.sh\",\"currentPath\":\"tests\\/wireprotohelpers.sh\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"7\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"58\",\"newLength\":\"65\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\" HTTPV2=exp-http-v2-0001\\n MEDIATYPE=application\\/mercurial-exp-framing-0005\\n \\n sendhttpraw() {\\n hg --verbose debugwireproto --peer raw http:\\/\\/$LOCALIP:$HGPORT\\/\\n }\\n \\n sendhttpv2peer() {\\n hg --verbose debugwireproto --nologhandshake --peer http2 http:\\/\\/$LOCALIP:$HGPORT\\/\\n }\\n \\n sendhttpv2peerhandshake() {\\n hg --verbose debugwireproto --peer http2 http:\\/\\/$LOCALIP:$HGPORT\\/\\n }\\n \\n cat \\u003e dummycommands.py \\u003c\\u003c EOF\\n from mercurial import (\\n wireprototypes,\\n wireprotov1server,\\n wireprotov2server,\\n )\\n \\n @wireprotov1server.wireprotocommand(b'customreadonly', permission=b'pull')\\n def customreadonlyv1(repo, proto):\\n return wireprototypes.bytesresponse(b'customreadonly bytes response')\\n \\n @wireprotov2server.wireprotocommand(b'customreadonly', permission=b'pull')\\n def customreadonlyv2(repo, proto):\\n yield b'customreadonly bytes response'\\n \\n @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push')\\n def customreadwrite(repo, proto):\\n return wireprototypes.bytesresponse(b'customreadwrite bytes response')\\n \\n @wireprotov2server.wireprotocommand(b'customreadwrite', permission=b'push')\\n def customreadwritev2(repo, proto):\\n yield b'customreadwrite bytes response'\\n EOF\\n \\n cat \\u003e\\u003e $HGRCPATH \\u003c\\u003c EOF\\n [extensions]\\n drawdag = $TESTDIR\\/drawdag.py\\n EOF\\n \\n enabledummycommands() {\\n cat \\u003e\\u003e $HGRCPATH \\u003c\\u003c EOF\\n [extensions]\\n dummycommands = $TESTTMP\\/dummycommands.py\\n EOF\\n }\\n \\n enablehttpv2() {\\n cat \\u003e\\u003e $1\\/.hg\\/hgrc \\u003c\\u003c EOF\\n [experimental]\\n web.apiserver = true\\n web.api.http-v2 = true\\n EOF\\n }\\n+\\n+enablehttpv2client() {\\n+ cat \\u003e\\u003e $HGRCPATH \\u003c\\u003c EOF\\n+[experimental]\\n+httppeer.advertise-v2 = true\\n+EOF\\n+}\\n\"}]},{\"id\":\"24370\",\"metadata\":{\"line:first\":1},\"oldPath\":null,\"currentPath\":\"tests\\/test-wireproto-exchangev2.t\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"53\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"53\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+Tests for wire protocol version 2 exchange.\\n+Tests in this file should be folded into existing tests once protocol\\n+v2 has enough features that it can be enabled via #testcase in existing\\n+tests.\\n+\\n+ $ . $TESTDIR\\/wireprotohelpers.sh\\n+ $ enablehttpv2client\\n+\\n+ $ hg init server-simple\\n+ $ enablehttpv2 server-simple\\n+ $ cd server-simple\\n+ $ cat \\u003e\\u003e .hg\\/hgrc \\u003c\\u003c EOF\\n+ \\u003e [phases]\\n+ \\u003e publish = false\\n+ \\u003e EOF\\n+ $ echo a0 \\u003e a\\n+ $ echo b0 \\u003e b\\n+ $ hg -q commit -A -m 'commit 0'\\n+\\n+ $ echo a1 \\u003e a\\n+ $ hg commit -m 'commit 1'\\n+ $ hg phase --public -r .\\n+ $ echo a2 \\u003e a\\n+ $ hg commit -m 'commit 2'\\n+\\n+ $ hg -q up -r 0\\n+ $ echo b1 \\u003e b\\n+ $ hg -q commit -m 'head 2 commit 1'\\n+ $ echo b2 \\u003e b\\n+ $ hg -q commit -m 'head 2 commit 2'\\n+\\n+ $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log\\n+ $ cat hg.pid \\u003e $DAEMON_PIDS\\n+\\n+ $ cd ..\\n+\\n+Test basic clone\\n+\\n+ $ hg --debug clone -U http:\\/\\/localhost:$HGPORT client-simple\\n+ using http:\\/\\/localhost:$HGPORT\\/\\n+ sending capabilities command\\n+ query 1; heads\\n+ sending 2 commands\\n+ sending command heads: {}\\n+ sending command known: {\\n+ 'nodes': []\\n+ }\\n+ received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)\\n+ received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)\\n+ received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)\\n\"}]},{\"id\":\"24369\",\"metadata\":{\"line:first\":805},\"oldPath\":\"mercurial\\/httppeer.py\",\"currentPath\":\"mercurial\\/httppeer.py\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"1\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"1006\",\"newLength\":\"1007\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\" # httppeer.py - HTTP repository proxy classes for mercurial\\n #\\n # Copyright 2005, 2006 Matt Mackall \\u003cmpm@selenic.com\\u003e\\n # Copyright 2006 Vadim Gelfer \\u003cvadim.gelfer@gmail.com\\u003e\\n #\\n # This software may be used and distributed according to the terms of the\\n # GNU General Public License version 2 or any later version.\\n \\n from __future__ import absolute_import\\n \\n import errno\\n import io\\n import os\\n import socket\\n import struct\\n import weakref\\n \\n from .i18n import _\\n from . import (\\n bundle2,\\n error,\\n httpconnection,\\n pycompat,\\n repository,\\n statichttprepo,\\n url as urlmod,\\n util,\\n wireprotoframing,\\n wireprototypes,\\n wireprotov1peer,\\n wireprotov2peer,\\n wireprotov2server,\\n )\\n from .utils import (\\n cborutil,\\n interfaceutil,\\n stringutil,\\n )\\n \\n httplib = util.httplib\\n urlerr = util.urlerr\\n urlreq = util.urlreq\\n \\n def encodevalueinheaders(value, header, limit):\\n \\\"\\\"\\\"Encode a string value into multiple HTTP headers.\\n \\n ``value`` will be encoded into 1 or more HTTP headers with the names\\n ``header-\\u003cN\\u003e`` where ``\\u003cN\\u003e`` is an integer starting at 1. Each header\\n name + value will be at most ``limit`` bytes long.\\n \\n Returns an iterable of 2-tuples consisting of header names and\\n values as native strings.\\n \\\"\\\"\\\"\\n # HTTP Headers are ASCII. Python 3 requires them to be unicodes,\\n # not bytes. This function always takes bytes in as arguments.\\n fmt = pycompat.strurl(header) + r'-%s'\\n # Note: it is *NOT* a bug that the last bit here is a bytestring\\n # and not a unicode: we're just getting the encoded length anyway,\\n # and using an r-string to make it portable between Python 2 and 3\\n # doesn't work because then the \\\\r is a literal backslash-r\\n # instead of a carriage return.\\n valuelen = limit - len(fmt % r'000') - len(': \\\\r\\\\n')\\n result = []\\n \\n n = 0\\n for i in pycompat.xrange(0, len(value), valuelen):\\n n += 1\\n result.append((fmt % str(n), pycompat.strurl(value[i:i + valuelen])))\\n \\n return result\\n \\n def _wraphttpresponse(resp):\\n \\\"\\\"\\\"Wrap an HTTPResponse with common error handlers.\\n \\n This ensures that any I\\/O from any consumer raises the appropriate\\n error and messaging.\\n \\\"\\\"\\\"\\n origread = resp.read\\n \\n class readerproxy(resp.__class__):\\n def read(self, size=None):\\n try:\\n return origread(size)\\n except httplib.IncompleteRead as e:\\n # e.expected is an integer if length known or None otherwise.\\n if e.expected:\\n got = len(e.partial)\\n total = e.expected + got\\n msg = _('HTTP request error (incomplete response; '\\n 'expected %d bytes got %d)') % (total, got)\\n else:\\n msg = _('HTTP request error (incomplete response)')\\n \\n raise error.PeerTransportError(\\n msg,\\n hint=_('this may be an intermittent network failure; '\\n 'if the error persists, consider contacting the '\\n 'network or server operator'))\\n except httplib.HTTPException as e:\\n raise error.PeerTransportError(\\n _('HTTP request error (%s)') % e,\\n hint=_('this may be an intermittent network failure; '\\n 'if the error persists, consider contacting the '\\n 'network or server operator'))\\n \\n resp.__class__ = readerproxy\\n \\n class _multifile(object):\\n def __init__(self, *fileobjs):\\n for f in fileobjs:\\n if not util.safehasattr(f, 'length'):\\n raise ValueError(\\n '_multifile only supports file objects that '\\n 'have a length but this one does not:', type(f), f)\\n self._fileobjs = fileobjs\\n self._index = 0\\n \\n @property\\n def length(self):\\n return sum(f.length for f in self._fileobjs)\\n \\n def read(self, amt=None):\\n if amt \\u003c= 0:\\n return ''.join(f.read() for f in self._fileobjs)\\n parts = []\\n while amt and self._index \\u003c len(self._fileobjs):\\n parts.append(self._fileobjs[self._index].read(amt))\\n got = len(parts[-1])\\n if got \\u003c amt:\\n self._index += 1\\n amt -= got\\n return ''.join(parts)\\n \\n def seek(self, offset, whence=os.SEEK_SET):\\n if whence != os.SEEK_SET:\\n raise NotImplementedError(\\n '_multifile does not support anything other'\\n ' than os.SEEK_SET for whence on seek()')\\n if offset != 0:\\n raise NotImplementedError(\\n '_multifile only supports seeking to start, but that '\\n 'could be fixed if you need it')\\n for f in self._fileobjs:\\n f.seek(0)\\n self._index = 0\\n \\n def makev1commandrequest(ui, requestbuilder, caps, capablefn,\\n repobaseurl, cmd, args):\\n \\\"\\\"\\\"Make an HTTP request to run a command for a version 1 client.\\n \\n ``caps`` is a set of known server capabilities. The value may be\\n None if capabilities are not yet known.\\n \\n ``capablefn`` is a function to evaluate a capability.\\n \\n ``cmd``, ``args``, and ``data`` define the command, its arguments, and\\n raw data to pass to it.\\n \\\"\\\"\\\"\\n if cmd == 'pushkey':\\n args['data'] = ''\\n data = args.pop('data', None)\\n headers = args.pop('headers', {})\\n \\n ui.debug(\\\"sending %s command\\\\n\\\" % cmd)\\n q = [('cmd', cmd)]\\n headersize = 0\\n # Important: don't use self.capable() here or else you end up\\n # with infinite recursion when trying to look up capabilities\\n # for the first time.\\n postargsok = caps is not None and 'httppostargs' in caps\\n \\n # Send arguments via POST.\\n if postargsok and args:\\n strargs = urlreq.urlencode(sorted(args.items()))\\n if not data:\\n data = strargs\\n else:\\n if isinstance(data, bytes):\\n i = io.BytesIO(data)\\n i.length = len(data)\\n data = i\\n argsio = io.BytesIO(strargs)\\n argsio.length = len(strargs)\\n data = _multifile(argsio, data)\\n headers[r'X-HgArgs-Post'] = len(strargs)\\n elif args:\\n # Calling self.capable() can infinite loop if we are calling\\n # \\\"capabilities\\\". But that command should never accept wire\\n # protocol arguments. So this should never happen.\\n assert cmd != 'capabilities'\\n httpheader = capablefn('httpheader')\\n if httpheader:\\n headersize = int(httpheader.split(',', 1)[0])\\n \\n # Send arguments via HTTP headers.\\n if headersize \\u003e 0:\\n # The headers can typically carry more data than the URL.\\n encargs = urlreq.urlencode(sorted(args.items()))\\n for header, value in encodevalueinheaders(encargs, 'X-HgArg',\\n headersize):\\n headers[header] = value\\n # Send arguments via query string (Mercurial \\u003c1.9).\\n else:\\n q += sorted(args.items())\\n \\n qs = '?%s' % urlreq.urlencode(q)\\n cu = \\\"%s%s\\\" % (repobaseurl, qs)\\n size = 0\\n if util.safehasattr(data, 'length'):\\n size = data.length\\n elif data is not None:\\n size = len(data)\\n if data is not None and r'Content-Type' not in headers:\\n headers[r'Content-Type'] = r'application\\/mercurial-0.1'\\n \\n # Tell the server we accept application\\/mercurial-0.2 and multiple\\n # compression formats if the server is capable of emitting those\\n # payloads.\\n # Note: Keep this set empty by default, as client advertisement of\\n # protocol parameters should only occur after the handshake.\\n protoparams = set()\\n \\n mediatypes = set()\\n if caps is not None:\\n mt = capablefn('httpmediatype')\\n if mt:\\n protoparams.add('0.1')\\n mediatypes = set(mt.split(','))\\n \\n protoparams.add('partial-pull')\\n \\n if '0.2tx' in mediatypes:\\n protoparams.add('0.2')\\n \\n if '0.2tx' in mediatypes and capablefn('compression'):\\n # We \\/could\\/ compare supported compression formats and prune\\n # non-mutually supported or error if nothing is mutually supported.\\n # For now, send the full list to the server and have it error.\\n comps = [e.wireprotosupport().name for e in\\n util.compengines.supportedwireengines(util.CLIENTROLE)]\\n protoparams.add('comp=%s' % ','.join(comps))\\n \\n if protoparams:\\n protoheaders = encodevalueinheaders(' '.join(sorted(protoparams)),\\n 'X-HgProto',\\n headersize or 1024)\\n for header, value in protoheaders:\\n headers[header] = value\\n \\n varyheaders = []\\n for header in headers:\\n if header.lower().startswith(r'x-hg'):\\n varyheaders.append(header)\\n \\n if varyheaders:\\n headers[r'Vary'] = r','.join(sorted(varyheaders))\\n \\n req = requestbuilder(pycompat.strurl(cu), data, headers)\\n \\n if data is not None:\\n ui.debug(\\\"sending %d bytes\\\\n\\\" % size)\\n req.add_unredirected_header(r'Content-Length', r'%d' % size)\\n \\n return req, cu, qs\\n \\n def _reqdata(req):\\n \\\"\\\"\\\"Get request data, if any. If no data, returns None.\\\"\\\"\\\"\\n if pycompat.ispy3:\\n return req.data\\n if not req.has_data():\\n return None\\n return req.get_data()\\n \\n def sendrequest(ui, opener, req):\\n \\\"\\\"\\\"Send a prepared HTTP request.\\n \\n Returns the response object.\\n \\\"\\\"\\\"\\n dbg = ui.debug\\n if (ui.debugflag\\n and ui.configbool('devel', 'debug.peer-request')):\\n line = 'devel-peer-request: %s\\\\n'\\n dbg(line % '%s %s' % (pycompat.bytesurl(req.get_method()),\\n pycompat.bytesurl(req.get_full_url())))\\n hgargssize = None\\n \\n for header, value in sorted(req.header_items()):\\n header = pycompat.bytesurl(header)\\n value = pycompat.bytesurl(value)\\n if header.startswith('X-hgarg-'):\\n if hgargssize is None:\\n hgargssize = 0\\n hgargssize += len(value)\\n else:\\n dbg(line % ' %s %s' % (header, value))\\n \\n if hgargssize is not None:\\n dbg(line % ' %d bytes of commands arguments in headers'\\n % hgargssize)\\n data = _reqdata(req)\\n if data is not None:\\n length = getattr(data, 'length', None)\\n if length is None:\\n length = len(data)\\n dbg(line % ' %d bytes of data' % length)\\n \\n start = util.timer()\\n \\n res = None\\n try:\\n res = opener.open(req)\\n except urlerr.httperror as inst:\\n if inst.code == 401:\\n raise error.Abort(_('authorization failed'))\\n raise\\n except httplib.HTTPException as inst:\\n ui.debug('http error requesting %s\\\\n' %\\n util.hidepassword(req.get_full_url()))\\n ui.traceback()\\n raise IOError(None, inst)\\n finally:\\n if ui.debugflag and ui.configbool('devel', 'debug.peer-request'):\\n code = res.code if res else -1\\n dbg(line % ' finished in %.4f seconds (%d)'\\n % (util.timer() - start, code))\\n \\n # Insert error handlers for common I\\/O failures.\\n _wraphttpresponse(res)\\n \\n return res\\n \\n class RedirectedRepoError(error.RepoError):\\n def __init__(self, msg, respurl):\\n super(RedirectedRepoError, self).__init__(msg)\\n self.respurl = respurl\\n \\n def parsev1commandresponse(ui, baseurl, requrl, qs, resp, compressible,\\n allowcbor=False):\\n # record the url we got redirected to\\n redirected = False\\n respurl = pycompat.bytesurl(resp.geturl())\\n if respurl.endswith(qs):\\n respurl = respurl[:-len(qs)]\\n qsdropped = False\\n else:\\n qsdropped = True\\n \\n if baseurl.rstrip('\\/') != respurl.rstrip('\\/'):\\n redirected = True\\n if not ui.quiet:\\n ui.warn(_('real URL is %s\\\\n') % respurl)\\n \\n try:\\n proto = pycompat.bytesurl(resp.getheader(r'content-type', r''))\\n except AttributeError:\\n proto = pycompat.bytesurl(resp.headers.get(r'content-type', r''))\\n \\n safeurl = util.hidepassword(baseurl)\\n if proto.startswith('application\\/hg-error'):\\n raise error.OutOfBandError(resp.read())\\n \\n # Pre 1.0 versions of Mercurial used text\\/plain and\\n # application\\/hg-changegroup. We don't support such old servers.\\n if not proto.startswith('application\\/mercurial-'):\\n ui.debug(\\\"requested URL: '%s'\\\\n\\\" % util.hidepassword(requrl))\\n msg = _(\\\"'%s' does not appear to be an hg repository:\\\\n\\\"\\n \\\"---%%\\u003c--- (%s)\\\\n%s\\\\n---%%\\u003c---\\\\n\\\") % (\\n safeurl, proto or 'no content-type', resp.read(1024))\\n \\n # Some servers may strip the query string from the redirect. We\\n # raise a special error type so callers can react to this specially.\\n if redirected and qsdropped:\\n raise RedirectedRepoError(msg, respurl)\\n else:\\n raise error.RepoError(msg)\\n \\n try:\\n subtype = proto.split('-', 1)[1]\\n \\n # Unless we end up supporting CBOR in the legacy wire protocol,\\n # this should ONLY be encountered for the initial capabilities\\n # request during handshake.\\n if subtype == 'cbor':\\n if allowcbor:\\n return respurl, proto, resp\\n else:\\n raise error.RepoError(_('unexpected CBOR response from '\\n 'server'))\\n \\n version_info = tuple([int(n) for n in subtype.split('.')])\\n except ValueError:\\n raise error.RepoError(_(\\\"'%s' sent a broken Content-Type \\\"\\n \\\"header (%s)\\\") % (safeurl, proto))\\n \\n # TODO consider switching to a decompression reader that uses\\n # generators.\\n if version_info == (0, 1):\\n if compressible:\\n resp = util.compengines['zlib'].decompressorreader(resp)\\n \\n elif version_info == (0, 2):\\n # application\\/mercurial-0.2 always identifies the compression\\n # engine in the payload header.\\n elen = struct.unpack('B', util.readexactly(resp, 1))[0]\\n ename = util.readexactly(resp, elen)\\n engine = util.compengines.forwiretype(ename)\\n \\n resp = engine.decompressorreader(resp)\\n else:\\n raise error.RepoError(_(\\\"'%s' uses newer protocol %s\\\") %\\n (safeurl, subtype))\\n \\n return respurl, proto, resp\\n \\n class httppeer(wireprotov1peer.wirepeer):\\n def __init__(self, ui, path, url, opener, requestbuilder, caps):\\n self.ui = ui\\n self._path = path\\n self._url = url\\n self._caps = caps\\n self._urlopener = opener\\n self._requestbuilder = requestbuilder\\n \\n def __del__(self):\\n for h in self._urlopener.handlers:\\n h.close()\\n getattr(h, \\\"close_all\\\", lambda: None)()\\n \\n # Begin of ipeerconnection interface.\\n \\n def url(self):\\n return self._path\\n \\n def local(self):\\n return None\\n \\n def peer(self):\\n return self\\n \\n def canpush(self):\\n return True\\n \\n def close(self):\\n pass\\n \\n # End of ipeerconnection interface.\\n \\n # Begin of ipeercommands interface.\\n \\n def capabilities(self):\\n return self._caps\\n \\n # End of ipeercommands interface.\\n \\n def _callstream(self, cmd, _compressible=False, **args):\\n args = pycompat.byteskwargs(args)\\n \\n req, cu, qs = makev1commandrequest(self.ui, self._requestbuilder,\\n self._caps, self.capable,\\n self._url, cmd, args)\\n \\n resp = sendrequest(self.ui, self._urlopener, req)\\n \\n self._url, ct, resp = parsev1commandresponse(self.ui, self._url, cu, qs,\\n resp, _compressible)\\n \\n return resp\\n \\n def _call(self, cmd, **args):\\n fp = self._callstream(cmd, **args)\\n try:\\n return fp.read()\\n finally:\\n # if using keepalive, allow connection to be reused\\n fp.close()\\n \\n def _callpush(self, cmd, cg, **args):\\n # have to stream bundle to a temp file because we do not have\\n # http 1.1 chunked transfer.\\n \\n types = self.capable('unbundle')\\n try:\\n types = types.split(',')\\n except AttributeError:\\n # servers older than d1b16a746db6 will send 'unbundle' as a\\n # boolean capability. They only support headerless\\/uncompressed\\n # bundles.\\n types = [\\\"\\\"]\\n for x in types:\\n if x in bundle2.bundletypes:\\n type = x\\n break\\n \\n tempname = bundle2.writebundle(self.ui, cg, None, type)\\n fp = httpconnection.httpsendfile(self.ui, tempname, \\\"rb\\\")\\n headers = {r'Content-Type': r'application\\/mercurial-0.1'}\\n \\n try:\\n r = self._call(cmd, data=fp, headers=headers, **args)\\n vals = r.split('\\\\n', 1)\\n if len(vals) \\u003c 2:\\n raise error.ResponseError(_(\\\"unexpected response:\\\"), r)\\n return vals\\n except urlerr.httperror:\\n # Catch and re-raise these so we don't try and treat them\\n # like generic socket errors. They lack any values in\\n # .args on Python 3 which breaks our socket.error block.\\n raise\\n except socket.error as err:\\n if err.args[0] in (errno.ECONNRESET, errno.EPIPE):\\n raise error.Abort(_('push failed: %s') % err.args[1])\\n raise error.Abort(err.args[1])\\n finally:\\n fp.close()\\n os.unlink(tempname)\\n \\n def _calltwowaystream(self, cmd, fp, **args):\\n fh = None\\n fp_ = None\\n filename = None\\n try:\\n # dump bundle to disk\\n fd, filename = pycompat.mkstemp(prefix=\\\"hg-bundle-\\\", suffix=\\\".hg\\\")\\n fh = os.fdopen(fd, r\\\"wb\\\")\\n d = fp.read(4096)\\n while d:\\n fh.write(d)\\n d = fp.read(4096)\\n fh.close()\\n # start http push\\n fp_ = httpconnection.httpsendfile(self.ui, filename, \\\"rb\\\")\\n headers = {r'Content-Type': r'application\\/mercurial-0.1'}\\n return self._callstream(cmd, data=fp_, headers=headers, **args)\\n finally:\\n if fp_ is not None:\\n fp_.close()\\n if fh is not None:\\n fh.close()\\n os.unlink(filename)\\n \\n def _callcompressable(self, cmd, **args):\\n return self._callstream(cmd, _compressible=True, **args)\\n \\n def _abort(self, exception):\\n raise exception\\n \\n def sendv2request(ui, opener, requestbuilder, apiurl, permission, requests):\\n reactor = wireprotoframing.clientreactor(hasmultiplesend=False,\\n buffersends=True)\\n \\n handler = wireprotov2peer.clienthandler(ui, reactor)\\n \\n url = '%s\\/%s' % (apiurl, permission)\\n \\n if len(requests) \\u003e 1:\\n url += '\\/multirequest'\\n else:\\n url += '\\/%s' % requests[0][0]\\n \\n ui.debug('sending %d commands\\\\n' % len(requests))\\n for command, args, f in requests:\\n ui.debug('sending command %s: %s\\\\n' % (\\n command, stringutil.pprint(args, indent=2)))\\n assert not list(handler.callcommand(command, args, f))\\n \\n # TODO stream this.\\n body = b''.join(map(bytes, handler.flushcommands()))\\n \\n # TODO modify user-agent to reflect v2\\n headers = {\\n r'Accept': wireprotov2server.FRAMINGTYPE,\\n r'Content-Type': wireprotov2server.FRAMINGTYPE,\\n }\\n \\n req = requestbuilder(pycompat.strurl(url), body, headers)\\n req.add_unredirected_header(r'Content-Length', r'%d' % len(body))\\n \\n try:\\n res = opener.open(req)\\n except urlerr.httperror as e:\\n if e.code == 401:\\n raise error.Abort(_('authorization failed'))\\n \\n raise\\n except httplib.HTTPException as e:\\n ui.traceback()\\n raise IOError(None, e)\\n \\n return handler, res\\n \\n class queuedcommandfuture(pycompat.futures.Future):\\n \\\"\\\"\\\"Wraps result() on command futures to trigger submission on call.\\\"\\\"\\\"\\n \\n def result(self, timeout=None):\\n if self.done():\\n return pycompat.futures.Future.result(self, timeout)\\n \\n self._peerexecutor.sendcommands()\\n \\n # sendcommands() will restore the original __class__ and self.result\\n # will resolve to Future.result.\\n return self.result(timeout)\\n \\n @interfaceutil.implementer(repository.ipeercommandexecutor)\\n class httpv2executor(object):\\n def __init__(self, ui, opener, requestbuilder, apiurl, descriptor):\\n self._ui = ui\\n self._opener = opener\\n self._requestbuilder = requestbuilder\\n self._apiurl = apiurl\\n self._descriptor = descriptor\\n self._sent = False\\n self._closed = False\\n self._neededpermissions = set()\\n self._calls = []\\n self._futures = weakref.WeakSet()\\n self._responseexecutor = None\\n self._responsef = None\\n \\n def __enter__(self):\\n return self\\n \\n def __exit__(self, exctype, excvalue, exctb):\\n self.close()\\n \\n def callcommand(self, command, args):\\n if self._sent:\\n raise error.ProgrammingError('callcommand() cannot be used after '\\n 'commands are sent')\\n \\n if self._closed:\\n raise error.ProgrammingError('callcommand() cannot be used after '\\n 'close()')\\n \\n # The service advertises which commands are available. So if we attempt\\n # to call an unknown command or pass an unknown argument, we can screen\\n # for this.\\n if command not in self._descriptor['commands']:\\n raise error.ProgrammingError(\\n 'wire protocol command %s is not available' % command)\\n \\n cmdinfo = self._descriptor['commands'][command]\\n unknownargs = set(args.keys()) - set(cmdinfo.get('args', {}))\\n \\n if unknownargs:\\n raise error.ProgrammingError(\\n 'wire protocol command %s does not accept argument: %s' % (\\n command, ', '.join(sorted(unknownargs))))\\n \\n self._neededpermissions |= set(cmdinfo['permissions'])\\n \\n # TODO we \\/could\\/ also validate types here, since the API descriptor\\n # includes types...\\n \\n f = pycompat.futures.Future()\\n \\n # Monkeypatch it so result() triggers sendcommands(), otherwise result()\\n # could deadlock.\\n f.__class__ = queuedcommandfuture\\n f._peerexecutor = self\\n \\n self._futures.add(f)\\n self._calls.append((command, args, f))\\n \\n return f\\n \\n def sendcommands(self):\\n if self._sent:\\n return\\n \\n if not self._calls:\\n return\\n \\n self._sent = True\\n \\n # Unhack any future types so caller sees a clean type and so we\\n # break reference cycle.\\n for f in self._futures:\\n if isinstance(f, queuedcommandfuture):\\n f.__class__ = pycompat.futures.Future\\n f._peerexecutor = None\\n \\n # Mark the future as running and filter out cancelled futures.\\n calls = [(command, args, f)\\n for command, args, f in self._calls\\n if f.set_running_or_notify_cancel()]\\n \\n # Clear out references, prevent improper object usage.\\n self._calls = None\\n \\n if not calls:\\n return\\n \\n permissions = set(self._neededpermissions)\\n \\n if 'push' in permissions and 'pull' in permissions:\\n permissions.remove('pull')\\n \\n if len(permissions) \\u003e 1:\\n raise error.RepoError(_('cannot make request requiring multiple '\\n 'permissions: %s') %\\n _(', ').join(sorted(permissions)))\\n \\n permission = {\\n 'push': 'rw',\\n 'pull': 'ro',\\n }[permissions.pop()]\\n \\n handler, resp = sendv2request(\\n self._ui, self._opener, self._requestbuilder, self._apiurl,\\n permission, calls)\\n \\n # TODO we probably want to validate the HTTP code, media type, etc.\\n \\n self._responseexecutor = pycompat.futures.ThreadPoolExecutor(1)\\n self._responsef = self._responseexecutor.submit(self._handleresponse,\\n handler, resp)\\n \\n def close(self):\\n if self._closed:\\n return\\n \\n self.sendcommands()\\n \\n self._closed = True\\n \\n if not self._responsef:\\n return\\n \\n # TODO ^C here may not result in immediate program termination.\\n \\n try:\\n self._responsef.result()\\n finally:\\n self._responseexecutor.shutdown(wait=True)\\n self._responsef = None\\n self._responseexecutor = None\\n \\n # If any of our futures are still in progress, mark them as\\n # errored, otherwise a result() could wait indefinitely.\\n for f in self._futures:\\n if not f.done():\\n f.set_exception(error.ResponseError(\\n _('unfulfilled command response')))\\n \\n self._futures = None\\n \\n def _handleresponse(self, handler, resp):\\n # Called in a thread to read the response.\\n \\n while handler.readframe(resp):\\n pass\\n \\n # TODO implement interface for version 2 peers\\n @interfaceutil.implementer(repository.ipeerconnection,\\n repository.ipeercapabilities,\\n repository.ipeerrequests)\\n class httpv2peer(object):\\n def __init__(self, ui, repourl, apipath, opener, requestbuilder,\\n apidescriptor):\\n self.ui = ui\\n \\n if repourl.endswith('\\/'):\\n repourl = repourl[:-1]\\n \\n self._url = repourl\\n self._apipath = apipath\\n self._apiurl = '%s\\/%s' % (repourl, apipath)\\n self._opener = opener\\n self._requestbuilder = requestbuilder\\n self._descriptor = apidescriptor\\n \\n # Start of ipeerconnection.\\n \\n def url(self):\\n return self._url\\n \\n def local(self):\\n return None\\n \\n def peer(self):\\n return self\\n \\n def canpush(self):\\n # TODO change once implemented.\\n return False\\n \\n def close(self):\\n pass\\n \\n # End of ipeerconnection.\\n \\n # Start of ipeercapabilities.\\n \\n def capable(self, name):\\n # The capabilities used internally historically map to capabilities\\n # advertised from the \\\"capabilities\\\" wire protocol command. However,\\n # version 2 of that command works differently.\\n \\n # Maps to commands that are available.\\n if name in ('branchmap', 'getbundle', 'known', 'lookup', 'pushkey'):\\n return True\\n \\n # Other concepts.\\n- if name in ('bundle2',):\\n+ # TODO remove exchangev2 once we have a command implemented.\\n+ if name in ('bundle2', 'exchangev2'):\\n return True\\n \\n # Alias command-* to presence of command of that name.\\n if name.startswith('command-'):\\n return name[len('command-'):] in self._descriptor['commands']\\n \\n return False\\n \\n def requirecap(self, name, purpose):\\n if self.capable(name):\\n return\\n \\n raise error.CapabilityError(\\n _('cannot %s; client or remote repository does not support the %r '\\n 'capability') % (purpose, name))\\n \\n # End of ipeercapabilities.\\n \\n def _call(self, name, **args):\\n with self.commandexecutor() as e:\\n return e.callcommand(name, args).result()\\n \\n def commandexecutor(self):\\n return httpv2executor(self.ui, self._opener, self._requestbuilder,\\n self._apiurl, self._descriptor)\\n \\n # Registry of API service names to metadata about peers that handle it.\\n #\\n # The following keys are meaningful:\\n #\\n # init\\n # Callable receiving (ui, repourl, servicepath, opener, requestbuilder,\\n # apidescriptor) to create a peer.\\n #\\n # priority\\n # Integer priority for the service. If we could choose from multiple\\n # services, we choose the one with the highest priority.\\n API_PEERS = {\\n wireprototypes.HTTP_WIREPROTO_V2: {\\n 'init': httpv2peer,\\n 'priority': 50,\\n },\\n }\\n \\n def performhandshake(ui, url, opener, requestbuilder):\\n # The handshake is a request to the capabilities command.\\n \\n caps = None\\n def capable(x):\\n raise error.ProgrammingError('should not be called')\\n \\n args = {}\\n \\n # The client advertises support for newer protocols by adding an\\n # X-HgUpgrade-* header with a list of supported APIs and an\\n # X-HgProto-* header advertising which serializing formats it supports.\\n # We only support the HTTP version 2 transport and CBOR responses for\\n # now.\\n advertisev2 = ui.configbool('experimental', 'httppeer.advertise-v2')\\n \\n if advertisev2:\\n args['headers'] = {\\n r'X-HgProto-1': r'cbor',\\n }\\n \\n args['headers'].update(\\n encodevalueinheaders(' '.join(sorted(API_PEERS)),\\n 'X-HgUpgrade',\\n # We don't know the header limit this early.\\n # So make it small.\\n 1024))\\n \\n req, requrl, qs = makev1commandrequest(ui, requestbuilder, caps,\\n capable, url, 'capabilities',\\n args)\\n resp = sendrequest(ui, opener, req)\\n \\n # The server may redirect us to the repo root, stripping the\\n # ?cmd=capabilities query string from the URL. The server would likely\\n # return HTML in this case and ``parsev1commandresponse()`` would raise.\\n # We catch this special case and re-issue the capabilities request against\\n # the new URL.\\n #\\n # We should ideally not do this, as a redirect that drops the query\\n # string from the URL is arguably a server bug. (Garbage in, garbage out).\\n # However, Mercurial clients for several years appeared to handle this\\n # issue without behavior degradation. And according to issue 5860, it may\\n # be a longstanding bug in some server implementations. So we allow a\\n # redirect that drops the query string to \\\"just work.\\\"\\n try:\\n respurl, ct, resp = parsev1commandresponse(ui, url, requrl, qs, resp,\\n compressible=False,\\n allowcbor=advertisev2)\\n except RedirectedRepoError as e:\\n req, requrl, qs = makev1commandrequest(ui, requestbuilder, caps,\\n capable, e.respurl,\\n 'capabilities', args)\\n resp = sendrequest(ui, opener, req)\\n respurl, ct, resp = parsev1commandresponse(ui, url, requrl, qs, resp,\\n compressible=False,\\n allowcbor=advertisev2)\\n \\n try:\\n rawdata = resp.read()\\n finally:\\n resp.close()\\n \\n if not ct.startswith('application\\/mercurial-'):\\n raise error.ProgrammingError('unexpected content-type: %s' % ct)\\n \\n if advertisev2:\\n if ct == 'application\\/mercurial-cbor':\\n try:\\n info = cborutil.decodeall(rawdata)[0]\\n except cborutil.CBORDecodeError:\\n raise error.Abort(_('error decoding CBOR from remote server'),\\n hint=_('try again and consider contacting '\\n 'the server operator'))\\n \\n # We got a legacy response. That's fine.\\n elif ct in ('application\\/mercurial-0.1', 'application\\/mercurial-0.2'):\\n info = {\\n 'v1capabilities': set(rawdata.split())\\n }\\n \\n else:\\n raise error.RepoError(\\n _('unexpected response type from server: %s') % ct)\\n else:\\n info = {\\n 'v1capabilities': set(rawdata.split())\\n }\\n \\n return respurl, info\\n \\n def makepeer(ui, path, opener=None, requestbuilder=urlreq.request):\\n \\\"\\\"\\\"Construct an appropriate HTTP peer instance.\\n \\n ``opener`` is an ``url.opener`` that should be used to establish\\n connections, perform HTTP requests.\\n \\n ``requestbuilder`` is the type used for constructing HTTP requests.\\n It exists as an argument so extensions can override the default.\\n \\\"\\\"\\\"\\n u = util.url(path)\\n if u.query or u.fragment:\\n raise error.Abort(_('unsupported URL component: \\\"%s\\\"') %\\n (u.query or u.fragment))\\n \\n # urllib cannot handle URLs with embedded user or passwd.\\n url, authinfo = u.authinfo()\\n ui.debug('using %s\\\\n' % url)\\n \\n opener = opener or urlmod.opener(ui, authinfo)\\n \\n respurl, info = performhandshake(ui, url, opener, requestbuilder)\\n \\n # Given the intersection of APIs that both we and the server support,\\n # sort by their advertised priority and pick the first one.\\n #\\n # TODO consider making this request-based and interface driven. For\\n # example, the caller could say \\\"I want a peer that does X.\\\" It's quite\\n # possible that not all peers would do that. Since we know the service\\n # capabilities, we could filter out services not meeting the\\n # requirements. Possibly by consulting the interfaces defined by the\\n # peer type.\\n apipeerchoices = set(info.get('apis', {}).keys()) & set(API_PEERS.keys())\\n \\n preferredchoices = sorted(apipeerchoices,\\n key=lambda x: API_PEERS[x]['priority'],\\n reverse=True)\\n \\n for service in preferredchoices:\\n apipath = '%s\\/%s' % (info['apibase'].rstrip('\\/'), service)\\n \\n return API_PEERS[service]['init'](ui, respurl, apipath, opener,\\n requestbuilder,\\n info['apis'][service])\\n \\n # Failed to construct an API peer. Fall back to legacy.\\n return httppeer(ui, path, respurl, opener, requestbuilder,\\n info['v1capabilities'])\\n \\n def instance(ui, path, create, intents=None, createopts=None):\\n if create:\\n raise error.Abort(_('cannot create new http repository'))\\n try:\\n if path.startswith('https:') and not urlmod.has_https:\\n raise error.Abort(_('Python support for SSL and HTTPS '\\n 'is not installed'))\\n \\n inst = makepeer(ui, path)\\n \\n return inst\\n except error.RepoError as httpexception:\\n try:\\n r = statichttprepo.instance(ui, \\\"static-\\\" + path, create)\\n ui.note(_('(falling back to static-http)\\\\n'))\\n return r\\n except error.RepoError:\\n raise httpexception # use the original http RepoError instead\\n\"}]},{\"id\":\"24368\",\"metadata\":{\"line:first\":1,\"copy:lines\":{\"4\":[\"mercurial\\/exchange.py\",4,\" \"],\"5\":[\"mercurial\\/exchange.py\",5,\" \"],\"6\":[\"mercurial\\/exchange.py\",6,\" \"],\"7\":[\"mercurial\\/exchange.py\",7,\" \"],\"8\":[\"mercurial\\/exchange.py\",8,\" \"],\"9\":[\"mercurial\\/exchange.py\",9,\" \"]}},\"oldPath\":null,\"currentPath\":\"mercurial\\/exchangev2.py\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"55\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"55\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+# exchangev2.py - repository exchange for wire protocol version 2\\n+#\\n+# Copyright 2018 Gregory Szorc \\u003cgregory.szorc@gmail.com\\u003e\\n+#\\n+# This software may be used and distributed according to the terms of the\\n+# GNU General Public License version 2 or any later version.\\n+\\n+from __future__ import absolute_import\\n+\\n+from .node import (\\n+ nullid,\\n+)\\n+from . import (\\n+ setdiscovery,\\n+)\\n+\\n+def pull(pullop):\\n+ \\\"\\\"\\\"Pull using wire protocol version 2.\\\"\\\"\\\"\\n+ repo = pullop.repo\\n+ remote = pullop.remote\\n+\\n+ # Figure out what needs to be fetched.\\n+ common, fetch, remoteheads = _pullchangesetdiscovery(\\n+ repo, remote, pullop.heads, abortwhenunrelated=pullop.force)\\n+\\n+def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):\\n+ \\\"\\\"\\\"Determine which changesets need to be pulled.\\\"\\\"\\\"\\n+\\n+ if heads:\\n+ knownnode = repo.changelog.hasnode\\n+ if all(knownnode(head) for head in heads):\\n+ return heads, False, heads\\n+\\n+ # TODO wire protocol version 2 is capable of more efficient discovery\\n+ # than setdiscovery. Consider implementing something better.\\n+ common, fetch, remoteheads = setdiscovery.findcommonheads(\\n+ repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)\\n+\\n+ common = set(common)\\n+ remoteheads = set(remoteheads)\\n+\\n+ # If a remote head is filtered locally, put it back in the common set.\\n+ # See the comment in exchange._pulldiscoverychangegroup() for more.\\n+\\n+ if fetch and remoteheads:\\n+ nodemap = repo.unfiltered().changelog.nodemap\\n+\\n+ common |= {head for head in remoteheads if head in nodemap}\\n+\\n+ if set(remoteheads).issubset(common):\\n+ fetch = []\\n+\\n+ common.discard(nullid)\\n+\\n+ return common, fetch, remoteheads\\n\"}]},{\"id\":\"24367\",\"metadata\":{\"line:first\":29,\"copy:lines\":{\"1514\":[\"\",1509,\"-\"],\"1515\":[\"\",1510,\"-\"],\"1516\":[\"\",1511,\"-\"],\"1517\":[\"\",1512,\"-\"],\"1518\":[\"\",1513,\"-\"],\"1519\":[\"\",1514,\"-\"],\"1520\":[\"\",1515,\"-\"],\"1521\":[\"\",1516,\"-\"],\"1522\":[\"\",1517,\"-\"],\"1523\":[\"\",1518,\"-\"],\"1524\":[\"\",1519,\"-\"],\"1525\":[\"\",1520,\" \"],\"1526\":[\"\",1521,\" \"],\"1527\":[\"\",1522,\" \"],\"1528\":[\"\",1523,\" \"],\"1529\":[\"\",1524,\" \"],\"1530\":[\"\",1525,\" \"],\"1531\":[\"\",1526,\" \"],\"1532\":[\"\",1527,\" \"],\"1533\":[\"\",1528,\" \"],\"1534\":[\"\",1529,\" \"],\"1535\":[\"\",1530,\" \"],\"1536\":[\"\",1531,\" \"],\"1537\":[\"\",1532,\" \"],\"1538\":[\"\",1533,\" \"],\"1539\":[\"\",1534,\" \"],\"1540\":[\"\",1535,\" \"],\"1541\":[\"\",1536,\" \"],\"1542\":[\"\",1537,\" \"],\"1543\":[\"\",1538,\" \"],\"1544\":[\"\",1539,\" \"],\"1545\":[\"\",1540,\" \"],\"1546\":[\"\",1541,\" \"],\"1547\":[\"\",1542,\" \"],\"1548\":[\"\",1543,\" \"],\"1549\":[\"\",1544,\" \"],\"1550\":[\"\",1545,\" \"],\"1551\":[\"\",1546,\" \"],\"1552\":[\"\",1547,\" \"],\"1553\":[\"\",1548,\" \"],\"1554\":[\"\",1549,\" \"],\"1555\":[\"\",1550,\" \"],\"1556\":[\"\",1551,\" \"],\"1557\":[\"\",1552,\" \"],\"1558\":[\"\",1553,\" \"],\"1559\":[\"\",1554,\" \"],\"1560\":[\"\",1555,\" \"],\"1561\":[\"\",1556,\" \"],\"1562\":[\"\",1557,\" \"],\"1563\":[\"\",1558,\" \"],\"1564\":[\"\",1559,\" \"],\"1565\":[\"\",1560,\" \"],\"1566\":[\"\",1561,\" \"],\"1567\":[\"\",1562,\" \"],\"1568\":[\"\",1563,\" \"],\"1569\":[\"\",1564,\" \"],\"1570\":[\"\",1565,\" \"],\"1571\":[\"\",1566,\" \"],\"1572\":[\"\",1567,\" \"],\"1573\":[\"\",1568,\" \"],\"1574\":[\"\",1569,\" \"],\"1575\":[\"\",1570,\" \"],\"1576\":[\"\",1571,\" \"],\"1577\":[\"\",1572,\" \"],\"1578\":[\"\",1573,\" \"],\"1579\":[\"\",1574,\" \"],\"1580\":[\"\",1575,\" \"],\"1581\":[\"\",1576,\" \"],\"1582\":[\"\",1577,\" \"],\"1583\":[\"\",1578,\" \"],\"1584\":[\"\",1579,\" \"],\"1585\":[\"\",1580,\" \"],\"1586\":[\"\",1581,\" \"],\"1587\":[\"\",1582,\" \"],\"1588\":[\"\",1583,\" \"],\"1589\":[\"\",1584,\" \"],\"1590\":[\"\",1585,\" \"],\"1591\":[\"\",1586,\" \"],\"1592\":[\"\",1587,\" \"],\"1593\":[\"\",1588,\" \"],\"1594\":[\"\",1589,\" \"],\"1595\":[\"\",1590,\" \"],\"1596\":[\"\",1591,\" \"],\"1597\":[\"\",1592,\" \"],\"1598\":[\"\",1593,\" \"],\"1599\":[\"\",1594,\" \"],\"1600\":[\"\",1595,\" \"],\"1601\":[\"\",1596,\" \"],\"1602\":[\"\",1597,\" \"],\"1603\":[\"\",1598,\" \"],\"1604\":[\"\",1599,\" \"],\"1605\":[\"\",1600,\" \"],\"1606\":[\"\",1601,\" \"],\"1607\":[\"\",1602,\" \"],\"1608\":[\"\",1603,\" \"],\"1609\":[\"\",1604,\" \"],\"1610\":[\"\",1605,\" \"],\"1611\":[\"\",1606,\" \"],\"1612\":[\"\",1607,\" \"],\"1613\":[\"\",1608,\" \"],\"1614\":[\"\",1609,\" \"],\"1615\":[\"\",1610,\" \"],\"1616\":[\"\",1611,\" \"],\"1617\":[\"\",1612,\" \"],\"1618\":[\"\",1613,\" \"],\"1619\":[\"\",1614,\" \"],\"1620\":[\"\",1615,\" \"],\"1621\":[\"\",1616,\" \"],\"1622\":[\"\",1617,\" \"],\"1623\":[\"\",1618,\" \"],\"1624\":[\"\",1619,\" \"],\"1625\":[\"\",1620,\" \"],\"1626\":[\"\",1621,\" \"],\"1627\":[\"\",1622,\" \"],\"1628\":[\"\",1623,\" \"],\"1629\":[\"\",1624,\" \"],\"1630\":[\"\",1625,\" \"],\"1631\":[\"\",1626,\" \"],\"1632\":[\"\",1627,\" \"],\"1633\":[\"\",1628,\" \"],\"1634\":[\"\",1629,\" \"],\"1635\":[\"\",1630,\" \"],\"1636\":[\"\",1631,\" \"],\"1637\":[\"\",1632,\" \"],\"1638\":[\"\",1633,\" \"],\"1639\":[\"\",1634,\" \"],\"1640\":[\"\",1635,\" \"],\"1641\":[\"\",1636,\" \"],\"1642\":[\"\",1637,\" \"],\"1643\":[\"\",1638,\" \"],\"1644\":[\"\",1639,\" \"],\"1645\":[\"\",1640,\" \"],\"1646\":[\"\",1641,\" \"],\"1647\":[\"\",1642,\" \"],\"1648\":[\"\",1643,\" \"],\"1649\":[\"\",1644,\" \"],\"1650\":[\"\",1645,\" \"],\"1651\":[\"\",1646,\" \"],\"1652\":[\"\",1647,\" \"],\"1653\":[\"\",1648,\" \"],\"1654\":[\"\",1649,\" \"],\"1655\":[\"\",1650,\" \"],\"1656\":[\"\",1651,\" \"],\"1657\":[\"\",1652,\" \"],\"1658\":[\"\",1653,\" \"],\"1659\":[\"\",1654,\" \"],\"1660\":[\"\",1655,\" \"],\"1661\":[\"\",1656,\" \"],\"1662\":[\"\",1657,\" \"],\"1663\":[\"\",1658,\" \"],\"1664\":[\"\",1659,\" \"],\"1665\":[\"\",1660,\" \"],\"1666\":[\"\",1661,\" \"],\"1667\":[\"\",1662,\" \"],\"1668\":[\"\",1663,\" \"],\"1669\":[\"\",1664,\" \"],\"1670\":[\"\",1665,\" \"],\"1671\":[\"\",1666,\" \"],\"1672\":[\"\",1667,\" \"],\"1673\":[\"\",1668,\" \"],\"1674\":[\"\",1669,\" \"],\"1675\":[\"\",1670,\" \"],\"1676\":[\"\",1671,\" \"],\"1677\":[\"\",1672,\" \"],\"1678\":[\"\",1673,\" \"],\"1679\":[\"\",1674,\" \"],\"1680\":[\"\",1675,\" \"],\"1681\":[\"\",1676,\" \"],\"1682\":[\"\",1677,\" \"],\"1683\":[\"\",1678,\" \"],\"1684\":[\"\",1679,\" \"],\"1685\":[\"\",1680,\" \"],\"1686\":[\"\",1681,\" \"],\"1687\":[\"\",1682,\" \"],\"1688\":[\"\",1683,\" \"],\"1689\":[\"\",1684,\" \"],\"1690\":[\"\",1685,\" \"],\"1691\":[\"\",1686,\" \"],\"1692\":[\"\",1687,\" \"],\"1693\":[\"\",1688,\" \"],\"1694\":[\"\",1689,\" \"],\"1695\":[\"\",1690,\" \"],\"1696\":[\"\",1691,\" \"],\"1697\":[\"\",1692,\" \"],\"1698\":[\"\",1693,\" \"],\"1699\":[\"\",1694,\" \"],\"1700\":[\"\",1695,\" \"],\"1701\":[\"\",1696,\" \"],\"1702\":[\"\",1697,\" \"],\"1703\":[\"\",1698,\" \"],\"1704\":[\"\",1699,\" \"],\"1705\":[\"\",1700,\" \"],\"1706\":[\"\",1701,\" \"],\"1707\":[\"\",1702,\" \"],\"1708\":[\"\",1703,\" \"],\"1709\":[\"\",1704,\" \"],\"1710\":[\"\",1705,\" \"],\"1711\":[\"\",1706,\" \"],\"1712\":[\"\",1707,\" \"],\"1713\":[\"\",1708,\" \"],\"1714\":[\"\",1709,\" \"],\"1715\":[\"\",1710,\" \"],\"1716\":[\"\",1711,\" \"],\"1717\":[\"\",1712,\" \"],\"1718\":[\"\",1713,\" \"],\"1719\":[\"\",1714,\" \"],\"1720\":[\"\",1715,\" \"],\"1721\":[\"\",1716,\" \"],\"1722\":[\"\",1717,\" \"],\"1723\":[\"\",1718,\" \"],\"1724\":[\"\",1719,\" \"],\"1725\":[\"\",1720,\" \"],\"1726\":[\"\",1721,\" \"],\"1727\":[\"\",1722,\" \"],\"1728\":[\"\",1723,\" \"],\"1729\":[\"\",1724,\" \"],\"1730\":[\"\",1725,\" \"],\"1731\":[\"\",1726,\" \"],\"1732\":[\"\",1727,\" \"],\"1733\":[\"\",1728,\" \"],\"1734\":[\"\",1729,\" \"],\"1735\":[\"\",1730,\" \"],\"1736\":[\"\",1731,\" \"],\"1737\":[\"\",1732,\" \"],\"1738\":[\"\",1733,\" \"],\"1739\":[\"\",1734,\" \"],\"1740\":[\"\",1735,\" \"],\"1741\":[\"\",1736,\" \"],\"1742\":[\"\",1737,\" \"],\"1743\":[\"\",1738,\" \"],\"1744\":[\"\",1739,\" \"],\"1745\":[\"\",1740,\" \"],\"1746\":[\"\",1741,\" \"],\"1747\":[\"\",1742,\" \"],\"1748\":[\"\",1743,\" \"],\"1749\":[\"\",1744,\" \"],\"1750\":[\"\",1745,\" \"],\"1751\":[\"\",1746,\" \"],\"1752\":[\"\",1747,\" \"],\"1753\":[\"\",1748,\" \"],\"1754\":[\"\",1749,\" \"],\"1755\":[\"\",1750,\" \"],\"1756\":[\"\",1751,\" \"],\"1757\":[\"\",1752,\" \"],\"1758\":[\"\",1753,\" \"],\"1759\":[\"\",1754,\" \"],\"1760\":[\"\",1755,\" \"],\"1761\":[\"\",1756,\" \"],\"1762\":[\"\",1757,\" \"],\"1763\":[\"\",1758,\" \"],\"1764\":[\"\",1759,\" \"],\"1765\":[\"\",1760,\" \"],\"1766\":[\"\",1761,\" \"],\"1767\":[\"\",1762,\" \"],\"1768\":[\"\",1763,\" \"],\"1769\":[\"\",1764,\" \"],\"1770\":[\"\",1765,\" \"],\"1771\":[\"\",1766,\" \"],\"1772\":[\"\",1767,\" \"],\"1773\":[\"\",1768,\" \"],\"1774\":[\"\",1769,\" \"],\"1775\":[\"\",1770,\" \"],\"1776\":[\"\",1771,\" \"],\"1777\":[\"\",1772,\" \"],\"1778\":[\"\",1773,\" \"],\"1779\":[\"\",1774,\" \"],\"1780\":[\"\",1775,\" \"],\"1781\":[\"\",1776,\" \"],\"1782\":[\"\",1777,\" \"],\"1783\":[\"\",1778,\" \"],\"1784\":[\"\",1779,\" \"],\"1785\":[\"\",1780,\" \"],\"1786\":[\"\",1781,\" \"],\"1787\":[\"\",1782,\" \"],\"1788\":[\"\",1783,\" \"],\"1789\":[\"\",1784,\" \"],\"1790\":[\"\",1785,\" \"],\"1791\":[\"\",1786,\" \"],\"1792\":[\"\",1787,\" \"],\"1793\":[\"\",1788,\" \"],\"1794\":[\"\",1789,\" \"],\"1795\":[\"\",1790,\" \"],\"1796\":[\"\",1791,\" \"],\"1797\":[\"\",1792,\" \"],\"1798\":[\"\",1793,\" \"],\"1799\":[\"\",1794,\" \"],\"1800\":[\"\",1795,\" \"],\"1801\":[\"\",1796,\" \"],\"1802\":[\"\",1797,\" \"],\"1803\":[\"\",1798,\" \"],\"1804\":[\"\",1799,\" \"],\"1805\":[\"\",1800,\" \"],\"1806\":[\"\",1801,\" \"],\"1807\":[\"\",1802,\" \"],\"1808\":[\"\",1803,\" \"],\"1809\":[\"\",1804,\" \"],\"1810\":[\"\",1805,\" \"],\"1811\":[\"\",1806,\" \"],\"1812\":[\"\",1807,\" \"],\"1813\":[\"\",1808,\" \"],\"1814\":[\"\",1809,\" \"],\"1815\":[\"\",1810,\" \"],\"1816\":[\"\",1811,\" \"],\"1817\":[\"\",1812,\" \"],\"1818\":[\"\",1813,\" \"],\"1819\":[\"\",1814,\" \"],\"1820\":[\"\",1815,\" \"],\"1821\":[\"\",1816,\" \"],\"1822\":[\"\",1817,\" \"],\"1823\":[\"\",1818,\" \"],\"1824\":[\"\",1819,\" \"],\"1825\":[\"\",1820,\" \"],\"1826\":[\"\",1821,\" \"],\"1827\":[\"\",1822,\" \"],\"1828\":[\"\",1823,\" \"],\"1829\":[\"\",1824,\" \"],\"1830\":[\"\",1825,\" \"],\"1831\":[\"\",1826,\" \"],\"1832\":[\"\",1827,\" \"],\"1833\":[\"\",1828,\" \"],\"1834\":[\"\",1829,\" \"],\"1835\":[\"\",1830,\" \"],\"1836\":[\"\",1831,\" \"],\"1837\":[\"\",1832,\" \"],\"1838\":[\"\",1833,\" \"],\"1839\":[\"\",1834,\" \"],\"1840\":[\"\",1835,\" \"],\"1841\":[\"\",1836,\" \"],\"1842\":[\"\",1837,\" \"],\"1843\":[\"\",1838,\" \"],\"1844\":[\"\",1839,\" \"],\"1845\":[\"\",1840,\" \"],\"1846\":[\"\",1841,\" \"],\"1847\":[\"\",1842,\" \"],\"1848\":[\"\",1843,\" \"],\"1849\":[\"\",1844,\" \"],\"1850\":[\"\",1845,\" \"],\"1851\":[\"\",1846,\" \"],\"1852\":[\"\",1847,\" \"],\"1853\":[\"\",1848,\" \"],\"1854\":[\"\",1849,\" \"],\"1855\":[\"\",1850,\" \"],\"1856\":[\"\",1851,\" \"],\"1857\":[\"\",1852,\" \"],\"1858\":[\"\",1853,\" \"],\"1859\":[\"\",1854,\" \"],\"1860\":[\"\",1855,\" \"],\"1861\":[\"\",1856,\" \"],\"1862\":[\"\",1857,\" \"],\"1863\":[\"\",1858,\" \"],\"1864\":[\"\",1859,\" \"],\"1865\":[\"\",1860,\" \"],\"1866\":[\"\",1861,\" \"],\"1867\":[\"\",1862,\" \"],\"1868\":[\"\",1863,\" \"],\"1869\":[\"\",1864,\" \"],\"1870\":[\"\",1865,\" \"],\"1871\":[\"\",1866,\" \"],\"1872\":[\"\",1867,\" \"],\"1873\":[\"\",1868,\" \"],\"1874\":[\"\",1869,\" \"],\"1875\":[\"\",1870,\" \"],\"1876\":[\"\",1871,\" \"],\"1877\":[\"\",1872,\" \"],\"1878\":[\"\",1873,\" \"],\"1879\":[\"\",1874,\" \"],\"1880\":[\"\",1875,\" \"],\"1881\":[\"\",1876,\" \"],\"1882\":[\"\",1877,\" \"],\"1883\":[\"\",1878,\" \"],\"1884\":[\"\",1879,\" \"],\"1885\":[\"\",1880,\" \"],\"1886\":[\"\",1881,\" \"],\"1887\":[\"\",1882,\" \"],\"1888\":[\"\",1883,\" \"],\"1889\":[\"\",1884,\" \"],\"1890\":[\"\",1885,\" \"],\"1891\":[\"\",1886,\" \"],\"1892\":[\"\",1887,\" \"],\"1893\":[\"\",1888,\" \"],\"1894\":[\"\",1889,\" \"],\"1895\":[\"\",1890,\" \"],\"1896\":[\"\",1891,\" \"],\"1897\":[\"\",1892,\" \"],\"1898\":[\"\",1893,\" \"],\"1899\":[\"\",1894,\" \"],\"1900\":[\"\",1895,\" \"],\"1901\":[\"\",1896,\" \"],\"1902\":[\"\",1897,\" \"],\"1903\":[\"\",1898,\" \"],\"1904\":[\"\",1899,\" \"],\"1905\":[\"\",1900,\" \"],\"1906\":[\"\",1901,\" \"],\"1907\":[\"\",1902,\" \"],\"1908\":[\"\",1903,\" \"],\"1909\":[\"\",1904,\" \"],\"1910\":[\"\",1905,\" \"],\"1911\":[\"\",1906,\" \"],\"1912\":[\"\",1907,\" \"],\"1913\":[\"\",1908,\" \"],\"1914\":[\"\",1909,\" \"],\"1915\":[\"\",1910,\" \"],\"1916\":[\"\",1911,\" \"],\"1917\":[\"\",1912,\" \"],\"1918\":[\"\",1913,\" \"],\"1919\":[\"\",1914,\" \"],\"1920\":[\"\",1915,\" \"],\"1921\":[\"\",1916,\" \"],\"1922\":[\"\",1917,\" \"],\"1923\":[\"\",1918,\" \"],\"1924\":[\"\",1919,\" \"],\"1925\":[\"\",1920,\" \"],\"1926\":[\"\",1921,\" \"],\"1927\":[\"\",1922,\" \"],\"1928\":[\"\",1923,\" \"],\"1929\":[\"\",1924,\" \"],\"1930\":[\"\",1925,\" \"],\"1931\":[\"\",1926,\" \"],\"1932\":[\"\",1927,\" \"],\"1933\":[\"\",1928,\" \"],\"1934\":[\"\",1929,\" \"],\"1935\":[\"\",1930,\" \"],\"1936\":[\"\",1931,\" \"],\"1937\":[\"\",1932,\" \"],\"1938\":[\"\",1933,\" \"],\"1939\":[\"\",1934,\" \"],\"1940\":[\"\",1935,\" \"],\"1941\":[\"\",1936,\" \"],\"1942\":[\"\",1937,\" \"],\"1943\":[\"\",1938,\" \"],\"1944\":[\"\",1939,\" \"],\"1945\":[\"\",1940,\" \"],\"1946\":[\"\",1941,\" \"],\"1947\":[\"\",1942,\" \"],\"1948\":[\"\",1943,\" \"],\"1949\":[\"\",1944,\" \"],\"1950\":[\"\",1945,\" \"],\"1951\":[\"\",1946,\" \"],\"1952\":[\"\",1947,\" \"],\"1953\":[\"\",1948,\" \"],\"1954\":[\"\",1949,\" \"],\"1955\":[\"\",1950,\" \"],\"1956\":[\"\",1951,\" \"],\"1957\":[\"\",1952,\" \"],\"1958\":[\"\",1953,\" \"],\"1959\":[\"\",1954,\" \"],\"1960\":[\"\",1955,\" \"],\"1961\":[\"\",1956,\" \"],\"1962\":[\"\",1957,\" \"],\"1963\":[\"\",1958,\" \"],\"1964\":[\"\",1959,\" \"],\"1965\":[\"\",1960,\" \"],\"1966\":[\"\",1961,\" \"],\"1967\":[\"\",1962,\" \"],\"1968\":[\"\",1963,\" \"],\"1969\":[\"\",1964,\" \"],\"1970\":[\"\",1965,\" \"],\"1971\":[\"\",1966,\" \"],\"1972\":[\"\",1967,\" \"],\"1973\":[\"\",1968,\" \"],\"1974\":[\"\",1969,\" \"],\"1975\":[\"\",1970,\" \"],\"1976\":[\"\",1971,\" \"],\"1977\":[\"\",1972,\" \"],\"1978\":[\"\",1973,\" \"],\"1979\":[\"\",1974,\" \"],\"1980\":[\"\",1975,\" \"],\"1981\":[\"\",1976,\" \"],\"1982\":[\"\",1977,\" \"],\"1983\":[\"\",1978,\" \"],\"1984\":[\"\",1979,\" \"],\"1985\":[\"\",1980,\" \"],\"1986\":[\"\",1981,\" \"],\"1987\":[\"\",1982,\" \"],\"1988\":[\"\",1983,\" \"],\"1989\":[\"\",1984,\" \"],\"1990\":[\"\",1985,\" \"],\"1991\":[\"\",1986,\" \"],\"1992\":[\"\",1987,\" \"],\"1993\":[\"\",1988,\" \"],\"1994\":[\"\",1989,\" \"],\"1995\":[\"\",1990,\" \"],\"1996\":[\"\",1991,\" \"],\"1997\":[\"\",1992,\" \"],\"1998\":[\"\",1993,\" \"],\"1999\":[\"\",1994,\" \"],\"2000\":[\"\",1995,\" \"],\"2001\":[\"\",1996,\" \"],\"2002\":[\"\",1997,\" \"],\"2003\":[\"\",1998,\" \"],\"2004\":[\"\",1999,\" \"],\"2005\":[\"\",2000,\" \"],\"2006\":[\"\",2001,\" \"],\"2007\":[\"\",2002,\" \"],\"2008\":[\"\",2003,\" \"],\"2009\":[\"\",2004,\" \"],\"2010\":[\"\",2005,\" \"],\"2011\":[\"\",2006,\" \"],\"2012\":[\"\",2007,\" \"],\"2013\":[\"\",2008,\" \"],\"2014\":[\"\",2009,\" \"],\"2015\":[\"\",2010,\" \"],\"2016\":[\"\",2011,\" \"],\"2017\":[\"\",2012,\" \"],\"2018\":[\"\",2013,\" \"],\"2019\":[\"\",2014,\" \"],\"2020\":[\"\",2015,\" \"],\"2021\":[\"\",2016,\" \"],\"2022\":[\"\",2017,\" \"],\"2023\":[\"\",2018,\" \"],\"2024\":[\"\",2019,\" \"],\"2025\":[\"\",2020,\" \"],\"2026\":[\"\",2021,\" \"],\"2027\":[\"\",2022,\" \"],\"2028\":[\"\",2023,\" \"],\"2029\":[\"\",2024,\" \"],\"2030\":[\"\",2025,\" \"],\"2031\":[\"\",2026,\" \"],\"2032\":[\"\",2027,\" \"],\"2033\":[\"\",2028,\" \"],\"2034\":[\"\",2029,\" \"],\"2035\":[\"\",2030,\" \"],\"2036\":[\"\",2031,\" \"],\"2037\":[\"\",2032,\" \"],\"2038\":[\"\",2033,\" \"],\"2039\":[\"\",2034,\" \"],\"2040\":[\"\",2035,\" \"],\"2041\":[\"\",2036,\" \"],\"2042\":[\"\",2037,\" \"],\"2043\":[\"\",2038,\" \"],\"2044\":[\"\",2039,\" \"],\"2045\":[\"\",2040,\" \"],\"2046\":[\"\",2041,\" \"],\"2047\":[\"\",2042,\" \"],\"2048\":[\"\",2043,\" \"],\"2049\":[\"\",2044,\" \"],\"2050\":[\"\",2045,\" \"],\"2051\":[\"\",2046,\" \"],\"2052\":[\"\",2047,\" \"],\"2053\":[\"\",2048,\" \"],\"2054\":[\"\",2049,\" \"],\"2055\":[\"\",2050,\" \"],\"2056\":[\"\",2051,\" \"],\"2057\":[\"\",2052,\" \"],\"2058\":[\"\",2053,\" \"],\"2059\":[\"\",2054,\" \"],\"2060\":[\"\",2055,\" \"],\"2061\":[\"\",2056,\" \"],\"2062\":[\"\",2057,\" \"],\"2063\":[\"\",2058,\" \"],\"2064\":[\"\",2059,\" \"],\"2065\":[\"\",2060,\" \"],\"2066\":[\"\",2061,\" \"],\"2067\":[\"\",2062,\" \"],\"2068\":[\"\",2063,\" \"],\"2069\":[\"\",2064,\" \"],\"2070\":[\"\",2065,\" \"],\"2071\":[\"\",2066,\" \"],\"2072\":[\"\",2067,\" \"],\"2073\":[\"\",2068,\" \"],\"2074\":[\"\",2069,\" \"],\"2075\":[\"\",2070,\" \"],\"2076\":[\"\",2071,\" \"],\"2077\":[\"\",2072,\" \"],\"2078\":[\"\",2073,\" \"],\"2079\":[\"\",2074,\" \"],\"2080\":[\"\",2075,\" \"],\"2081\":[\"\",2076,\" \"],\"2082\":[\"\",2077,\" \"],\"2083\":[\"\",2078,\" \"],\"2084\":[\"\",2079,\" \"],\"2085\":[\"\",2080,\" \"],\"2086\":[\"\",2081,\" \"],\"2087\":[\"\",2082,\" \"],\"2088\":[\"\",2083,\" \"],\"2089\":[\"\",2084,\" \"],\"2090\":[\"\",2085,\" \"],\"2091\":[\"\",2086,\" \"],\"2092\":[\"\",2087,\" \"],\"2093\":[\"\",2088,\" \"],\"2094\":[\"\",2089,\" \"],\"2095\":[\"\",2090,\" \"],\"2096\":[\"\",2091,\" \"],\"2097\":[\"\",2092,\" \"],\"2098\":[\"\",2093,\" \"],\"2099\":[\"\",2094,\" \"],\"2100\":[\"\",2095,\" \"],\"2101\":[\"\",2096,\" \"],\"2102\":[\"\",2097,\" \"],\"2103\":[\"\",2098,\" \"],\"2104\":[\"\",2099,\" \"],\"2105\":[\"\",2100,\" \"],\"2106\":[\"\",2101,\" \"],\"2107\":[\"\",2102,\" \"],\"2108\":[\"\",2103,\" \"],\"2109\":[\"\",2104,\" \"],\"2110\":[\"\",2105,\" \"],\"2111\":[\"\",2106,\" \"],\"2112\":[\"\",2107,\" \"],\"2113\":[\"\",2108,\" \"],\"2114\":[\"\",2109,\" \"],\"2115\":[\"\",2110,\" \"],\"2116\":[\"\",2111,\" \"],\"2117\":[\"\",2112,\" \"],\"2118\":[\"\",2113,\" \"],\"2119\":[\"\",2114,\" \"],\"2120\":[\"\",2115,\" \"],\"2121\":[\"\",2116,\" \"],\"2122\":[\"\",2117,\" \"],\"2123\":[\"\",2118,\" \"],\"2124\":[\"\",2119,\" \"],\"2125\":[\"\",2120,\" \"],\"2126\":[\"\",2121,\" \"],\"2127\":[\"\",2122,\" \"],\"2128\":[\"\",2123,\" \"],\"2129\":[\"\",2124,\" \"],\"2130\":[\"\",2125,\" \"],\"2131\":[\"\",2126,\" \"],\"2132\":[\"\",2127,\" \"],\"2133\":[\"\",2128,\" \"],\"2134\":[\"\",2129,\" \"],\"2135\":[\"\",2130,\" \"],\"2136\":[\"\",2131,\" \"],\"2137\":[\"\",2132,\" \"],\"2138\":[\"\",2133,\" \"],\"2139\":[\"\",2134,\" \"],\"2140\":[\"\",2135,\" \"],\"2141\":[\"\",2136,\" \"],\"2142\":[\"\",2137,\" \"],\"2143\":[\"\",2138,\" \"],\"2144\":[\"\",2139,\" \"],\"2145\":[\"\",2140,\" \"],\"2146\":[\"\",2141,\" \"],\"2147\":[\"\",2142,\" \"],\"2148\":[\"\",2143,\" \"],\"2149\":[\"\",2144,\" \"],\"2150\":[\"\",2145,\" \"],\"2151\":[\"\",2146,\" \"],\"2152\":[\"\",2147,\" \"],\"2153\":[\"\",2148,\" \"],\"2154\":[\"\",2149,\" \"],\"2155\":[\"\",2150,\" \"],\"2156\":[\"\",2151,\" \"],\"2157\":[\"\",2152,\" \"],\"2158\":[\"\",2153,\" \"],\"2159\":[\"\",2154,\" \"],\"2160\":[\"\",2155,\" \"],\"2161\":[\"\",2156,\" \"],\"2162\":[\"\",2157,\" \"],\"2163\":[\"\",2158,\" \"],\"2164\":[\"\",2159,\" \"],\"2165\":[\"\",2160,\" \"],\"2166\":[\"\",2161,\" \"],\"2167\":[\"\",2162,\" \"],\"2168\":[\"\",2163,\" \"],\"2169\":[\"\",2164,\" \"],\"2170\":[\"\",2165,\" \"],\"2171\":[\"\",2166,\" \"],\"2172\":[\"\",2167,\" \"],\"2173\":[\"\",2168,\" \"],\"2174\":[\"\",2169,\" \"],\"2175\":[\"\",2170,\" \"],\"2176\":[\"\",2171,\" \"],\"2177\":[\"\",2172,\" \"],\"2178\":[\"\",2173,\" \"],\"2179\":[\"\",2174,\" \"],\"2180\":[\"\",2175,\" \"],\"2181\":[\"\",2176,\" \"],\"2182\":[\"\",2177,\" \"],\"2183\":[\"\",2178,\" \"],\"2184\":[\"\",2179,\" \"],\"2185\":[\"\",2180,\" \"],\"2186\":[\"\",2181,\" \"],\"2187\":[\"\",2182,\" \"],\"2188\":[\"\",2183,\" \"],\"2189\":[\"\",2184,\" \"],\"2190\":[\"\",2185,\" \"],\"2191\":[\"\",2186,\" \"],\"2192\":[\"\",2187,\" \"],\"2193\":[\"\",2188,\" \"],\"2194\":[\"\",2189,\" \"],\"2195\":[\"\",2190,\" \"],\"2196\":[\"\",2191,\" \"],\"2197\":[\"\",2192,\" \"],\"2198\":[\"\",2193,\" \"],\"2199\":[\"\",2194,\" \"],\"2200\":[\"\",2195,\" \"],\"2201\":[\"\",2196,\" \"],\"2202\":[\"\",2197,\" \"],\"2203\":[\"\",2198,\" \"],\"2204\":[\"\",2199,\" \"],\"2205\":[\"\",2200,\" \"],\"2206\":[\"\",2201,\" \"],\"2207\":[\"\",2202,\" \"],\"2208\":[\"\",2203,\" \"],\"2209\":[\"\",2204,\" \"],\"2210\":[\"\",2205,\" \"],\"2211\":[\"\",2206,\" \"],\"2212\":[\"\",2207,\" \"],\"2213\":[\"\",2208,\" \"],\"2214\":[\"\",2209,\" \"],\"2215\":[\"\",2210,\" \"],\"2216\":[\"\",2211,\" \"],\"2217\":[\"\",2212,\" \"],\"2218\":[\"\",2213,\" \"],\"2219\":[\"\",2214,\" \"],\"2220\":[\"\",2215,\" \"],\"2221\":[\"\",2216,\" \"],\"2222\":[\"\",2217,\" \"],\"2223\":[\"\",2218,\" \"],\"2224\":[\"\",2219,\" \"],\"2225\":[\"\",2220,\" \"],\"2226\":[\"\",2221,\" \"],\"2227\":[\"\",2222,\" \"],\"2228\":[\"\",2223,\" \"],\"2229\":[\"\",2224,\" \"],\"2230\":[\"\",2225,\" \"],\"2231\":[\"\",2226,\" \"],\"2232\":[\"\",2227,\" \"],\"2233\":[\"\",2228,\" \"],\"2234\":[\"\",2229,\" \"],\"2235\":[\"\",2230,\" \"],\"2236\":[\"\",2231,\" \"],\"2237\":[\"\",2232,\" \"],\"2238\":[\"\",2233,\" \"],\"2239\":[\"\",2234,\" \"],\"2240\":[\"\",2235,\" \"],\"2241\":[\"\",2236,\" \"],\"2242\":[\"\",2237,\" \"],\"2243\":[\"\",2238,\" \"],\"2244\":[\"\",2239,\" \"],\"2245\":[\"\",2240,\" \"],\"2246\":[\"\",2241,\" \"],\"2247\":[\"\",2242,\" \"],\"2248\":[\"\",2243,\" \"],\"2249\":[\"\",2244,\" \"],\"2250\":[\"\",2245,\" \"],\"2251\":[\"\",2246,\" \"],\"2252\":[\"\",2247,\" \"],\"2253\":[\"\",2248,\" \"],\"2254\":[\"\",2249,\" \"],\"2255\":[\"\",2250,\" \"],\"2256\":[\"\",2251,\" \"],\"2257\":[\"\",2252,\" \"],\"2258\":[\"\",2253,\" \"],\"2259\":[\"\",2254,\" \"],\"2260\":[\"\",2255,\" \"],\"2261\":[\"\",2256,\" \"],\"2262\":[\"\",2257,\" \"],\"2263\":[\"\",2258,\" \"],\"2264\":[\"\",2259,\" \"],\"2265\":[\"\",2260,\" \"],\"2266\":[\"\",2261,\" \"],\"2267\":[\"\",2262,\" \"],\"2268\":[\"\",2263,\" \"],\"2269\":[\"\",2264,\" \"],\"2270\":[\"\",2265,\" \"],\"2271\":[\"\",2266,\" \"],\"2272\":[\"\",2267,\" \"],\"2273\":[\"\",2268,\" \"],\"2274\":[\"\",2269,\" \"],\"2275\":[\"\",2270,\" \"],\"2276\":[\"\",2271,\" \"],\"2277\":[\"\",2272,\" \"],\"2278\":[\"\",2273,\" \"],\"2279\":[\"\",2274,\" \"],\"2280\":[\"\",2275,\" \"],\"2281\":[\"\",2276,\" \"],\"2282\":[\"\",2277,\" \"],\"2283\":[\"\",2278,\" \"],\"2284\":[\"\",2279,\" \"],\"2285\":[\"\",2280,\" \"],\"2286\":[\"\",2281,\" \"],\"2287\":[\"\",2282,\" \"],\"2288\":[\"\",2283,\" \"],\"2289\":[\"\",2284,\" \"],\"2290\":[\"\",2285,\" \"],\"2291\":[\"\",2286,\" \"],\"2292\":[\"\",2287,\" \"],\"2293\":[\"\",2288,\" \"],\"2294\":[\"\",2289,\" \"],\"2295\":[\"\",2290,\" \"],\"2296\":[\"\",2291,\" \"],\"2297\":[\"\",2292,\" \"],\"2298\":[\"\",2293,\" \"],\"2299\":[\"\",2294,\" \"],\"2300\":[\"\",2295,\" \"],\"2301\":[\"\",2296,\" \"],\"2302\":[\"\",2297,\" \"],\"2303\":[\"\",2298,\" \"],\"2304\":[\"\",2299,\" \"],\"2305\":[\"\",2300,\" \"],\"2306\":[\"\",2301,\" \"],\"2307\":[\"\",2302,\" \"],\"2308\":[\"\",2303,\" \"],\"2309\":[\"\",2304,\" \"],\"2310\":[\"\",2305,\" \"],\"2311\":[\"\",2306,\" \"],\"2312\":[\"\",2307,\" \"],\"2313\":[\"\",2308,\" \"],\"2314\":[\"\",2309,\" \"],\"2315\":[\"\",2310,\" \"],\"2316\":[\"\",2311,\" \"],\"2317\":[\"\",2312,\" \"],\"2318\":[\"\",2313,\" \"],\"2319\":[\"\",2314,\" \"],\"2320\":[\"\",2315,\" \"],\"2321\":[\"\",2316,\" \"],\"2322\":[\"\",2317,\" \"],\"2323\":[\"\",2318,\" \"],\"2324\":[\"\",2319,\" \"],\"2325\":[\"\",2320,\" \"],\"2326\":[\"\",2321,\" \"],\"2327\":[\"\",2322,\" \"],\"2328\":[\"\",2323,\" \"],\"2329\":[\"\",2324,\" \"],\"2330\":[\"\",2325,\" \"],\"2331\":[\"\",2326,\" \"],\"2332\":[\"\",2327,\" \"],\"2333\":[\"\",2328,\" \"],\"2334\":[\"\",2329,\" \"],\"2335\":[\"\",2330,\" \"],\"2336\":[\"\",2331,\" \"],\"2337\":[\"\",2332,\" \"],\"2338\":[\"\",2333,\" \"],\"2339\":[\"\",2334,\" \"],\"2340\":[\"\",2335,\" \"],\"2341\":[\"\",2336,\" \"],\"2342\":[\"\",2337,\" \"],\"2343\":[\"\",2338,\" \"],\"2344\":[\"\",2339,\" \"],\"2345\":[\"\",2340,\" \"],\"2346\":[\"\",2341,\" \"],\"2347\":[\"\",2342,\" \"],\"2348\":[\"\",2343,\" \"],\"2349\":[\"\",2344,\" \"],\"2350\":[\"\",2345,\" \"],\"2351\":[\"\",2346,\" \"],\"2352\":[\"\",2347,\" \"],\"2353\":[\"\",2348,\" \"],\"2354\":[\"\",2349,\" \"],\"2355\":[\"\",2350,\" \"],\"2356\":[\"\",2351,\" \"],\"2357\":[\"\",2352,\" \"],\"2358\":[\"\",2353,\" \"],\"2359\":[\"\",2354,\" \"],\"2360\":[\"\",2355,\" \"],\"2361\":[\"\",2356,\" \"],\"2362\":[\"\",2357,\" \"],\"2363\":[\"\",2358,\" \"],\"2364\":[\"\",2359,\" \"],\"2365\":[\"\",2360,\" \"],\"2366\":[\"\",2361,\" \"],\"2367\":[\"\",2362,\" \"],\"2368\":[\"\",2363,\" \"],\"2369\":[\"\",2364,\" \"],\"2370\":[\"\",2365,\" \"],\"2371\":[\"\",2366,\" \"],\"2372\":[\"\",2367,\" \"],\"2373\":[\"\",2368,\" \"],\"2374\":[\"\",2369,\" \"],\"2375\":[\"\",2370,\" \"],\"2376\":[\"\",2371,\" \"],\"2377\":[\"\",2372,\" \"],\"2378\":[\"\",2373,\" \"],\"2379\":[\"\",2374,\" \"],\"2380\":[\"\",2375,\" \"],\"2381\":[\"\",2376,\" \"],\"2382\":[\"\",2377,\" \"],\"2383\":[\"\",2378,\" \"],\"2384\":[\"\",2379,\" \"],\"2385\":[\"\",2380,\" \"],\"2386\":[\"\",2381,\" \"],\"2387\":[\"\",2382,\" \"],\"2388\":[\"\",2383,\" \"],\"2389\":[\"\",2384,\" \"],\"2390\":[\"\",2385,\" \"],\"2391\":[\"\",2386,\" \"],\"2392\":[\"\",2387,\" \"],\"2393\":[\"\",2388,\" \"],\"2394\":[\"\",2389,\" \"],\"2395\":[\"\",2390,\" \"],\"2396\":[\"\",2391,\" \"],\"2397\":[\"\",2392,\" \"],\"2398\":[\"\",2393,\" \"],\"2399\":[\"\",2394,\" \"],\"2400\":[\"\",2395,\" \"],\"2401\":[\"\",2396,\" \"],\"2402\":[\"\",2397,\" \"],\"2403\":[\"\",2398,\" \"],\"2404\":[\"\",2399,\" \"],\"2405\":[\"\",2400,\" \"],\"2406\":[\"\",2401,\" \"],\"2407\":[\"\",2402,\" \"],\"2408\":[\"\",2403,\" \"],\"2409\":[\"\",2404,\" \"],\"2410\":[\"\",2405,\" \"],\"2411\":[\"\",2406,\" \"],\"2412\":[\"\",2407,\" \"],\"2413\":[\"\",2408,\" \"],\"2414\":[\"\",2409,\" \"],\"2415\":[\"\",2410,\" \"],\"2416\":[\"\",2411,\" \"],\"2417\":[\"\",2412,\" \"],\"2418\":[\"\",2413,\" \"],\"2419\":[\"\",2414,\" \"],\"2420\":[\"\",2415,\" \"],\"2421\":[\"\",2416,\" \"],\"2422\":[\"\",2417,\" \"],\"2423\":[\"\",2418,\" \"],\"2424\":[\"\",2419,\" \"],\"2425\":[\"\",2420,\" \"],\"2426\":[\"\",2421,\" \"],\"2427\":[\"\",2422,\" \"],\"2428\":[\"\",2423,\" \"],\"2429\":[\"\",2424,\" \"],\"2430\":[\"\",2425,\" \"],\"2431\":[\"\",2426,\" \"],\"2432\":[\"\",2427,\" \"],\"2433\":[\"\",2428,\" \"],\"2434\":[\"\",2429,\" \"],\"2435\":[\"\",2430,\" \"],\"2436\":[\"\",2431,\" \"],\"2437\":[\"\",2432,\" \"],\"2438\":[\"\",2433,\" \"],\"2439\":[\"\",2434,\" \"],\"2440\":[\"\",2435,\" \"],\"2441\":[\"\",2436,\" \"],\"2442\":[\"\",2437,\" \"],\"2443\":[\"\",2438,\" \"],\"2444\":[\"\",2439,\" \"],\"2445\":[\"\",2440,\" \"],\"2446\":[\"\",2441,\" \"],\"2447\":[\"\",2442,\" \"],\"2448\":[\"\",2443,\" \"],\"2449\":[\"\",2444,\" \"],\"2450\":[\"\",2445,\" \"],\"2451\":[\"\",2446,\" \"],\"2452\":[\"\",2447,\" \"],\"2453\":[\"\",2448,\" \"],\"2454\":[\"\",2449,\" \"],\"2455\":[\"\",2450,\" \"],\"2456\":[\"\",2451,\" \"],\"2457\":[\"\",2452,\" \"],\"2458\":[\"\",2453,\" \"],\"2459\":[\"\",2454,\" \"],\"2460\":[\"\",2455,\" \"],\"2461\":[\"\",2456,\" \"],\"2462\":[\"\",2457,\" \"],\"2463\":[\"\",2458,\" \"],\"2464\":[\"\",2459,\" \"],\"2465\":[\"\",2460,\" \"],\"2466\":[\"\",2461,\" \"],\"2467\":[\"\",2462,\" \"],\"2468\":[\"\",2463,\" \"],\"2469\":[\"\",2464,\" \"],\"2470\":[\"\",2465,\" \"],\"2471\":[\"\",2466,\" \"],\"2472\":[\"\",2467,\" \"],\"2473\":[\"\",2468,\" \"],\"2474\":[\"\",2469,\" \"],\"2475\":[\"\",2470,\" \"],\"2476\":[\"\",2471,\" \"],\"2477\":[\"\",2472,\" \"],\"2478\":[\"\",2473,\" \"],\"2479\":[\"\",2474,\" \"],\"2480\":[\"\",2475,\" \"],\"2481\":[\"\",2476,\" \"],\"2482\":[\"\",2477,\" \"],\"2483\":[\"\",2478,\" \"],\"2484\":[\"\",2479,\" \"],\"2485\":[\"\",2480,\" \"],\"2486\":[\"\",2481,\" \"],\"2487\":[\"\",2482,\" \"],\"2488\":[\"\",2483,\" \"],\"2489\":[\"\",2484,\" \"],\"2490\":[\"\",2485,\" \"],\"2491\":[\"\",2486,\" \"],\"2492\":[\"\",2487,\" \"],\"2493\":[\"\",2488,\" \"],\"2494\":[\"\",2489,\" \"],\"2495\":[\"\",2490,\" \"],\"2496\":[\"\",2491,\" \"],\"2497\":[\"\",2492,\" \"],\"2498\":[\"\",2493,\" \"],\"2499\":[\"\",2494,\" \"],\"2500\":[\"\",2495,\" \"],\"2501\":[\"\",2496,\" \"],\"2502\":[\"\",2497,\" \"],\"2503\":[\"\",2498,\" \"],\"2504\":[\"\",2499,\" \"],\"2505\":[\"\",2500,\" \"],\"2506\":[\"\",2501,\" \"],\"2507\":[\"\",2502,\" \"],\"2508\":[\"\",2503,\" \"],\"2509\":[\"\",2504,\" \"],\"2510\":[\"\",2505,\" \"],\"2511\":[\"\",2506,\" \"],\"2512\":[\"\",2507,\" \"],\"2513\":[\"\",2508,\" \"],\"2514\":[\"\",2509,\" \"],\"2515\":[\"\",2510,\" \"],\"2516\":[\"\",2511,\" \"],\"2517\":[\"\",2512,\" \"],\"2518\":[\"\",2513,\" \"],\"2519\":[\"\",2514,\" \"],\"2520\":[\"\",2515,\" \"],\"2521\":[\"\",2516,\" \"],\"2522\":[\"\",2517,\" \"],\"2523\":[\"\",2518,\" \"],\"2524\":[\"\",2519,\" \"],\"2525\":[\"\",2520,\" \"],\"2526\":[\"\",2521,\" \"],\"2527\":[\"\",2522,\" \"],\"2528\":[\"\",2523,\" \"],\"2529\":[\"\",2524,\" \"],\"2530\":[\"\",2525,\" \"],\"2531\":[\"\",2526,\" \"],\"2532\":[\"\",2527,\" \"],\"2533\":[\"\",2528,\" \"],\"2534\":[\"\",2529,\" \"],\"2535\":[\"\",2530,\" \"],\"2536\":[\"\",2531,\" \"],\"2537\":[\"\",2532,\" \"],\"2538\":[\"\",2533,\" \"],\"2539\":[\"\",2534,\" \"],\"2540\":[\"\",2535,\" \"],\"2541\":[\"\",2536,\" \"],\"2542\":[\"\",2537,\" \"],\"2543\":[\"\",2538,\" \"],\"2544\":[\"\",2539,\" \"],\"2545\":[\"\",2540,\" \"],\"2546\":[\"\",2541,\" \"],\"2547\":[\"\",2542,\" \"],\"2548\":[\"\",2543,\" \"],\"2549\":[\"\",2544,\" \"],\"2550\":[\"\",2545,\" \"],\"2551\":[\"\",2546,\" \"],\"2552\":[\"\",2547,\" \"],\"2553\":[\"\",2548,\" \"],\"2554\":[\"\",2549,\" \"],\"2555\":[\"\",2550,\" \"],\"2556\":[\"\",2551,\" \"],\"2557\":[\"\",2552,\" \"],\"2558\":[\"\",2553,\" \"],\"2559\":[\"\",2554,\" \"],\"2560\":[\"\",2555,\" \"],\"2561\":[\"\",2556,\" \"],\"2562\":[\"\",2557,\" \"],\"2563\":[\"\",2558,\" \"],\"2564\":[\"\",2559,\" \"],\"2565\":[\"\",2560,\" \"],\"2566\":[\"\",2561,\" \"],\"2567\":[\"\",2562,\" \"],\"2568\":[\"\",2563,\" \"],\"2569\":[\"\",2564,\" \"],\"2570\":[\"\",2565,\" \"],\"2571\":[\"\",2566,\" \"],\"2572\":[\"\",2567,\" \"],\"2573\":[\"\",2568,\" \"],\"2574\":[\"\",2569,\" \"],\"2575\":[\"\",2570,\" \"],\"2576\":[\"\",2571,\" \"],\"2577\":[\"\",2572,\" \"],\"2578\":[\"\",2573,\" \"],\"2579\":[\"\",2574,\" \"],\"2580\":[\"\",2575,\" \"],\"2581\":[\"\",2576,\" \"],\"2582\":[\"\",2577,\" \"],\"2583\":[\"\",2578,\" \"],\"2584\":[\"\",2579,\" \"],\"2585\":[\"\",2580,\" \"],\"2586\":[\"\",2581,\" \"],\"2587\":[\"\",2582,\" \"],\"2588\":[\"\",2583,\" \"],\"2589\":[\"\",2584,\" \"],\"2590\":[\"\",2585,\" \"],\"2591\":[\"\",2586,\" \"],\"2592\":[\"\",2587,\" \"],\"2593\":[\"\",2588,\" \"],\"2594\":[\"\",2589,\" \"],\"2595\":[\"\",2590,\" \"],\"2596\":[\"\",2591,\" \"],\"2597\":[\"\",2592,\" \"],\"2598\":[\"\",2593,\" \"],\"2599\":[\"\",2594,\" \"],\"2600\":[\"\",2595,\" \"],\"2601\":[\"\",2596,\" \"],\"2602\":[\"\",2597,\" \"],\"2603\":[\"\",2598,\" \"],\"2604\":[\"\",2599,\" \"],\"2605\":[\"\",2600,\" \"],\"2606\":[\"\",2601,\" \"],\"2607\":[\"\",2602,\" \"],\"2608\":[\"\",2603,\" \"],\"2609\":[\"\",2604,\" \"],\"2610\":[\"\",2605,\" \"],\"2611\":[\"\",2606,\" \"],\"2612\":[\"\",2607,\" \"],\"2613\":[\"\",2608,\" \"],\"2614\":[\"\",2609,\" \"],\"2615\":[\"\",2610,\" \"],\"2616\":[\"\",2611,\" \"],\"2617\":[\"\",2612,\" \"],\"2618\":[\"\",2613,\" \"],\"2619\":[\"\",2614,\" \"],\"2620\":[\"\",2615,\" \"],\"2621\":[\"\",2616,\" \"],\"2622\":[\"\",2617,\" \"],\"2623\":[\"\",2618,\" \"],\"2624\":[\"\",2619,\" \"],\"2625\":[\"\",2620,\" \"],\"2626\":[\"\",2621,\" \"],\"2627\":[\"\",2622,\" \"],\"2628\":[\"\",2623,\" \"],\"2629\":[\"\",2624,\" \"],\"2630\":[\"\",2625,\" \"],\"2631\":[\"\",2626,\" \"],\"2632\":[\"\",2627,\" \"],\"2633\":[\"\",2628,\" \"],\"2634\":[\"\",2629,\" \"],\"2635\":[\"\",2630,\" \"],\"2636\":[\"\",2631,\" \"],\"2637\":[\"\",2632,\" \"],\"2638\":[\"\",2633,\" \"],\"2639\":[\"\",2634,\" \"],\"2640\":[\"\",2635,\" \"],\"2641\":[\"\",2636,\" \"],\"2642\":[\"\",2637,\" \"],\"2643\":[\"\",2638,\" \"],\"2644\":[\"\",2639,\" \"],\"2645\":[\"\",2640,\" \"],\"2646\":[\"\",2641,\" \"],\"2647\":[\"\",2642,\" \"],\"2648\":[\"\",2643,\" \"],\"2649\":[\"\",2644,\" \"]}},\"oldPath\":\"mercurial\\/exchange.py\",\"currentPath\":\"mercurial\\/exchange.py\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"16\",\"delLines\":\"11\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"2644\",\"newLength\":\"2649\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\" # exchange.py - utility to exchange data between repos.\\n #\\n # Copyright 2005-2007 Matt Mackall \\u003cmpm@selenic.com\\u003e\\n #\\n # This software may be used and distributed according to the terms of the\\n # GNU General Public License version 2 or any later version.\\n \\n from __future__ import absolute_import\\n \\n import collections\\n import hashlib\\n \\n from .i18n import _\\n from .node import (\\n bin,\\n hex,\\n nullid,\\n nullrev,\\n )\\n from .thirdparty import (\\n attr,\\n )\\n from . import (\\n bookmarks as bookmod,\\n bundle2,\\n changegroup,\\n discovery,\\n error,\\n+ exchangev2,\\n lock as lockmod,\\n logexchange,\\n narrowspec,\\n obsolete,\\n phases,\\n pushkey,\\n pycompat,\\n repository,\\n scmutil,\\n sslutil,\\n streamclone,\\n url as urlmod,\\n util,\\n )\\n from .utils import (\\n stringutil,\\n )\\n \\n urlerr = util.urlerr\\n urlreq = util.urlreq\\n \\n _NARROWACL_SECTION = 'narrowhgacl'\\n \\n # Maps bundle version human names to changegroup versions.\\n _bundlespeccgversions = {'v1': '01',\\n 'v2': '02',\\n 'packed1': 's1',\\n 'bundle2': '02', #legacy\\n }\\n \\n # Maps bundle version with content opts to choose which part to bundle\\n _bundlespeccontentopts = {\\n 'v1': {\\n 'changegroup': True,\\n 'cg.version': '01',\\n 'obsolescence': False,\\n 'phases': False,\\n 'tagsfnodescache': False,\\n 'revbranchcache': False\\n },\\n 'v2': {\\n 'changegroup': True,\\n 'cg.version': '02',\\n 'obsolescence': False,\\n 'phases': False,\\n 'tagsfnodescache': True,\\n 'revbranchcache': True\\n },\\n 'packed1' : {\\n 'cg.version': 's1'\\n }\\n }\\n _bundlespeccontentopts['bundle2'] = _bundlespeccontentopts['v2']\\n \\n _bundlespecvariants = {\\\"streamv2\\\": {\\\"changegroup\\\": False, \\\"streamv2\\\": True,\\n \\\"tagsfnodescache\\\": False,\\n \\\"revbranchcache\\\": False}}\\n \\n # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE.\\n _bundlespecv1compengines = {'gzip', 'bzip2', 'none'}\\n \\n @attr.s\\n class bundlespec(object):\\n compression = attr.ib()\\n wirecompression = attr.ib()\\n version = attr.ib()\\n wireversion = attr.ib()\\n params = attr.ib()\\n contentopts = attr.ib()\\n \\n def parsebundlespec(repo, spec, strict=True):\\n \\\"\\\"\\\"Parse a bundle string specification into parts.\\n \\n Bundle specifications denote a well-defined bundle\\/exchange format.\\n The content of a given specification should not change over time in\\n order to ensure that bundles produced by a newer version of Mercurial are\\n readable from an older version.\\n \\n The string currently has the form:\\n \\n \\u003ccompression\\u003e-\\u003ctype\\u003e[;\\u003cparameter0\\u003e[;\\u003cparameter1\\u003e]]\\n \\n Where \\u003ccompression\\u003e is one of the supported compression formats\\n and \\u003ctype\\u003e is (currently) a version string. A \\\";\\\" can follow the type and\\n all text afterwards is interpreted as URI encoded, \\\";\\\" delimited key=value\\n pairs.\\n \\n If ``strict`` is True (the default) \\u003ccompression\\u003e is required. Otherwise,\\n it is optional.\\n \\n Returns a bundlespec object of (compression, version, parameters).\\n Compression will be ``None`` if not in strict mode and a compression isn't\\n defined.\\n \\n An ``InvalidBundleSpecification`` is raised when the specification is\\n not syntactically well formed.\\n \\n An ``UnsupportedBundleSpecification`` is raised when the compression or\\n bundle type\\/version is not recognized.\\n \\n Note: this function will likely eventually return a more complex data\\n structure, including bundle2 part information.\\n \\\"\\\"\\\"\\n def parseparams(s):\\n if ';' not in s:\\n return s, {}\\n \\n params = {}\\n version, paramstr = s.split(';', 1)\\n \\n for p in paramstr.split(';'):\\n if '=' not in p:\\n raise error.InvalidBundleSpecification(\\n _('invalid bundle specification: '\\n 'missing \\\"=\\\" in parameter: %s') % p)\\n \\n key, value = p.split('=', 1)\\n key = urlreq.unquote(key)\\n value = urlreq.unquote(value)\\n params[key] = value\\n \\n return version, params\\n \\n \\n if strict and '-' not in spec:\\n raise error.InvalidBundleSpecification(\\n _('invalid bundle specification; '\\n 'must be prefixed with compression: %s') % spec)\\n \\n if '-' in spec:\\n compression, version = spec.split('-', 1)\\n \\n if compression not in util.compengines.supportedbundlenames:\\n raise error.UnsupportedBundleSpecification(\\n _('%s compression is not supported') % compression)\\n \\n version, params = parseparams(version)\\n \\n if version not in _bundlespeccgversions:\\n raise error.UnsupportedBundleSpecification(\\n _('%s is not a recognized bundle version') % version)\\n else:\\n # Value could be just the compression or just the version, in which\\n # case some defaults are assumed (but only when not in strict mode).\\n assert not strict\\n \\n spec, params = parseparams(spec)\\n \\n if spec in util.compengines.supportedbundlenames:\\n compression = spec\\n version = 'v1'\\n # Generaldelta repos require v2.\\n if 'generaldelta' in repo.requirements:\\n version = 'v2'\\n # Modern compression engines require v2.\\n if compression not in _bundlespecv1compengines:\\n version = 'v2'\\n elif spec in _bundlespeccgversions:\\n if spec == 'packed1':\\n compression = 'none'\\n else:\\n compression = 'bzip2'\\n version = spec\\n else:\\n raise error.UnsupportedBundleSpecification(\\n _('%s is not a recognized bundle specification') % spec)\\n \\n # Bundle version 1 only supports a known set of compression engines.\\n if version == 'v1' and compression not in _bundlespecv1compengines:\\n raise error.UnsupportedBundleSpecification(\\n _('compression engine %s is not supported on v1 bundles') %\\n compression)\\n \\n # The specification for packed1 can optionally declare the data formats\\n # required to apply it. If we see this metadata, compare against what the\\n # repo supports and error if the bundle isn't compatible.\\n if version == 'packed1' and 'requirements' in params:\\n requirements = set(params['requirements'].split(','))\\n missingreqs = requirements - repo.supportedformats\\n if missingreqs:\\n raise error.UnsupportedBundleSpecification(\\n _('missing support for repository features: %s') %\\n ', '.join(sorted(missingreqs)))\\n \\n # Compute contentopts based on the version\\n contentopts = _bundlespeccontentopts.get(version, {}).copy()\\n \\n # Process the variants\\n if \\\"stream\\\" in params and params[\\\"stream\\\"] == \\\"v2\\\":\\n variant = _bundlespecvariants[\\\"streamv2\\\"]\\n contentopts.update(variant)\\n \\n engine = util.compengines.forbundlename(compression)\\n compression, wirecompression = engine.bundletype()\\n wireversion = _bundlespeccgversions[version]\\n \\n return bundlespec(compression, wirecompression, version, wireversion,\\n params, contentopts)\\n \\n def readbundle(ui, fh, fname, vfs=None):\\n header = changegroup.readexactly(fh, 4)\\n \\n alg = None\\n if not fname:\\n fname = \\\"stream\\\"\\n if not header.startswith('HG') and header.startswith('\\\\0'):\\n fh = changegroup.headerlessfixup(fh, header)\\n header = \\\"HG10\\\"\\n alg = 'UN'\\n elif vfs:\\n fname = vfs.join(fname)\\n \\n magic, version = header[0:2], header[2:4]\\n \\n if magic != 'HG':\\n raise error.Abort(_('%s: not a Mercurial bundle') % fname)\\n if version == '10':\\n if alg is None:\\n alg = changegroup.readexactly(fh, 2)\\n return changegroup.cg1unpacker(fh, alg)\\n elif version.startswith('2'):\\n return bundle2.getunbundler(ui, fh, magicstring=magic + version)\\n elif version == 'S1':\\n return streamclone.streamcloneapplier(fh)\\n else:\\n raise error.Abort(_('%s: unknown bundle version %s') % (fname, version))\\n \\n def getbundlespec(ui, fh):\\n \\\"\\\"\\\"Infer the bundlespec from a bundle file handle.\\n \\n The input file handle is seeked and the original seek position is not\\n restored.\\n \\\"\\\"\\\"\\n def speccompression(alg):\\n try:\\n return util.compengines.forbundletype(alg).bundletype()[0]\\n except KeyError:\\n return None\\n \\n b = readbundle(ui, fh, None)\\n if isinstance(b, changegroup.cg1unpacker):\\n alg = b._type\\n if alg == '_truncatedBZ':\\n alg = 'BZ'\\n comp = speccompression(alg)\\n if not comp:\\n raise error.Abort(_('unknown compression algorithm: %s') % alg)\\n return '%s-v1' % comp\\n elif isinstance(b, bundle2.unbundle20):\\n if 'Compression' in b.params:\\n comp = speccompression(b.params['Compression'])\\n if not comp:\\n raise error.Abort(_('unknown compression algorithm: %s') % comp)\\n else:\\n comp = 'none'\\n \\n version = None\\n for part in b.iterparts():\\n if part.type == 'changegroup':\\n version = part.params['version']\\n if version in ('01', '02'):\\n version = 'v2'\\n else:\\n raise error.Abort(_('changegroup version %s does not have '\\n 'a known bundlespec') % version,\\n hint=_('try upgrading your Mercurial '\\n 'client'))\\n elif part.type == 'stream2' and version is None:\\n # A stream2 part requires to be part of a v2 bundle\\n version = \\\"v2\\\"\\n requirements = urlreq.unquote(part.params['requirements'])\\n splitted = requirements.split()\\n params = bundle2._formatrequirementsparams(splitted)\\n return 'none-v2;stream=v2;%s' % params\\n \\n if not version:\\n raise error.Abort(_('could not identify changegroup version in '\\n 'bundle'))\\n \\n return '%s-%s' % (comp, version)\\n elif isinstance(b, streamclone.streamcloneapplier):\\n requirements = streamclone.readbundle1header(fh)[2]\\n formatted = bundle2._formatrequirementsparams(requirements)\\n return 'none-packed1;%s' % formatted\\n else:\\n raise error.Abort(_('unknown bundle type: %s') % b)\\n \\n def _computeoutgoing(repo, heads, common):\\n \\\"\\\"\\\"Computes which revs are outgoing given a set of common\\n and a set of heads.\\n \\n This is a separate function so extensions can have access to\\n the logic.\\n \\n Returns a discovery.outgoing object.\\n \\\"\\\"\\\"\\n cl = repo.changelog\\n if common:\\n hasnode = cl.hasnode\\n common = [n for n in common if hasnode(n)]\\n else:\\n common = [nullid]\\n if not heads:\\n heads = cl.heads()\\n return discovery.outgoing(repo, common, heads)\\n \\n def _forcebundle1(op):\\n \\\"\\\"\\\"return true if a pull\\/push must use bundle1\\n \\n This function is used to allow testing of the older bundle version\\\"\\\"\\\"\\n ui = op.repo.ui\\n # The goal is this config is to allow developer to choose the bundle\\n # version used during exchanged. This is especially handy during test.\\n # Value is a list of bundle version to be picked from, highest version\\n # should be used.\\n #\\n # developer config: devel.legacy.exchange\\n exchange = ui.configlist('devel', 'legacy.exchange')\\n forcebundle1 = 'bundle2' not in exchange and 'bundle1' in exchange\\n return forcebundle1 or not op.remote.capable('bundle2')\\n \\n class pushoperation(object):\\n \\\"\\\"\\\"A object that represent a single push operation\\n \\n Its purpose is to carry push related state and very common operations.\\n \\n A new pushoperation should be created at the beginning of each push and\\n discarded afterward.\\n \\\"\\\"\\\"\\n \\n def __init__(self, repo, remote, force=False, revs=None, newbranch=False,\\n bookmarks=(), pushvars=None):\\n # repo we push from\\n self.repo = repo\\n self.ui = repo.ui\\n # repo we push to\\n self.remote = remote\\n # force option provided\\n self.force = force\\n # revs to be pushed (None is \\\"all\\\")\\n self.revs = revs\\n # bookmark explicitly pushed\\n self.bookmarks = bookmarks\\n # allow push of new branch\\n self.newbranch = newbranch\\n # step already performed\\n # (used to check what steps have been already performed through bundle2)\\n self.stepsdone = set()\\n # Integer version of the changegroup push result\\n # - None means nothing to push\\n # - 0 means HTTP error\\n # - 1 means we pushed and remote head count is unchanged *or*\\n # we have outgoing changesets but refused to push\\n # - other values as described by addchangegroup()\\n self.cgresult = None\\n # Boolean value for the bookmark push\\n self.bkresult = None\\n # discover.outgoing object (contains common and outgoing data)\\n self.outgoing = None\\n # all remote topological heads before the push\\n self.remoteheads = None\\n # Details of the remote branch pre and post push\\n #\\n # mapping: {'branch': ([remoteheads],\\n # [newheads],\\n # [unsyncedheads],\\n # [discardedheads])}\\n # - branch: the branch name\\n # - remoteheads: the list of remote heads known locally\\n # None if the branch is new\\n # - newheads: the new remote heads (known locally) with outgoing pushed\\n # - unsyncedheads: the list of remote heads unknown locally.\\n # - discardedheads: the list of remote heads made obsolete by the push\\n self.pushbranchmap = None\\n # testable as a boolean indicating if any nodes are missing locally.\\n self.incoming = None\\n # summary of the remote phase situation\\n self.remotephases = None\\n # phases changes that must be pushed along side the changesets\\n self.outdatedphases = None\\n # phases changes that must be pushed if changeset push fails\\n self.fallbackoutdatedphases = None\\n # outgoing obsmarkers\\n self.outobsmarkers = set()\\n # outgoing bookmarks\\n self.outbookmarks = []\\n # transaction manager\\n self.trmanager = None\\n # map { pushkey partid -\\u003e callback handling failure}\\n # used to handle exception from mandatory pushkey part failure\\n self.pkfailcb = {}\\n # an iterable of pushvars or None\\n self.pushvars = pushvars\\n \\n @util.propertycache\\n def futureheads(self):\\n \\\"\\\"\\\"future remote heads if the changeset push succeeds\\\"\\\"\\\"\\n return self.outgoing.missingheads\\n \\n @util.propertycache\\n def fallbackheads(self):\\n \\\"\\\"\\\"future remote heads if the changeset push fails\\\"\\\"\\\"\\n if self.revs is None:\\n # not target to push, all common are relevant\\n return self.outgoing.commonheads\\n unfi = self.repo.unfiltered()\\n # I want cheads = heads(::missingheads and ::commonheads)\\n # (missingheads is revs with secret changeset filtered out)\\n #\\n # This can be expressed as:\\n # cheads = ( (missingheads and ::commonheads)\\n # + (commonheads and ::missingheads))\\\"\\n # )\\n #\\n # while trying to push we already computed the following:\\n # common = (::commonheads)\\n # missing = ((commonheads::missingheads) - commonheads)\\n #\\n # We can pick:\\n # * missingheads part of common (::commonheads)\\n common = self.outgoing.common\\n nm = self.repo.changelog.nodemap\\n cheads = [node for node in self.revs if nm[node] in common]\\n # and\\n # * commonheads parents on missing\\n revset = unfi.set('%ln and parents(roots(%ln))',\\n self.outgoing.commonheads,\\n self.outgoing.missing)\\n cheads.extend(c.node() for c in revset)\\n return cheads\\n \\n @property\\n def commonheads(self):\\n \\\"\\\"\\\"set of all common heads after changeset bundle push\\\"\\\"\\\"\\n if self.cgresult:\\n return self.futureheads\\n else:\\n return self.fallbackheads\\n \\n # mapping of message used when pushing bookmark\\n bookmsgmap = {'update': (_(\\\"updating bookmark %s\\\\n\\\"),\\n _('updating bookmark %s failed!\\\\n')),\\n 'export': (_(\\\"exporting bookmark %s\\\\n\\\"),\\n _('exporting bookmark %s failed!\\\\n')),\\n 'delete': (_(\\\"deleting remote bookmark %s\\\\n\\\"),\\n _('deleting remote bookmark %s failed!\\\\n')),\\n }\\n \\n \\n def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=(),\\n opargs=None):\\n '''Push outgoing changesets (limited by revs) from a local\\n repository to remote. Return an integer:\\n - None means nothing to push\\n - 0 means HTTP error\\n - 1 means we pushed and remote head count is unchanged *or*\\n we have outgoing changesets but refused to push\\n - other values as described by addchangegroup()\\n '''\\n if opargs is None:\\n opargs = {}\\n pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks,\\n **pycompat.strkwargs(opargs))\\n if pushop.remote.local():\\n missing = (set(pushop.repo.requirements)\\n - pushop.remote.local().supported)\\n if missing:\\n msg = _(\\\"required features are not\\\"\\n \\\" supported in the destination:\\\"\\n \\\" %s\\\") % (', '.join(sorted(missing)))\\n raise error.Abort(msg)\\n \\n if not pushop.remote.canpush():\\n raise error.Abort(_(\\\"destination does not support push\\\"))\\n \\n if not pushop.remote.capable('unbundle'):\\n raise error.Abort(_('cannot push: destination does not support the '\\n 'unbundle wire protocol command'))\\n \\n # get lock as we might write phase data\\n wlock = lock = None\\n try:\\n # bundle2 push may receive a reply bundle touching bookmarks or other\\n # things requiring the wlock. Take it now to ensure proper ordering.\\n maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback')\\n if (not _forcebundle1(pushop)) and maypushback:\\n wlock = pushop.repo.wlock()\\n lock = pushop.repo.lock()\\n pushop.trmanager = transactionmanager(pushop.repo,\\n 'push-response',\\n pushop.remote.url())\\n except error.LockUnavailable as err:\\n # source repo cannot be locked.\\n # We do not abort the push, but just disable the local phase\\n # synchronisation.\\n msg = 'cannot lock source repository: %s\\\\n' % err\\n pushop.ui.debug(msg)\\n \\n with wlock or util.nullcontextmanager(), \\\\\\n lock or util.nullcontextmanager(), \\\\\\n pushop.trmanager or util.nullcontextmanager():\\n pushop.repo.checkpush(pushop)\\n _pushdiscovery(pushop)\\n if not _forcebundle1(pushop):\\n _pushbundle2(pushop)\\n _pushchangeset(pushop)\\n _pushsyncphase(pushop)\\n _pushobsolete(pushop)\\n _pushbookmark(pushop)\\n \\n if repo.ui.configbool('experimental', 'remotenames'):\\n logexchange.pullremotenames(repo, remote)\\n \\n return pushop\\n \\n # list of steps to perform discovery before push\\n pushdiscoveryorder = []\\n \\n # Mapping between step name and function\\n #\\n # This exists to help extensions wrap steps if necessary\\n pushdiscoverymapping = {}\\n \\n def pushdiscovery(stepname):\\n \\\"\\\"\\\"decorator for function performing discovery before push\\n \\n The function is added to the step -\\u003e function mapping and appended to the\\n list of steps. Beware that decorated function will be added in order (this\\n may matter).\\n \\n You can only use this decorator for a new step, if you want to wrap a step\\n from an extension, change the pushdiscovery dictionary directly.\\\"\\\"\\\"\\n def dec(func):\\n assert stepname not in pushdiscoverymapping\\n pushdiscoverymapping[stepname] = func\\n pushdiscoveryorder.append(stepname)\\n return func\\n return dec\\n \\n def _pushdiscovery(pushop):\\n \\\"\\\"\\\"Run all discovery steps\\\"\\\"\\\"\\n for stepname in pushdiscoveryorder:\\n step = pushdiscoverymapping[stepname]\\n step(pushop)\\n \\n @pushdiscovery('changeset')\\n def _pushdiscoverychangeset(pushop):\\n \\\"\\\"\\\"discover the changeset that need to be pushed\\\"\\\"\\\"\\n fci = discovery.findcommonincoming\\n if pushop.revs:\\n commoninc = fci(pushop.repo, pushop.remote, force=pushop.force,\\n ancestorsof=pushop.revs)\\n else:\\n commoninc = fci(pushop.repo, pushop.remote, force=pushop.force)\\n common, inc, remoteheads = commoninc\\n fco = discovery.findcommonoutgoing\\n outgoing = fco(pushop.repo, pushop.remote, onlyheads=pushop.revs,\\n commoninc=commoninc, force=pushop.force)\\n pushop.outgoing = outgoing\\n pushop.remoteheads = remoteheads\\n pushop.incoming = inc\\n \\n @pushdiscovery('phase')\\n def _pushdiscoveryphase(pushop):\\n \\\"\\\"\\\"discover the phase that needs to be pushed\\n \\n (computed for both success and failure case for changesets push)\\\"\\\"\\\"\\n outgoing = pushop.outgoing\\n unfi = pushop.repo.unfiltered()\\n remotephases = listkeys(pushop.remote, 'phases')\\n \\n if (pushop.ui.configbool('ui', '_usedassubrepo')\\n and remotephases # server supports phases\\n and not pushop.outgoing.missing # no changesets to be pushed\\n and remotephases.get('publishing', False)):\\n # When:\\n # - this is a subrepo push\\n # - and remote support phase\\n # - and no changeset are to be pushed\\n # - and remote is publishing\\n # We may be in issue 3781 case!\\n # We drop the possible phase synchronisation done by\\n # courtesy to publish changesets possibly locally draft\\n # on the remote.\\n pushop.outdatedphases = []\\n pushop.fallbackoutdatedphases = []\\n return\\n \\n pushop.remotephases = phases.remotephasessummary(pushop.repo,\\n pushop.fallbackheads,\\n remotephases)\\n droots = pushop.remotephases.draftroots\\n \\n extracond = ''\\n if not pushop.remotephases.publishing:\\n extracond = ' and public()'\\n revset = 'heads((%%ln::%%ln) %s)' % extracond\\n # Get the list of all revs draft on remote by public here.\\n # XXX Beware that revset break if droots is not strictly\\n # XXX root we may want to ensure it is but it is costly\\n fallback = list(unfi.set(revset, droots, pushop.fallbackheads))\\n if not outgoing.missing:\\n future = fallback\\n else:\\n # adds changeset we are going to push as draft\\n #\\n # should not be necessary for publishing server, but because of an\\n # issue fixed in xxxxx we have to do it anyway.\\n fdroots = list(unfi.set('roots(%ln + %ln::)',\\n outgoing.missing, droots))\\n fdroots = [f.node() for f in fdroots]\\n future = list(unfi.set(revset, fdroots, pushop.futureheads))\\n pushop.outdatedphases = future\\n pushop.fallbackoutdatedphases = fallback\\n \\n @pushdiscovery('obsmarker')\\n def _pushdiscoveryobsmarkers(pushop):\\n if not obsolete.isenabled(pushop.repo, obsolete.exchangeopt):\\n return\\n \\n if not pushop.repo.obsstore:\\n return\\n \\n if 'obsolete' not in listkeys(pushop.remote, 'namespaces'):\\n return\\n \\n repo = pushop.repo\\n # very naive computation, that can be quite expensive on big repo.\\n # However: evolution is currently slow on them anyway.\\n nodes = (c.node() for c in repo.set('::%ln', pushop.futureheads))\\n pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(nodes)\\n \\n @pushdiscovery('bookmarks')\\n def _pushdiscoverybookmarks(pushop):\\n ui = pushop.ui\\n repo = pushop.repo.unfiltered()\\n remote = pushop.remote\\n ui.debug(\\\"checking for updated bookmarks\\\\n\\\")\\n ancestors = ()\\n if pushop.revs:\\n revnums = pycompat.maplist(repo.changelog.rev, pushop.revs)\\n ancestors = repo.changelog.ancestors(revnums, inclusive=True)\\n \\n remotebookmark = listkeys(remote, 'bookmarks')\\n \\n explicit = set([repo._bookmarks.expandname(bookmark)\\n for bookmark in pushop.bookmarks])\\n \\n remotebookmark = bookmod.unhexlifybookmarks(remotebookmark)\\n comp = bookmod.comparebookmarks(repo, repo._bookmarks, remotebookmark)\\n \\n def safehex(x):\\n if x is None:\\n return x\\n return hex(x)\\n \\n def hexifycompbookmarks(bookmarks):\\n return [(b, safehex(scid), safehex(dcid))\\n for (b, scid, dcid) in bookmarks]\\n \\n comp = [hexifycompbookmarks(marks) for marks in comp]\\n return _processcompared(pushop, ancestors, explicit, remotebookmark, comp)\\n \\n def _processcompared(pushop, pushed, explicit, remotebms, comp):\\n \\\"\\\"\\\"take decision on bookmark to pull from the remote bookmark\\n \\n Exist to help extensions who want to alter this behavior.\\n \\\"\\\"\\\"\\n addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = comp\\n \\n repo = pushop.repo\\n \\n for b, scid, dcid in advsrc:\\n if b in explicit:\\n explicit.remove(b)\\n if not pushed or repo[scid].rev() in pushed:\\n pushop.outbookmarks.append((b, dcid, scid))\\n # search added bookmark\\n for b, scid, dcid in addsrc:\\n if b in explicit:\\n explicit.remove(b)\\n pushop.outbookmarks.append((b, '', scid))\\n # search for overwritten bookmark\\n for b, scid, dcid in list(advdst) + list(diverge) + list(differ):\\n if b in explicit:\\n explicit.remove(b)\\n pushop.outbookmarks.append((b, dcid, scid))\\n # search for bookmark to delete\\n for b, scid, dcid in adddst:\\n if b in explicit:\\n explicit.remove(b)\\n # treat as \\\"deleted locally\\\"\\n pushop.outbookmarks.append((b, dcid, ''))\\n # identical bookmarks shouldn't get reported\\n for b, scid, dcid in same:\\n if b in explicit:\\n explicit.remove(b)\\n \\n if explicit:\\n explicit = sorted(explicit)\\n # we should probably list all of them\\n pushop.ui.warn(_('bookmark %s does not exist on the local '\\n 'or remote repository!\\\\n') % explicit[0])\\n pushop.bkresult = 2\\n \\n pushop.outbookmarks.sort()\\n \\n def _pushcheckoutgoing(pushop):\\n outgoing = pushop.outgoing\\n unfi = pushop.repo.unfiltered()\\n if not outgoing.missing:\\n # nothing to push\\n scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded)\\n return False\\n # something to push\\n if not pushop.force:\\n # if repo.obsstore == False --\\u003e no obsolete\\n # then, save the iteration\\n if unfi.obsstore:\\n # this message are here for 80 char limit reason\\n mso = _(\\\"push includes obsolete changeset: %s!\\\")\\n mspd = _(\\\"push includes phase-divergent changeset: %s!\\\")\\n mscd = _(\\\"push includes content-divergent changeset: %s!\\\")\\n mst = {\\\"orphan\\\": _(\\\"push includes orphan changeset: %s!\\\"),\\n \\\"phase-divergent\\\": mspd,\\n \\\"content-divergent\\\": mscd}\\n # If we are to push if there is at least one\\n # obsolete or unstable changeset in missing, at\\n # least one of the missinghead will be obsolete or\\n # unstable. So checking heads only is ok\\n for node in outgoing.missingheads:\\n ctx = unfi[node]\\n if ctx.obsolete():\\n raise error.Abort(mso % ctx)\\n elif ctx.isunstable():\\n # TODO print more than one instability in the abort\\n # message\\n raise error.Abort(mst[ctx.instabilities()[0]] % ctx)\\n \\n discovery.checkheads(pushop)\\n return True\\n \\n # List of names of steps to perform for an outgoing bundle2, order matters.\\n b2partsgenorder = []\\n \\n # Mapping between step name and function\\n #\\n # This exists to help extensions wrap steps if necessary\\n b2partsgenmapping = {}\\n \\n def b2partsgenerator(stepname, idx=None):\\n \\\"\\\"\\\"decorator for function generating bundle2 part\\n \\n The function is added to the step -\\u003e function mapping and appended to the\\n list of steps. Beware that decorated functions will be added in order\\n (this may matter).\\n \\n You can only use this decorator for new steps, if you want to wrap a step\\n from an extension, attack the b2partsgenmapping dictionary directly.\\\"\\\"\\\"\\n def dec(func):\\n assert stepname not in b2partsgenmapping\\n b2partsgenmapping[stepname] = func\\n if idx is None:\\n b2partsgenorder.append(stepname)\\n else:\\n b2partsgenorder.insert(idx, stepname)\\n return func\\n return dec\\n \\n def _pushb2ctxcheckheads(pushop, bundler):\\n \\\"\\\"\\\"Generate race condition checking parts\\n \\n Exists as an independent function to aid extensions\\n \\\"\\\"\\\"\\n # * 'force' do not check for push race,\\n # * if we don't push anything, there are nothing to check.\\n if not pushop.force and pushop.outgoing.missingheads:\\n allowunrelated = 'related' in bundler.capabilities.get('checkheads', ())\\n emptyremote = pushop.pushbranchmap is None\\n if not allowunrelated or emptyremote:\\n bundler.newpart('check:heads', data=iter(pushop.remoteheads))\\n else:\\n affected = set()\\n for branch, heads in pushop.pushbranchmap.iteritems():\\n remoteheads, newheads, unsyncedheads, discardedheads = heads\\n if remoteheads is not None:\\n remote = set(remoteheads)\\n affected |= set(discardedheads) & remote\\n affected |= remote - set(newheads)\\n if affected:\\n data = iter(sorted(affected))\\n bundler.newpart('check:updated-heads', data=data)\\n \\n def _pushing(pushop):\\n \\\"\\\"\\\"return True if we are pushing anything\\\"\\\"\\\"\\n return bool(pushop.outgoing.missing\\n or pushop.outdatedphases\\n or pushop.outobsmarkers\\n or pushop.outbookmarks)\\n \\n @b2partsgenerator('check-bookmarks')\\n def _pushb2checkbookmarks(pushop, bundler):\\n \\\"\\\"\\\"insert bookmark move checking\\\"\\\"\\\"\\n if not _pushing(pushop) or pushop.force:\\n return\\n b2caps = bundle2.bundle2caps(pushop.remote)\\n hasbookmarkcheck = 'bookmarks' in b2caps\\n if not (pushop.outbookmarks and hasbookmarkcheck):\\n return\\n data = []\\n for book, old, new in pushop.outbookmarks:\\n old = bin(old)\\n data.append((book, old))\\n checkdata = bookmod.binaryencode(data)\\n bundler.newpart('check:bookmarks', data=checkdata)\\n \\n @b2partsgenerator('check-phases')\\n def _pushb2checkphases(pushop, bundler):\\n \\\"\\\"\\\"insert phase move checking\\\"\\\"\\\"\\n if not _pushing(pushop) or pushop.force:\\n return\\n b2caps = bundle2.bundle2caps(pushop.remote)\\n hasphaseheads = 'heads' in b2caps.get('phases', ())\\n if pushop.remotephases is not None and hasphaseheads:\\n # check that the remote phase has not changed\\n checks = [[] for p in phases.allphases]\\n checks[phases.public].extend(pushop.remotephases.publicheads)\\n checks[phases.draft].extend(pushop.remotephases.draftroots)\\n if any(checks):\\n for nodes in checks:\\n nodes.sort()\\n checkdata = phases.binaryencode(checks)\\n bundler.newpart('check:phases', data=checkdata)\\n \\n @b2partsgenerator('changeset')\\n def _pushb2ctx(pushop, bundler):\\n \\\"\\\"\\\"handle changegroup push through bundle2\\n \\n addchangegroup result is stored in the ``pushop.cgresult`` attribute.\\n \\\"\\\"\\\"\\n if 'changesets' in pushop.stepsdone:\\n return\\n pushop.stepsdone.add('changesets')\\n # Send known heads to the server for race detection.\\n if not _pushcheckoutgoing(pushop):\\n return\\n pushop.repo.prepushoutgoinghooks(pushop)\\n \\n _pushb2ctxcheckheads(pushop, bundler)\\n \\n b2caps = bundle2.bundle2caps(pushop.remote)\\n version = '01'\\n cgversions = b2caps.get('changegroup')\\n if cgversions: # 3.1 and 3.2 ship with an empty value\\n cgversions = [v for v in cgversions\\n if v in changegroup.supportedoutgoingversions(\\n pushop.repo)]\\n if not cgversions:\\n raise ValueError(_('no common changegroup version'))\\n version = max(cgversions)\\n cgstream = changegroup.makestream(pushop.repo, pushop.outgoing, version,\\n 'push')\\n cgpart = bundler.newpart('changegroup', data=cgstream)\\n if cgversions:\\n cgpart.addparam('version', version)\\n if 'treemanifest' in pushop.repo.requirements:\\n cgpart.addparam('treemanifest', '1')\\n def handlereply(op):\\n \\\"\\\"\\\"extract addchangegroup returns from server reply\\\"\\\"\\\"\\n cgreplies = op.records.getreplies(cgpart.id)\\n assert len(cgreplies['changegroup']) == 1\\n pushop.cgresult = cgreplies['changegroup'][0]['return']\\n return handlereply\\n \\n @b2partsgenerator('phase')\\n def _pushb2phases(pushop, bundler):\\n \\\"\\\"\\\"handle phase push through bundle2\\\"\\\"\\\"\\n if 'phases' in pushop.stepsdone:\\n return\\n b2caps = bundle2.bundle2caps(pushop.remote)\\n ui = pushop.repo.ui\\n \\n legacyphase = 'phases' in ui.configlist('devel', 'legacy.exchange')\\n haspushkey = 'pushkey' in b2caps\\n hasphaseheads = 'heads' in b2caps.get('phases', ())\\n \\n if hasphaseheads and not legacyphase:\\n return _pushb2phaseheads(pushop, bundler)\\n elif haspushkey:\\n return _pushb2phasespushkey(pushop, bundler)\\n \\n def _pushb2phaseheads(pushop, bundler):\\n \\\"\\\"\\\"push phase information through a bundle2 - binary part\\\"\\\"\\\"\\n pushop.stepsdone.add('phases')\\n if pushop.outdatedphases:\\n updates = [[] for p in phases.allphases]\\n updates[0].extend(h.node() for h in pushop.outdatedphases)\\n phasedata = phases.binaryencode(updates)\\n bundler.newpart('phase-heads', data=phasedata)\\n \\n def _pushb2phasespushkey(pushop, bundler):\\n \\\"\\\"\\\"push phase information through a bundle2 - pushkey part\\\"\\\"\\\"\\n pushop.stepsdone.add('phases')\\n part2node = []\\n \\n def handlefailure(pushop, exc):\\n targetid = int(exc.partid)\\n for partid, node in part2node:\\n if partid == targetid:\\n raise error.Abort(_('updating %s to public failed') % node)\\n \\n enc = pushkey.encode\\n for newremotehead in pushop.outdatedphases:\\n part = bundler.newpart('pushkey')\\n part.addparam('namespace', enc('phases'))\\n part.addparam('key', enc(newremotehead.hex()))\\n part.addparam('old', enc('%d' % phases.draft))\\n part.addparam('new', enc('%d' % phases.public))\\n part2node.append((part.id, newremotehead))\\n pushop.pkfailcb[part.id] = handlefailure\\n \\n def handlereply(op):\\n for partid, node in part2node:\\n partrep = op.records.getreplies(partid)\\n results = partrep['pushkey']\\n assert len(results) \\u003c= 1\\n msg = None\\n if not results:\\n msg = _('server ignored update of %s to public!\\\\n') % node\\n elif not int(results[0]['return']):\\n msg = _('updating %s to public failed!\\\\n') % node\\n if msg is not None:\\n pushop.ui.warn(msg)\\n return handlereply\\n \\n @b2partsgenerator('obsmarkers')\\n def _pushb2obsmarkers(pushop, bundler):\\n if 'obsmarkers' in pushop.stepsdone:\\n return\\n remoteversions = bundle2.obsmarkersversion(bundler.capabilities)\\n if obsolete.commonversion(remoteversions) is None:\\n return\\n pushop.stepsdone.add('obsmarkers')\\n if pushop.outobsmarkers:\\n markers = sorted(pushop.outobsmarkers)\\n bundle2.buildobsmarkerspart(bundler, markers)\\n \\n @b2partsgenerator('bookmarks')\\n def _pushb2bookmarks(pushop, bundler):\\n \\\"\\\"\\\"handle bookmark push through bundle2\\\"\\\"\\\"\\n if 'bookmarks' in pushop.stepsdone:\\n return\\n b2caps = bundle2.bundle2caps(pushop.remote)\\n \\n legacy = pushop.repo.ui.configlist('devel', 'legacy.exchange')\\n legacybooks = 'bookmarks' in legacy\\n \\n if not legacybooks and 'bookmarks' in b2caps:\\n return _pushb2bookmarkspart(pushop, bundler)\\n elif 'pushkey' in b2caps:\\n return _pushb2bookmarkspushkey(pushop, bundler)\\n \\n def _bmaction(old, new):\\n \\\"\\\"\\\"small utility for bookmark pushing\\\"\\\"\\\"\\n if not old:\\n return 'export'\\n elif not new:\\n return 'delete'\\n return 'update'\\n \\n def _pushb2bookmarkspart(pushop, bundler):\\n pushop.stepsdone.add('bookmarks')\\n if not pushop.outbookmarks:\\n return\\n \\n allactions = []\\n data = []\\n for book, old, new in pushop.outbookmarks:\\n new = bin(new)\\n data.append((book, new))\\n allactions.append((book, _bmaction(old, new)))\\n checkdata = bookmod.binaryencode(data)\\n bundler.newpart('bookmarks', data=checkdata)\\n \\n def handlereply(op):\\n ui = pushop.ui\\n # if success\\n for book, action in allactions:\\n ui.status(bookmsgmap[action][0] % book)\\n \\n return handlereply\\n \\n def _pushb2bookmarkspushkey(pushop, bundler):\\n pushop.stepsdone.add('bookmarks')\\n part2book = []\\n enc = pushkey.encode\\n \\n def handlefailure(pushop, exc):\\n targetid = int(exc.partid)\\n for partid, book, action in part2book:\\n if partid == targetid:\\n raise error.Abort(bookmsgmap[action][1].rstrip() % book)\\n # we should not be called for part we did not generated\\n assert False\\n \\n for book, old, new in pushop.outbookmarks:\\n part = bundler.newpart('pushkey')\\n part.addparam('namespace', enc('bookmarks'))\\n part.addparam('key', enc(book))\\n part.addparam('old', enc(old))\\n part.addparam('new', enc(new))\\n action = 'update'\\n if not old:\\n action = 'export'\\n elif not new:\\n action = 'delete'\\n part2book.append((part.id, book, action))\\n pushop.pkfailcb[part.id] = handlefailure\\n \\n def handlereply(op):\\n ui = pushop.ui\\n for partid, book, action in part2book:\\n partrep = op.records.getreplies(partid)\\n results = partrep['pushkey']\\n assert len(results) \\u003c= 1\\n if not results:\\n pushop.ui.warn(_('server ignored bookmark %s update\\\\n') % book)\\n else:\\n ret = int(results[0]['return'])\\n if ret:\\n ui.status(bookmsgmap[action][0] % book)\\n else:\\n ui.warn(bookmsgmap[action][1] % book)\\n if pushop.bkresult is not None:\\n pushop.bkresult = 1\\n return handlereply\\n \\n @b2partsgenerator('pushvars', idx=0)\\n def _getbundlesendvars(pushop, bundler):\\n '''send shellvars via bundle2'''\\n pushvars = pushop.pushvars\\n if pushvars:\\n shellvars = {}\\n for raw in pushvars:\\n if '=' not in raw:\\n msg = (\\\"unable to parse variable '%s', should follow \\\"\\n \\\"'KEY=VALUE' or 'KEY=' format\\\")\\n raise error.Abort(msg % raw)\\n k, v = raw.split('=', 1)\\n shellvars[k] = v\\n \\n part = bundler.newpart('pushvars')\\n \\n for key, value in shellvars.iteritems():\\n part.addparam(key, value, mandatory=False)\\n \\n def _pushbundle2(pushop):\\n \\\"\\\"\\\"push data to the remote using bundle2\\n \\n The only currently supported type of data is changegroup but this will\\n evolve in the future.\\\"\\\"\\\"\\n bundler = bundle2.bundle20(pushop.ui, bundle2.bundle2caps(pushop.remote))\\n pushback = (pushop.trmanager\\n and pushop.ui.configbool('experimental', 'bundle2.pushback'))\\n \\n # create reply capability\\n capsblob = bundle2.encodecaps(bundle2.getrepocaps(pushop.repo,\\n allowpushback=pushback,\\n role='client'))\\n bundler.newpart('replycaps', data=capsblob)\\n replyhandlers = []\\n for partgenname in b2partsgenorder:\\n partgen = b2partsgenmapping[partgenname]\\n ret = partgen(pushop, bundler)\\n if callable(ret):\\n replyhandlers.append(ret)\\n # do not push if nothing to push\\n if bundler.nbparts \\u003c= 1:\\n return\\n stream = util.chunkbuffer(bundler.getchunks())\\n try:\\n try:\\n with pushop.remote.commandexecutor() as e:\\n reply = e.callcommand('unbundle', {\\n 'bundle': stream,\\n 'heads': ['force'],\\n 'url': pushop.remote.url(),\\n }).result()\\n except error.BundleValueError as exc:\\n raise error.Abort(_('missing support for %s') % exc)\\n try:\\n trgetter = None\\n if pushback:\\n trgetter = pushop.trmanager.transaction\\n op = bundle2.processbundle(pushop.repo, reply, trgetter)\\n except error.BundleValueError as exc:\\n raise error.Abort(_('missing support for %s') % exc)\\n except bundle2.AbortFromPart as exc:\\n pushop.ui.status(_('remote: %s\\\\n') % exc)\\n if exc.hint is not None:\\n pushop.ui.status(_('remote: %s\\\\n') % ('(%s)' % exc.hint))\\n raise error.Abort(_('push failed on remote'))\\n except error.PushkeyFailed as exc:\\n partid = int(exc.partid)\\n if partid not in pushop.pkfailcb:\\n raise\\n pushop.pkfailcb[partid](pushop, exc)\\n for rephand in replyhandlers:\\n rephand(op)\\n \\n def _pushchangeset(pushop):\\n \\\"\\\"\\\"Make the actual push of changeset bundle to remote repo\\\"\\\"\\\"\\n if 'changesets' in pushop.stepsdone:\\n return\\n pushop.stepsdone.add('changesets')\\n if not _pushcheckoutgoing(pushop):\\n return\\n \\n # Should have verified this in push().\\n assert pushop.remote.capable('unbundle')\\n \\n pushop.repo.prepushoutgoinghooks(pushop)\\n outgoing = pushop.outgoing\\n # TODO: get bundlecaps from remote\\n bundlecaps = None\\n # create a changegroup from local\\n if pushop.revs is None and not (outgoing.excluded\\n or pushop.repo.changelog.filteredrevs):\\n # push everything,\\n # use the fast path, no race possible on push\\n cg = changegroup.makechangegroup(pushop.repo, outgoing, '01', 'push',\\n fastpath=True, bundlecaps=bundlecaps)\\n else:\\n cg = changegroup.makechangegroup(pushop.repo, outgoing, '01',\\n 'push', bundlecaps=bundlecaps)\\n \\n # apply changegroup to remote\\n # local repo finds heads on server, finds out what\\n # revs it must push. once revs transferred, if server\\n # finds it has different heads (someone else won\\n # commit\\/push race), server aborts.\\n if pushop.force:\\n remoteheads = ['force']\\n else:\\n remoteheads = pushop.remoteheads\\n # ssh: return remote's addchangegroup()\\n # http: return remote's addchangegroup() or 0 for error\\n pushop.cgresult = pushop.remote.unbundle(cg, remoteheads,\\n pushop.repo.url())\\n \\n def _pushsyncphase(pushop):\\n \\\"\\\"\\\"synchronise phase information locally and remotely\\\"\\\"\\\"\\n cheads = pushop.commonheads\\n # even when we don't push, exchanging phase data is useful\\n remotephases = listkeys(pushop.remote, 'phases')\\n if (pushop.ui.configbool('ui', '_usedassubrepo')\\n and remotephases # server supports phases\\n and pushop.cgresult is None # nothing was pushed\\n and remotephases.get('publishing', False)):\\n # When:\\n # - this is a subrepo push\\n # - and remote support phase\\n # - and no changeset was pushed\\n # - and remote is publishing\\n # We may be in issue 3871 case!\\n # We drop the possible phase synchronisation done by\\n # courtesy to publish changesets possibly locally draft\\n # on the remote.\\n remotephases = {'publishing': 'True'}\\n if not remotephases: # old server or public only reply from non-publishing\\n _localphasemove(pushop, cheads)\\n # don't push any phase data as there is nothing to push\\n else:\\n ana = phases.analyzeremotephases(pushop.repo, cheads,\\n remotephases)\\n pheads, droots = ana\\n ### Apply remote phase on local\\n if remotephases.get('publishing', False):\\n _localphasemove(pushop, cheads)\\n else: # publish = False\\n _localphasemove(pushop, pheads)\\n _localphasemove(pushop, cheads, phases.draft)\\n ### Apply local phase on remote\\n \\n if pushop.cgresult:\\n if 'phases' in pushop.stepsdone:\\n # phases already pushed though bundle2\\n return\\n outdated = pushop.outdatedphases\\n else:\\n outdated = pushop.fallbackoutdatedphases\\n \\n pushop.stepsdone.add('phases')\\n \\n # filter heads already turned public by the push\\n outdated = [c for c in outdated if c.node() not in pheads]\\n # fallback to independent pushkey command\\n for newremotehead in outdated:\\n with pushop.remote.commandexecutor() as e:\\n r = e.callcommand('pushkey', {\\n 'namespace': 'phases',\\n 'key': newremotehead.hex(),\\n 'old': '%d' % phases.draft,\\n 'new': '%d' % phases.public\\n }).result()\\n \\n if not r:\\n pushop.ui.warn(_('updating %s to public failed!\\\\n')\\n % newremotehead)\\n \\n def _localphasemove(pushop, nodes, phase=phases.public):\\n \\\"\\\"\\\"move \\u003cnodes\\u003e to \\u003cphase\\u003e in the local source repo\\\"\\\"\\\"\\n if pushop.trmanager:\\n phases.advanceboundary(pushop.repo,\\n pushop.trmanager.transaction(),\\n phase,\\n nodes)\\n else:\\n # repo is not locked, do not change any phases!\\n # Informs the user that phases should have been moved when\\n # applicable.\\n actualmoves = [n for n in nodes if phase \\u003c pushop.repo[n].phase()]\\n phasestr = phases.phasenames[phase]\\n if actualmoves:\\n pushop.ui.status(_('cannot lock source repo, skipping '\\n 'local %s phase update\\\\n') % phasestr)\\n \\n def _pushobsolete(pushop):\\n \\\"\\\"\\\"utility function to push obsolete markers to a remote\\\"\\\"\\\"\\n if 'obsmarkers' in pushop.stepsdone:\\n return\\n repo = pushop.repo\\n remote = pushop.remote\\n pushop.stepsdone.add('obsmarkers')\\n if pushop.outobsmarkers:\\n pushop.ui.debug('try to push obsolete markers to remote\\\\n')\\n rslts = []\\n remotedata = obsolete._pushkeyescape(sorted(pushop.outobsmarkers))\\n for key in sorted(remotedata, reverse=True):\\n # reverse sort to ensure we end with dump0\\n data = remotedata[key]\\n rslts.append(remote.pushkey('obsolete', key, '', data))\\n if [r for r in rslts if not r]:\\n msg = _('failed to push some obsolete markers!\\\\n')\\n repo.ui.warn(msg)\\n \\n def _pushbookmark(pushop):\\n \\\"\\\"\\\"Update bookmark position on remote\\\"\\\"\\\"\\n if pushop.cgresult == 0 or 'bookmarks' in pushop.stepsdone:\\n return\\n pushop.stepsdone.add('bookmarks')\\n ui = pushop.ui\\n remote = pushop.remote\\n \\n for b, old, new in pushop.outbookmarks:\\n action = 'update'\\n if not old:\\n action = 'export'\\n elif not new:\\n action = 'delete'\\n \\n with remote.commandexecutor() as e:\\n r = e.callcommand('pushkey', {\\n 'namespace': 'bookmarks',\\n 'key': b,\\n 'old': old,\\n 'new': new,\\n }).result()\\n \\n if r:\\n ui.status(bookmsgmap[action][0] % b)\\n else:\\n ui.warn(bookmsgmap[action][1] % b)\\n # discovery can have set the value form invalid entry\\n if pushop.bkresult is not None:\\n pushop.bkresult = 1\\n \\n class pulloperation(object):\\n \\\"\\\"\\\"A object that represent a single pull operation\\n \\n It purpose is to carry pull related state and very common operation.\\n \\n A new should be created at the beginning of each pull and discarded\\n afterward.\\n \\\"\\\"\\\"\\n \\n def __init__(self, repo, remote, heads=None, force=False, bookmarks=(),\\n remotebookmarks=None, streamclonerequested=None,\\n includepats=None, excludepats=None):\\n # repo we pull into\\n self.repo = repo\\n # repo we pull from\\n self.remote = remote\\n # revision we try to pull (None is \\\"all\\\")\\n self.heads = heads\\n # bookmark pulled explicitly\\n self.explicitbookmarks = [repo._bookmarks.expandname(bookmark)\\n for bookmark in bookmarks]\\n # do we force pull?\\n self.force = force\\n # whether a streaming clone was requested\\n self.streamclonerequested = streamclonerequested\\n # transaction manager\\n self.trmanager = None\\n # set of common changeset between local and remote before pull\\n self.common = None\\n # set of pulled head\\n self.rheads = None\\n # list of missing changeset to fetch remotely\\n self.fetch = None\\n # remote bookmarks data\\n self.remotebookmarks = remotebookmarks\\n # result of changegroup pulling (used as return code by pull)\\n self.cgresult = None\\n # list of step already done\\n self.stepsdone = set()\\n # Whether we attempted a clone from pre-generated bundles.\\n self.clonebundleattempted = False\\n # Set of file patterns to include.\\n self.includepats = includepats\\n # Set of file patterns to exclude.\\n self.excludepats = excludepats\\n \\n @util.propertycache\\n def pulledsubset(self):\\n \\\"\\\"\\\"heads of the set of changeset target by the pull\\\"\\\"\\\"\\n # compute target subset\\n if self.heads is None:\\n # We pulled every thing possible\\n # sync on everything common\\n c = set(self.common)\\n ret = list(self.common)\\n for n in self.rheads:\\n if n not in c:\\n ret.append(n)\\n return ret\\n else:\\n # We pulled a specific subset\\n # sync on this subset\\n return self.heads\\n \\n @util.propertycache\\n def canusebundle2(self):\\n return not _forcebundle1(self)\\n \\n @util.propertycache\\n def remotebundle2caps(self):\\n return bundle2.bundle2caps(self.remote)\\n \\n def gettransaction(self):\\n # deprecated; talk to trmanager directly\\n return self.trmanager.transaction()\\n \\n class transactionmanager(util.transactional):\\n \\\"\\\"\\\"An object to manage the life cycle of a transaction\\n \\n It creates the transaction on demand and calls the appropriate hooks when\\n closing the transaction.\\\"\\\"\\\"\\n def __init__(self, repo, source, url):\\n self.repo = repo\\n self.source = source\\n self.url = url\\n self._tr = None\\n \\n def transaction(self):\\n \\\"\\\"\\\"Return an open transaction object, constructing if necessary\\\"\\\"\\\"\\n if not self._tr:\\n trname = '%s\\\\n%s' % (self.source, util.hidepassword(self.url))\\n self._tr = self.repo.transaction(trname)\\n self._tr.hookargs['source'] = self.source\\n self._tr.hookargs['url'] = self.url\\n return self._tr\\n \\n def close(self):\\n \\\"\\\"\\\"close transaction if created\\\"\\\"\\\"\\n if self._tr is not None:\\n self._tr.close()\\n \\n def release(self):\\n \\\"\\\"\\\"release transaction if created\\\"\\\"\\\"\\n if self._tr is not None:\\n self._tr.release()\\n \\n def listkeys(remote, namespace):\\n with remote.commandexecutor() as e:\\n return e.callcommand('listkeys', {'namespace': namespace}).result()\\n \\n def _fullpullbundle2(repo, pullop):\\n # The server may send a partial reply, i.e. when inlining\\n # pre-computed bundles. In that case, update the common\\n # set based on the results and pull another bundle.\\n #\\n # There are two indicators that the process is finished:\\n # - no changeset has been added, or\\n # - all remote heads are known locally.\\n # The head check must use the unfiltered view as obsoletion\\n # markers can hide heads.\\n unfi = repo.unfiltered()\\n unficl = unfi.changelog\\n def headsofdiff(h1, h2):\\n \\\"\\\"\\\"Returns heads(h1 % h2)\\\"\\\"\\\"\\n res = unfi.set('heads(%ln %% %ln)', h1, h2)\\n return set(ctx.node() for ctx in res)\\n def headsofunion(h1, h2):\\n \\\"\\\"\\\"Returns heads((h1 + h2) - null)\\\"\\\"\\\"\\n res = unfi.set('heads((%ln + %ln - null))', h1, h2)\\n return set(ctx.node() for ctx in res)\\n while True:\\n old_heads = unficl.heads()\\n clstart = len(unficl)\\n _pullbundle2(pullop)\\n if repository.NARROW_REQUIREMENT in repo.requirements:\\n # XXX narrow clones filter the heads on the server side during\\n # XXX getbundle and result in partial replies as well.\\n # XXX Disable pull bundles in this case as band aid to avoid\\n # XXX extra round trips.\\n break\\n if clstart == len(unficl):\\n break\\n if all(unficl.hasnode(n) for n in pullop.rheads):\\n break\\n new_heads = headsofdiff(unficl.heads(), old_heads)\\n pullop.common = headsofunion(new_heads, pullop.common)\\n pullop.rheads = set(pullop.rheads) - pullop.common\\n \\n def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None,\\n streamclonerequested=None, includepats=None, excludepats=None):\\n \\\"\\\"\\\"Fetch repository data from a remote.\\n \\n This is the main function used to retrieve data from a remote repository.\\n \\n ``repo`` is the local repository to clone into.\\n ``remote`` is a peer instance.\\n ``heads`` is an iterable of revisions we want to pull. ``None`` (the\\n default) means to pull everything from the remote.\\n ``bookmarks`` is an iterable of bookmarks requesting to be pulled. By\\n default, all remote bookmarks are pulled.\\n ``opargs`` are additional keyword arguments to pass to ``pulloperation``\\n initialization.\\n ``streamclonerequested`` is a boolean indicating whether a \\\"streaming\\n clone\\\" is requested. A \\\"streaming clone\\\" is essentially a raw file copy\\n of revlogs from the server. This only works when the local repository is\\n empty. The default value of ``None`` means to respect the server\\n configuration for preferring stream clones.\\n ``includepats`` and ``excludepats`` define explicit file patterns to\\n include and exclude in storage, respectively. If not defined, narrow\\n patterns from the repo instance are used, if available.\\n \\n Returns the ``pulloperation`` created for this pull.\\n \\\"\\\"\\\"\\n if opargs is None:\\n opargs = {}\\n \\n # We allow the narrow patterns to be passed in explicitly to provide more\\n # flexibility for API consumers.\\n if includepats or excludepats:\\n includepats = includepats or set()\\n excludepats = excludepats or set()\\n else:\\n includepats, excludepats = repo.narrowpats\\n \\n narrowspec.validatepatterns(includepats)\\n narrowspec.validatepatterns(excludepats)\\n \\n pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks,\\n streamclonerequested=streamclonerequested,\\n includepats=includepats, excludepats=excludepats,\\n **pycompat.strkwargs(opargs))\\n \\n peerlocal = pullop.remote.local()\\n if peerlocal:\\n missing = set(peerlocal.requirements) - pullop.repo.supported\\n if missing:\\n msg = _(\\\"required features are not\\\"\\n \\\" supported in the destination:\\\"\\n \\\" %s\\\") % (', '.join(sorted(missing)))\\n raise error.Abort(msg)\\n \\n pullop.trmanager = transactionmanager(repo, 'pull', remote.url())\\n with repo.wlock(), repo.lock(), pullop.trmanager:\\n- # This should ideally be in _pullbundle2(). However, it needs to run\\n- # before discovery to avoid extra work.\\n- _maybeapplyclonebundle(pullop)\\n- streamclone.maybeperformlegacystreamclone(pullop)\\n- _pulldiscovery(pullop)\\n- if pullop.canusebundle2:\\n- _fullpullbundle2(repo, pullop)\\n- _pullchangeset(pullop)\\n- _pullphase(pullop)\\n- _pullbookmarks(pullop)\\n- _pullobsolete(pullop)\\n+ # Use the modern wire protocol, if available.\\n+ if remote.capable('exchangev2'):\\n+ exchangev2.pull(pullop)\\n+ else:\\n+ # This should ideally be in _pullbundle2(). However, it needs to run\\n+ # before discovery to avoid extra work.\\n+ _maybeapplyclonebundle(pullop)\\n+ streamclone.maybeperformlegacystreamclone(pullop)\\n+ _pulldiscovery(pullop)\\n+ if pullop.canusebundle2:\\n+ _fullpullbundle2(repo, pullop)\\n+ _pullchangeset(pullop)\\n+ _pullphase(pullop)\\n+ _pullbookmarks(pullop)\\n+ _pullobsolete(pullop)\\n \\n # storing remotenames\\n if repo.ui.configbool('experimental', 'remotenames'):\\n logexchange.pullremotenames(repo, remote)\\n \\n return pullop\\n \\n # list of steps to perform discovery before pull\\n pulldiscoveryorder = []\\n \\n # Mapping between step name and function\\n #\\n # This exists to help extensions wrap steps if necessary\\n pulldiscoverymapping = {}\\n \\n def pulldiscovery(stepname):\\n \\\"\\\"\\\"decorator for function performing discovery before pull\\n \\n The function is added to the step -\\u003e function mapping and appended to the\\n list of steps. Beware that decorated function will be added in order (this\\n may matter).\\n \\n You can only use this decorator for a new step, if you want to wrap a step\\n from an extension, change the pulldiscovery dictionary directly.\\\"\\\"\\\"\\n def dec(func):\\n assert stepname not in pulldiscoverymapping\\n pulldiscoverymapping[stepname] = func\\n pulldiscoveryorder.append(stepname)\\n return func\\n return dec\\n \\n def _pulldiscovery(pullop):\\n \\\"\\\"\\\"Run all discovery steps\\\"\\\"\\\"\\n for stepname in pulldiscoveryorder:\\n step = pulldiscoverymapping[stepname]\\n step(pullop)\\n \\n @pulldiscovery('b1:bookmarks')\\n def _pullbookmarkbundle1(pullop):\\n \\\"\\\"\\\"fetch bookmark data in bundle1 case\\n \\n If not using bundle2, we have to fetch bookmarks before changeset\\n discovery to reduce the chance and impact of race conditions.\\\"\\\"\\\"\\n if pullop.remotebookmarks is not None:\\n return\\n if pullop.canusebundle2 and 'listkeys' in pullop.remotebundle2caps:\\n # all known bundle2 servers now support listkeys, but lets be nice with\\n # new implementation.\\n return\\n books = listkeys(pullop.remote, 'bookmarks')\\n pullop.remotebookmarks = bookmod.unhexlifybookmarks(books)\\n \\n \\n @pulldiscovery('changegroup')\\n def _pulldiscoverychangegroup(pullop):\\n \\\"\\\"\\\"discovery phase for the pull\\n \\n Current handle changeset discovery only, will change handle all discovery\\n at some point.\\\"\\\"\\\"\\n tmp = discovery.findcommonincoming(pullop.repo,\\n pullop.remote,\\n heads=pullop.heads,\\n force=pullop.force)\\n common, fetch, rheads = tmp\\n nm = pullop.repo.unfiltered().changelog.nodemap\\n if fetch and rheads:\\n # If a remote heads is filtered locally, put in back in common.\\n #\\n # This is a hackish solution to catch most of \\\"common but locally\\n # hidden situation\\\". We do not performs discovery on unfiltered\\n # repository because it end up doing a pathological amount of round\\n # trip for w huge amount of changeset we do not care about.\\n #\\n # If a set of such \\\"common but filtered\\\" changeset exist on the server\\n # but are not including a remote heads, we'll not be able to detect it,\\n scommon = set(common)\\n for n in rheads:\\n if n in nm:\\n if n not in scommon:\\n common.append(n)\\n if set(rheads).issubset(set(common)):\\n fetch = []\\n pullop.common = common\\n pullop.fetch = fetch\\n pullop.rheads = rheads\\n \\n def _pullbundle2(pullop):\\n \\\"\\\"\\\"pull data using bundle2\\n \\n For now, the only supported data are changegroup.\\\"\\\"\\\"\\n kwargs = {'bundlecaps': caps20to10(pullop.repo, role='client')}\\n \\n # make ui easier to access\\n ui = pullop.repo.ui\\n \\n # At the moment we don't do stream clones over bundle2. If that is\\n # implemented then here's where the check for that will go.\\n streaming = streamclone.canperformstreamclone(pullop, bundle2=True)[0]\\n \\n # declare pull perimeters\\n kwargs['common'] = pullop.common\\n kwargs['heads'] = pullop.heads or pullop.rheads\\n \\n if streaming:\\n kwargs['cg'] = False\\n kwargs['stream'] = True\\n pullop.stepsdone.add('changegroup')\\n pullop.stepsdone.add('phases')\\n \\n else:\\n # pulling changegroup\\n pullop.stepsdone.add('changegroup')\\n \\n kwargs['cg'] = pullop.fetch\\n \\n legacyphase = 'phases' in ui.configlist('devel', 'legacy.exchange')\\n hasbinaryphase = 'heads' in pullop.remotebundle2caps.get('phases', ())\\n if (not legacyphase and hasbinaryphase):\\n kwargs['phases'] = True\\n pullop.stepsdone.add('phases')\\n \\n if 'listkeys' in pullop.remotebundle2caps:\\n if 'phases' not in pullop.stepsdone:\\n kwargs['listkeys'] = ['phases']\\n \\n bookmarksrequested = False\\n legacybookmark = 'bookmarks' in ui.configlist('devel', 'legacy.exchange')\\n hasbinarybook = 'bookmarks' in pullop.remotebundle2caps\\n \\n if pullop.remotebookmarks is not None:\\n pullop.stepsdone.add('request-bookmarks')\\n \\n if ('request-bookmarks' not in pullop.stepsdone\\n and pullop.remotebookmarks is None\\n and not legacybookmark and hasbinarybook):\\n kwargs['bookmarks'] = True\\n bookmarksrequested = True\\n \\n if 'listkeys' in pullop.remotebundle2caps:\\n if 'request-bookmarks' not in pullop.stepsdone:\\n # make sure to always includes bookmark data when migrating\\n # `hg incoming --bundle` to using this function.\\n pullop.stepsdone.add('request-bookmarks')\\n kwargs.setdefault('listkeys', []).append('bookmarks')\\n \\n # If this is a full pull \\/ clone and the server supports the clone bundles\\n # feature, tell the server whether we attempted a clone bundle. The\\n # presence of this flag indicates the client supports clone bundles. This\\n # will enable the server to treat clients that support clone bundles\\n # differently from those that don't.\\n if (pullop.remote.capable('clonebundles')\\n and pullop.heads is None and list(pullop.common) == [nullid]):\\n kwargs['cbattempted'] = pullop.clonebundleattempted\\n \\n if streaming:\\n pullop.repo.ui.status(_('streaming all changes\\\\n'))\\n elif not pullop.fetch:\\n pullop.repo.ui.status(_(\\\"no changes found\\\\n\\\"))\\n pullop.cgresult = 0\\n else:\\n if pullop.heads is None and list(pullop.common) == [nullid]:\\n pullop.repo.ui.status(_(\\\"requesting all changes\\\\n\\\"))\\n if obsolete.isenabled(pullop.repo, obsolete.exchangeopt):\\n remoteversions = bundle2.obsmarkersversion(pullop.remotebundle2caps)\\n if obsolete.commonversion(remoteversions) is not None:\\n kwargs['obsmarkers'] = True\\n pullop.stepsdone.add('obsmarkers')\\n _pullbundle2extraprepare(pullop, kwargs)\\n \\n with pullop.remote.commandexecutor() as e:\\n args = dict(kwargs)\\n args['source'] = 'pull'\\n bundle = e.callcommand('getbundle', args).result()\\n \\n try:\\n op = bundle2.bundleoperation(pullop.repo, pullop.gettransaction,\\n source='pull')\\n op.modes['bookmarks'] = 'records'\\n bundle2.processbundle(pullop.repo, bundle, op=op)\\n except bundle2.AbortFromPart as exc:\\n pullop.repo.ui.status(_('remote: abort: %s\\\\n') % exc)\\n raise error.Abort(_('pull failed on remote'), hint=exc.hint)\\n except error.BundleValueError as exc:\\n raise error.Abort(_('missing support for %s') % exc)\\n \\n if pullop.fetch:\\n pullop.cgresult = bundle2.combinechangegroupresults(op)\\n \\n # processing phases change\\n for namespace, value in op.records['listkeys']:\\n if namespace == 'phases':\\n _pullapplyphases(pullop, value)\\n \\n # processing bookmark update\\n if bookmarksrequested:\\n books = {}\\n for record in op.records['bookmarks']:\\n books[record['bookmark']] = record[\\\"node\\\"]\\n pullop.remotebookmarks = books\\n else:\\n for namespace, value in op.records['listkeys']:\\n if namespace == 'bookmarks':\\n pullop.remotebookmarks = bookmod.unhexlifybookmarks(value)\\n \\n # bookmark data were either already there or pulled in the bundle\\n if pullop.remotebookmarks is not None:\\n _pullbookmarks(pullop)\\n \\n def _pullbundle2extraprepare(pullop, kwargs):\\n \\\"\\\"\\\"hook function so that extensions can extend the getbundle call\\\"\\\"\\\"\\n \\n def _pullchangeset(pullop):\\n \\\"\\\"\\\"pull changeset from unbundle into the local repo\\\"\\\"\\\"\\n # We delay the open of the transaction as late as possible so we\\n # don't open transaction for nothing or you break future useful\\n # rollback call\\n if 'changegroup' in pullop.stepsdone:\\n return\\n pullop.stepsdone.add('changegroup')\\n if not pullop.fetch:\\n pullop.repo.ui.status(_(\\\"no changes found\\\\n\\\"))\\n pullop.cgresult = 0\\n return\\n tr = pullop.gettransaction()\\n if pullop.heads is None and list(pullop.common) == [nullid]:\\n pullop.repo.ui.status(_(\\\"requesting all changes\\\\n\\\"))\\n elif pullop.heads is None and pullop.remote.capable('changegroupsubset'):\\n # issue1320, avoid a race if remote changed after discovery\\n pullop.heads = pullop.rheads\\n \\n if pullop.remote.capable('getbundle'):\\n # TODO: get bundlecaps from remote\\n cg = pullop.remote.getbundle('pull', common=pullop.common,\\n heads=pullop.heads or pullop.rheads)\\n elif pullop.heads is None:\\n with pullop.remote.commandexecutor() as e:\\n cg = e.callcommand('changegroup', {\\n 'nodes': pullop.fetch,\\n 'source': 'pull',\\n }).result()\\n \\n elif not pullop.remote.capable('changegroupsubset'):\\n raise error.Abort(_(\\\"partial pull cannot be done because \\\"\\n \\\"other repository doesn't support \\\"\\n \\\"changegroupsubset.\\\"))\\n else:\\n with pullop.remote.commandexecutor() as e:\\n cg = e.callcommand('changegroupsubset', {\\n 'bases': pullop.fetch,\\n 'heads': pullop.heads,\\n 'source': 'pull',\\n }).result()\\n \\n bundleop = bundle2.applybundle(pullop.repo, cg, tr, 'pull',\\n pullop.remote.url())\\n pullop.cgresult = bundle2.combinechangegroupresults(bundleop)\\n \\n def _pullphase(pullop):\\n # Get remote phases data from remote\\n if 'phases' in pullop.stepsdone:\\n return\\n remotephases = listkeys(pullop.remote, 'phases')\\n _pullapplyphases(pullop, remotephases)\\n \\n def _pullapplyphases(pullop, remotephases):\\n \\\"\\\"\\\"apply phase movement from observed remote state\\\"\\\"\\\"\\n if 'phases' in pullop.stepsdone:\\n return\\n pullop.stepsdone.add('phases')\\n publishing = bool(remotephases.get('publishing', False))\\n if remotephases and not publishing:\\n # remote is new and non-publishing\\n pheads, _dr = phases.analyzeremotephases(pullop.repo,\\n pullop.pulledsubset,\\n remotephases)\\n dheads = pullop.pulledsubset\\n else:\\n # Remote is old or publishing all common changesets\\n # should be seen as public\\n pheads = pullop.pulledsubset\\n dheads = []\\n unfi = pullop.repo.unfiltered()\\n phase = unfi._phasecache.phase\\n rev = unfi.changelog.nodemap.get\\n public = phases.public\\n draft = phases.draft\\n \\n # exclude changesets already public locally and update the others\\n pheads = [pn for pn in pheads if phase(unfi, rev(pn)) \\u003e public]\\n if pheads:\\n tr = pullop.gettransaction()\\n phases.advanceboundary(pullop.repo, tr, public, pheads)\\n \\n # exclude changesets already draft locally and update the others\\n dheads = [pn for pn in dheads if phase(unfi, rev(pn)) \\u003e draft]\\n if dheads:\\n tr = pullop.gettransaction()\\n phases.advanceboundary(pullop.repo, tr, draft, dheads)\\n \\n def _pullbookmarks(pullop):\\n \\\"\\\"\\\"process the remote bookmark information to update the local one\\\"\\\"\\\"\\n if 'bookmarks' in pullop.stepsdone:\\n return\\n pullop.stepsdone.add('bookmarks')\\n repo = pullop.repo\\n remotebookmarks = pullop.remotebookmarks\\n bookmod.updatefromremote(repo.ui, repo, remotebookmarks,\\n pullop.remote.url(),\\n pullop.gettransaction,\\n explicit=pullop.explicitbookmarks)\\n \\n def _pullobsolete(pullop):\\n \\\"\\\"\\\"utility function to pull obsolete markers from a remote\\n \\n The `gettransaction` is function that return the pull transaction, creating\\n one if necessary. We return the transaction to inform the calling code that\\n a new transaction have been created (when applicable).\\n \\n Exists mostly to allow overriding for experimentation purpose\\\"\\\"\\\"\\n if 'obsmarkers' in pullop.stepsdone:\\n return\\n pullop.stepsdone.add('obsmarkers')\\n tr = None\\n if obsolete.isenabled(pullop.repo, obsolete.exchangeopt):\\n pullop.repo.ui.debug('fetching remote obsolete markers\\\\n')\\n remoteobs = listkeys(pullop.remote, 'obsolete')\\n if 'dump0' in remoteobs:\\n tr = pullop.gettransaction()\\n markers = []\\n for key in sorted(remoteobs, reverse=True):\\n if key.startswith('dump'):\\n data = util.b85decode(remoteobs[key])\\n version, newmarks = obsolete._readmarkers(data)\\n markers += newmarks\\n if markers:\\n pullop.repo.obsstore.add(tr, markers)\\n pullop.repo.invalidatevolatilesets()\\n return tr\\n \\n def applynarrowacl(repo, kwargs):\\n \\\"\\\"\\\"Apply narrow fetch access control.\\n \\n This massages the named arguments for getbundle wire protocol commands\\n so requested data is filtered through access control rules.\\n \\\"\\\"\\\"\\n ui = repo.ui\\n # TODO this assumes existence of HTTP and is a layering violation.\\n username = ui.shortuser(ui.environ.get('REMOTE_USER') or ui.username())\\n user_includes = ui.configlist(\\n _NARROWACL_SECTION, username + '.includes',\\n ui.configlist(_NARROWACL_SECTION, 'default.includes'))\\n user_excludes = ui.configlist(\\n _NARROWACL_SECTION, username + '.excludes',\\n ui.configlist(_NARROWACL_SECTION, 'default.excludes'))\\n if not user_includes:\\n raise error.Abort(_(\\\"{} configuration for user {} is empty\\\")\\n .format(_NARROWACL_SECTION, username))\\n \\n user_includes = [\\n 'path:.' if p == '*' else 'path:' + p for p in user_includes]\\n user_excludes = [\\n 'path:.' if p == '*' else 'path:' + p for p in user_excludes]\\n \\n req_includes = set(kwargs.get(r'includepats', []))\\n req_excludes = set(kwargs.get(r'excludepats', []))\\n \\n req_includes, req_excludes, invalid_includes = narrowspec.restrictpatterns(\\n req_includes, req_excludes, user_includes, user_excludes)\\n \\n if invalid_includes:\\n raise error.Abort(\\n _(\\\"The following includes are not accessible for {}: {}\\\")\\n .format(username, invalid_includes))\\n \\n new_args = {}\\n new_args.update(kwargs)\\n new_args[r'narrow'] = True\\n new_args[r'includepats'] = req_includes\\n if req_excludes:\\n new_args[r'excludepats'] = req_excludes\\n \\n return new_args\\n \\n def _computeellipsis(repo, common, heads, known, match, depth=None):\\n \\\"\\\"\\\"Compute the shape of a narrowed DAG.\\n \\n Args:\\n repo: The repository we're transferring.\\n common: The roots of the DAG range we're transferring.\\n May be just [nullid], which means all ancestors of heads.\\n heads: The heads of the DAG range we're transferring.\\n match: The narrowmatcher that allows us to identify relevant changes.\\n depth: If not None, only consider nodes to be full nodes if they are at\\n most depth changesets away from one of heads.\\n \\n Returns:\\n A tuple of (visitnodes, relevant_nodes, ellipsisroots) where:\\n \\n visitnodes: The list of nodes (either full or ellipsis) which\\n need to be sent to the client.\\n relevant_nodes: The set of changelog nodes which change a file inside\\n the narrowspec. The client needs these as non-ellipsis nodes.\\n ellipsisroots: A dict of {rev: parents} that is used in\\n narrowchangegroup to produce ellipsis nodes with the\\n correct parents.\\n \\\"\\\"\\\"\\n cl = repo.changelog\\n mfl = repo.manifestlog\\n \\n clrev = cl.rev\\n \\n commonrevs = {clrev(n) for n in common} | {nullrev}\\n headsrevs = {clrev(n) for n in heads}\\n \\n if depth:\\n revdepth = {h: 0 for h in headsrevs}\\n \\n ellipsisheads = collections.defaultdict(set)\\n ellipsisroots = collections.defaultdict(set)\\n \\n def addroot(head, curchange):\\n \\\"\\\"\\\"Add a root to an ellipsis head, splitting heads with 3 roots.\\\"\\\"\\\"\\n ellipsisroots[head].add(curchange)\\n # Recursively split ellipsis heads with 3 roots by finding the\\n # roots' youngest common descendant which is an elided merge commit.\\n # That descendant takes 2 of the 3 roots as its own, and becomes a\\n # root of the head.\\n while len(ellipsisroots[head]) \\u003e 2:\\n child, roots = splithead(head)\\n splitroots(head, child, roots)\\n head = child # Recurse in case we just added a 3rd root\\n \\n def splitroots(head, child, roots):\\n ellipsisroots[head].difference_update(roots)\\n ellipsisroots[head].add(child)\\n ellipsisroots[child].update(roots)\\n ellipsisroots[child].discard(child)\\n \\n def splithead(head):\\n r1, r2, r3 = sorted(ellipsisroots[head])\\n for nr1, nr2 in ((r2, r3), (r1, r3), (r1, r2)):\\n mid = repo.revs('sort(merge() & %d::%d & %d::%d, -rev)',\\n nr1, head, nr2, head)\\n for j in mid:\\n if j == nr2:\\n return nr2, (nr1, nr2)\\n if j not in ellipsisroots or len(ellipsisroots[j]) \\u003c 2:\\n return j, (nr1, nr2)\\n raise error.Abort(_('Failed to split up ellipsis node! head: %d, '\\n 'roots: %d %d %d') % (head, r1, r2, r3))\\n \\n missing = list(cl.findmissingrevs(common=commonrevs, heads=headsrevs))\\n visit = reversed(missing)\\n relevant_nodes = set()\\n visitnodes = [cl.node(m) for m in missing]\\n required = set(headsrevs) | known\\n for rev in visit:\\n clrev = cl.changelogrevision(rev)\\n ps = [prev for prev in cl.parentrevs(rev) if prev != nullrev]\\n if depth is not None:\\n curdepth = revdepth[rev]\\n for p in ps:\\n revdepth[p] = min(curdepth + 1, revdepth.get(p, depth + 1))\\n needed = False\\n shallow_enough = depth is None or revdepth[rev] \\u003c= depth\\n if shallow_enough:\\n curmf = mfl[clrev.manifest].read()\\n if ps:\\n # We choose to not trust the changed files list in\\n # changesets because it's not always correct. TODO: could\\n # we trust it for the non-merge case?\\n p1mf = mfl[cl.changelogrevision(ps[0]).manifest].read()\\n needed = bool(curmf.diff(p1mf, match))\\n if not needed and len(ps) \\u003e 1:\\n # For merge changes, the list of changed files is not\\n # helpful, since we need to emit the merge if a file\\n # in the narrow spec has changed on either side of the\\n # merge. As a result, we do a manifest diff to check.\\n p2mf = mfl[cl.changelogrevision(ps[1]).manifest].read()\\n needed = bool(curmf.diff(p2mf, match))\\n else:\\n # For a root node, we need to include the node if any\\n # files in the node match the narrowspec.\\n needed = any(curmf.walk(match))\\n \\n if needed:\\n for head in ellipsisheads[rev]:\\n addroot(head, rev)\\n for p in ps:\\n required.add(p)\\n relevant_nodes.add(cl.node(rev))\\n else:\\n if not ps:\\n ps = [nullrev]\\n if rev in required:\\n for head in ellipsisheads[rev]:\\n addroot(head, rev)\\n for p in ps:\\n ellipsisheads[p].add(rev)\\n else:\\n for p in ps:\\n ellipsisheads[p] |= ellipsisheads[rev]\\n \\n # add common changesets as roots of their reachable ellipsis heads\\n for c in commonrevs:\\n for head in ellipsisheads[c]:\\n addroot(head, c)\\n return visitnodes, relevant_nodes, ellipsisroots\\n \\n def caps20to10(repo, role):\\n \\\"\\\"\\\"return a set with appropriate options to use bundle20 during getbundle\\\"\\\"\\\"\\n caps = {'HG20'}\\n capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo, role=role))\\n caps.add('bundle2=' + urlreq.quote(capsblob))\\n return caps\\n \\n # List of names of steps to perform for a bundle2 for getbundle, order matters.\\n getbundle2partsorder = []\\n \\n # Mapping between step name and function\\n #\\n # This exists to help extensions wrap steps if necessary\\n getbundle2partsmapping = {}\\n \\n def getbundle2partsgenerator(stepname, idx=None):\\n \\\"\\\"\\\"decorator for function generating bundle2 part for getbundle\\n \\n The function is added to the step -\\u003e function mapping and appended to the\\n list of steps. Beware that decorated functions will be added in order\\n (this may matter).\\n \\n You can only use this decorator for new steps, if you want to wrap a step\\n from an extension, attack the getbundle2partsmapping dictionary directly.\\\"\\\"\\\"\\n def dec(func):\\n assert stepname not in getbundle2partsmapping\\n getbundle2partsmapping[stepname] = func\\n if idx is None:\\n getbundle2partsorder.append(stepname)\\n else:\\n getbundle2partsorder.insert(idx, stepname)\\n return func\\n return dec\\n \\n def bundle2requested(bundlecaps):\\n if bundlecaps is not None:\\n return any(cap.startswith('HG2') for cap in bundlecaps)\\n return False\\n \\n def getbundlechunks(repo, source, heads=None, common=None, bundlecaps=None,\\n **kwargs):\\n \\\"\\\"\\\"Return chunks constituting a bundle's raw data.\\n \\n Could be a bundle HG10 or a bundle HG20 depending on bundlecaps\\n passed.\\n \\n Returns a 2-tuple of a dict with metadata about the generated bundle\\n and an iterator over raw chunks (of varying sizes).\\n \\\"\\\"\\\"\\n kwargs = pycompat.byteskwargs(kwargs)\\n info = {}\\n usebundle2 = bundle2requested(bundlecaps)\\n # bundle10 case\\n if not usebundle2:\\n if bundlecaps and not kwargs.get('cg', True):\\n raise ValueError(_('request for bundle10 must include changegroup'))\\n \\n if kwargs:\\n raise ValueError(_('unsupported getbundle arguments: %s')\\n % ', '.join(sorted(kwargs.keys())))\\n outgoing = _computeoutgoing(repo, heads, common)\\n info['bundleversion'] = 1\\n return info, changegroup.makestream(repo, outgoing, '01', source,\\n bundlecaps=bundlecaps)\\n \\n # bundle20 case\\n info['bundleversion'] = 2\\n b2caps = {}\\n for bcaps in bundlecaps:\\n if bcaps.startswith('bundle2='):\\n blob = urlreq.unquote(bcaps[len('bundle2='):])\\n b2caps.update(bundle2.decodecaps(blob))\\n bundler = bundle2.bundle20(repo.ui, b2caps)\\n \\n kwargs['heads'] = heads\\n kwargs['common'] = common\\n \\n for name in getbundle2partsorder:\\n func = getbundle2partsmapping[name]\\n func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps,\\n **pycompat.strkwargs(kwargs))\\n \\n info['prefercompressed'] = bundler.prefercompressed\\n \\n return info, bundler.getchunks()\\n \\n @getbundle2partsgenerator('stream2')\\n def _getbundlestream2(bundler, repo, *args, **kwargs):\\n return bundle2.addpartbundlestream2(bundler, repo, **kwargs)\\n \\n @getbundle2partsgenerator('changegroup')\\n def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None,\\n b2caps=None, heads=None, common=None, **kwargs):\\n \\\"\\\"\\\"add a changegroup part to the requested bundle\\\"\\\"\\\"\\n if not kwargs.get(r'cg', True):\\n return\\n \\n version = '01'\\n cgversions = b2caps.get('changegroup')\\n if cgversions: # 3.1 and 3.2 ship with an empty value\\n cgversions = [v for v in cgversions\\n if v in changegroup.supportedoutgoingversions(repo)]\\n if not cgversions:\\n raise ValueError(_('no common changegroup version'))\\n version = max(cgversions)\\n \\n outgoing = _computeoutgoing(repo, heads, common)\\n if not outgoing.missing:\\n return\\n \\n if kwargs.get(r'narrow', False):\\n include = sorted(filter(bool, kwargs.get(r'includepats', [])))\\n exclude = sorted(filter(bool, kwargs.get(r'excludepats', [])))\\n filematcher = narrowspec.match(repo.root, include=include,\\n exclude=exclude)\\n else:\\n filematcher = None\\n \\n cgstream = changegroup.makestream(repo, outgoing, version, source,\\n bundlecaps=bundlecaps,\\n filematcher=filematcher)\\n \\n part = bundler.newpart('changegroup', data=cgstream)\\n if cgversions:\\n part.addparam('version', version)\\n \\n part.addparam('nbchanges', '%d' % len(outgoing.missing),\\n mandatory=False)\\n \\n if 'treemanifest' in repo.requirements:\\n part.addparam('treemanifest', '1')\\n \\n if kwargs.get(r'narrow', False) and (include or exclude):\\n narrowspecpart = bundler.newpart('narrow:spec')\\n if include:\\n narrowspecpart.addparam(\\n 'include', '\\\\n'.join(include), mandatory=True)\\n if exclude:\\n narrowspecpart.addparam(\\n 'exclude', '\\\\n'.join(exclude), mandatory=True)\\n \\n @getbundle2partsgenerator('bookmarks')\\n def _getbundlebookmarkpart(bundler, repo, source, bundlecaps=None,\\n b2caps=None, **kwargs):\\n \\\"\\\"\\\"add a bookmark part to the requested bundle\\\"\\\"\\\"\\n if not kwargs.get(r'bookmarks', False):\\n return\\n if 'bookmarks' not in b2caps:\\n raise ValueError(_('no common bookmarks exchange method'))\\n books = bookmod.listbinbookmarks(repo)\\n data = bookmod.binaryencode(books)\\n if data:\\n bundler.newpart('bookmarks', data=data)\\n \\n @getbundle2partsgenerator('listkeys')\\n def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None,\\n b2caps=None, **kwargs):\\n \\\"\\\"\\\"add parts containing listkeys namespaces to the requested bundle\\\"\\\"\\\"\\n listkeys = kwargs.get(r'listkeys', ())\\n for namespace in listkeys:\\n part = bundler.newpart('listkeys')\\n part.addparam('namespace', namespace)\\n keys = repo.listkeys(namespace).items()\\n part.data = pushkey.encodekeys(keys)\\n \\n @getbundle2partsgenerator('obsmarkers')\\n def _getbundleobsmarkerpart(bundler, repo, source, bundlecaps=None,\\n b2caps=None, heads=None, **kwargs):\\n \\\"\\\"\\\"add an obsolescence markers part to the requested bundle\\\"\\\"\\\"\\n if kwargs.get(r'obsmarkers', False):\\n if heads is None:\\n heads = repo.heads()\\n subset = [c.node() for c in repo.set('::%ln', heads)]\\n markers = repo.obsstore.relevantmarkers(subset)\\n markers = sorted(markers)\\n bundle2.buildobsmarkerspart(bundler, markers)\\n \\n @getbundle2partsgenerator('phases')\\n def _getbundlephasespart(bundler, repo, source, bundlecaps=None,\\n b2caps=None, heads=None, **kwargs):\\n \\\"\\\"\\\"add phase heads part to the requested bundle\\\"\\\"\\\"\\n if kwargs.get(r'phases', False):\\n if not 'heads' in b2caps.get('phases'):\\n raise ValueError(_('no common phases exchange method'))\\n if heads is None:\\n heads = repo.heads()\\n \\n headsbyphase = collections.defaultdict(set)\\n if repo.publishing():\\n headsbyphase[phases.public] = heads\\n else:\\n # find the appropriate heads to move\\n \\n phase = repo._phasecache.phase\\n node = repo.changelog.node\\n rev = repo.changelog.rev\\n for h in heads:\\n headsbyphase[phase(repo, rev(h))].add(h)\\n seenphases = list(headsbyphase.keys())\\n \\n # We do not handle anything but public and draft phase for now)\\n if seenphases:\\n assert max(seenphases) \\u003c= phases.draft\\n \\n # if client is pulling non-public changesets, we need to find\\n # intermediate public heads.\\n draftheads = headsbyphase.get(phases.draft, set())\\n if draftheads:\\n publicheads = headsbyphase.get(phases.public, set())\\n \\n revset = 'heads(only(%ln, %ln) and public())'\\n extraheads = repo.revs(revset, draftheads, publicheads)\\n for r in extraheads:\\n headsbyphase[phases.public].add(node(r))\\n \\n # transform data in a format used by the encoding function\\n phasemapping = []\\n for phase in phases.allphases:\\n phasemapping.append(sorted(headsbyphase[phase]))\\n \\n # generate the actual part\\n phasedata = phases.binaryencode(phasemapping)\\n bundler.newpart('phase-heads', data=phasedata)\\n \\n @getbundle2partsgenerator('hgtagsfnodes')\\n def _getbundletagsfnodes(bundler, repo, source, bundlecaps=None,\\n b2caps=None, heads=None, common=None,\\n **kwargs):\\n \\\"\\\"\\\"Transfer the .hgtags filenodes mapping.\\n \\n Only values for heads in this bundle will be transferred.\\n \\n The part data consists of pairs of 20 byte changeset node and .hgtags\\n filenodes raw values.\\n \\\"\\\"\\\"\\n # Don't send unless:\\n # - changeset are being exchanged,\\n # - the client supports it.\\n if not (kwargs.get(r'cg', True) and 'hgtagsfnodes' in b2caps):\\n return\\n \\n outgoing = _computeoutgoing(repo, heads, common)\\n bundle2.addparttagsfnodescache(repo, bundler, outgoing)\\n \\n @getbundle2partsgenerator('cache:rev-branch-cache')\\n def _getbundlerevbranchcache(bundler, repo, source, bundlecaps=None,\\n b2caps=None, heads=None, common=None,\\n **kwargs):\\n \\\"\\\"\\\"Transfer the rev-branch-cache mapping\\n \\n The payload is a series of data related to each branch\\n \\n 1) branch name length\\n 2) number of open heads\\n 3) number of closed heads\\n 4) open heads nodes\\n 5) closed heads nodes\\n \\\"\\\"\\\"\\n # Don't send unless:\\n # - changeset are being exchanged,\\n # - the client supports it.\\n # - narrow bundle isn't in play (not currently compatible).\\n if (not kwargs.get(r'cg', True)\\n or 'rev-branch-cache' not in b2caps\\n or kwargs.get(r'narrow', False)\\n or repo.ui.has_section(_NARROWACL_SECTION)):\\n return\\n \\n outgoing = _computeoutgoing(repo, heads, common)\\n bundle2.addpartrevbranchcache(repo, bundler, outgoing)\\n \\n def check_heads(repo, their_heads, context):\\n \\\"\\\"\\\"check if the heads of a repo have been modified\\n \\n Used by peer for unbundling.\\n \\\"\\\"\\\"\\n heads = repo.heads()\\n heads_hash = hashlib.sha1(''.join(sorted(heads))).digest()\\n if not (their_heads == ['force'] or their_heads == heads or\\n their_heads == ['hashed', heads_hash]):\\n # someone else committed\\/pushed\\/unbundled while we\\n # were transferring data\\n raise error.PushRaced('repository changed while %s - '\\n 'please try again' % context)\\n \\n def unbundle(repo, cg, heads, source, url):\\n \\\"\\\"\\\"Apply a bundle to a repo.\\n \\n this function makes sure the repo is locked during the application and have\\n mechanism to check that no push race occurred between the creation of the\\n bundle and its application.\\n \\n If the push was raced as PushRaced exception is raised.\\\"\\\"\\\"\\n r = 0\\n # need a transaction when processing a bundle2 stream\\n # [wlock, lock, tr] - needs to be an array so nested functions can modify it\\n lockandtr = [None, None, None]\\n recordout = None\\n # quick fix for output mismatch with bundle2 in 3.4\\n captureoutput = repo.ui.configbool('experimental', 'bundle2-output-capture')\\n if url.startswith('remote:http:') or url.startswith('remote:https:'):\\n captureoutput = True\\n try:\\n # note: outside bundle1, 'heads' is expected to be empty and this\\n # 'check_heads' call wil be a no-op\\n check_heads(repo, heads, 'uploading changes')\\n # push can proceed\\n if not isinstance(cg, bundle2.unbundle20):\\n # legacy case: bundle1 (changegroup 01)\\n txnname = \\\"\\\\n\\\".join([source, util.hidepassword(url)])\\n with repo.lock(), repo.transaction(txnname) as tr:\\n op = bundle2.applybundle(repo, cg, tr, source, url)\\n r = bundle2.combinechangegroupresults(op)\\n else:\\n r = None\\n try:\\n def gettransaction():\\n if not lockandtr[2]:\\n lockandtr[0] = repo.wlock()\\n lockandtr[1] = repo.lock()\\n lockandtr[2] = repo.transaction(source)\\n lockandtr[2].hookargs['source'] = source\\n lockandtr[2].hookargs['url'] = url\\n lockandtr[2].hookargs['bundle2'] = '1'\\n return lockandtr[2]\\n \\n # Do greedy locking by default until we're satisfied with lazy\\n # locking.\\n if not repo.ui.configbool('experimental', 'bundle2lazylocking'):\\n gettransaction()\\n \\n op = bundle2.bundleoperation(repo, gettransaction,\\n captureoutput=captureoutput,\\n source='push')\\n try:\\n op = bundle2.processbundle(repo, cg, op=op)\\n finally:\\n r = op.reply\\n if captureoutput and r is not None:\\n repo.ui.pushbuffer(error=True, subproc=True)\\n def recordout(output):\\n r.newpart('output', data=output, mandatory=False)\\n if lockandtr[2] is not None:\\n lockandtr[2].close()\\n except BaseException as exc:\\n exc.duringunbundle2 = True\\n if captureoutput and r is not None:\\n parts = exc._bundle2salvagedoutput = r.salvageoutput()\\n def recordout(output):\\n part = bundle2.bundlepart('output', data=output,\\n mandatory=False)\\n parts.append(part)\\n raise\\n finally:\\n lockmod.release(lockandtr[2], lockandtr[1], lockandtr[0])\\n if recordout is not None:\\n recordout(repo.ui.popbuffer())\\n return r\\n \\n def _maybeapplyclonebundle(pullop):\\n \\\"\\\"\\\"Apply a clone bundle from a remote, if possible.\\\"\\\"\\\"\\n \\n repo = pullop.repo\\n remote = pullop.remote\\n \\n if not repo.ui.configbool('ui', 'clonebundles'):\\n return\\n \\n # Only run if local repo is empty.\\n if len(repo):\\n return\\n \\n if pullop.heads:\\n return\\n \\n if not remote.capable('clonebundles'):\\n return\\n \\n with remote.commandexecutor() as e:\\n res = e.callcommand('clonebundles', {}).result()\\n \\n # If we call the wire protocol command, that's good enough to record the\\n # attempt.\\n pullop.clonebundleattempted = True\\n \\n entries = parseclonebundlesmanifest(repo, res)\\n if not entries:\\n repo.ui.note(_('no clone bundles available on remote; '\\n 'falling back to regular clone\\\\n'))\\n return\\n \\n entries = filterclonebundleentries(\\n repo, entries, streamclonerequested=pullop.streamclonerequested)\\n \\n if not entries:\\n # There is a thundering herd concern here. However, if a server\\n # operator doesn't advertise bundles appropriate for its clients,\\n # they deserve what's coming. Furthermore, from a client's\\n # perspective, no automatic fallback would mean not being able to\\n # clone!\\n repo.ui.warn(_('no compatible clone bundles available on server; '\\n 'falling back to regular clone\\\\n'))\\n repo.ui.warn(_('(you may want to report this to the server '\\n 'operator)\\\\n'))\\n return\\n \\n entries = sortclonebundleentries(repo.ui, entries)\\n \\n url = entries[0]['URL']\\n repo.ui.status(_('applying clone bundle from %s\\\\n') % url)\\n if trypullbundlefromurl(repo.ui, repo, url):\\n repo.ui.status(_('finished applying clone bundle\\\\n'))\\n # Bundle failed.\\n #\\n # We abort by default to avoid the thundering herd of\\n # clients flooding a server that was expecting expensive\\n # clone load to be offloaded.\\n elif repo.ui.configbool('ui', 'clonebundlefallback'):\\n repo.ui.warn(_('falling back to normal clone\\\\n'))\\n else:\\n raise error.Abort(_('error applying bundle'),\\n hint=_('if this error persists, consider contacting '\\n 'the server operator or disable clone '\\n 'bundles via '\\n '\\\"--config ui.clonebundles=false\\\"'))\\n \\n def parseclonebundlesmanifest(repo, s):\\n \\\"\\\"\\\"Parses the raw text of a clone bundles manifest.\\n \\n Returns a list of dicts. The dicts have a ``URL`` key corresponding\\n to the URL and other keys are the attributes for the entry.\\n \\\"\\\"\\\"\\n m = []\\n for line in s.splitlines():\\n fields = line.split()\\n if not fields:\\n continue\\n attrs = {'URL': fields[0]}\\n for rawattr in fields[1:]:\\n key, value = rawattr.split('=', 1)\\n key = urlreq.unquote(key)\\n value = urlreq.unquote(value)\\n attrs[key] = value\\n \\n # Parse BUNDLESPEC into components. This makes client-side\\n # preferences easier to specify since you can prefer a single\\n # component of the BUNDLESPEC.\\n if key == 'BUNDLESPEC':\\n try:\\n bundlespec = parsebundlespec(repo, value)\\n attrs['COMPRESSION'] = bundlespec.compression\\n attrs['VERSION'] = bundlespec.version\\n except error.InvalidBundleSpecification:\\n pass\\n except error.UnsupportedBundleSpecification:\\n pass\\n \\n m.append(attrs)\\n \\n return m\\n \\n def isstreamclonespec(bundlespec):\\n # Stream clone v1\\n if (bundlespec.wirecompression == 'UN' and bundlespec.wireversion == 's1'):\\n return True\\n \\n # Stream clone v2\\n if (bundlespec.wirecompression == 'UN' and \\\\\\n bundlespec.wireversion == '02' and \\\\\\n bundlespec.contentopts.get('streamv2')):\\n return True\\n \\n return False\\n \\n def filterclonebundleentries(repo, entries, streamclonerequested=False):\\n \\\"\\\"\\\"Remove incompatible clone bundle manifest entries.\\n \\n Accepts a list of entries parsed with ``parseclonebundlesmanifest``\\n and returns a new list consisting of only the entries that this client\\n should be able to apply.\\n \\n There is no guarantee we'll be able to apply all returned entries because\\n the metadata we use to filter on may be missing or wrong.\\n \\\"\\\"\\\"\\n newentries = []\\n for entry in entries:\\n spec = entry.get('BUNDLESPEC')\\n if spec:\\n try:\\n bundlespec = parsebundlespec(repo, spec, strict=True)\\n \\n # If a stream clone was requested, filter out non-streamclone\\n # entries.\\n if streamclonerequested and not isstreamclonespec(bundlespec):\\n repo.ui.debug('filtering %s because not a stream clone\\\\n' %\\n entry['URL'])\\n continue\\n \\n except error.InvalidBundleSpecification as e:\\n repo.ui.debug(stringutil.forcebytestr(e) + '\\\\n')\\n continue\\n except error.UnsupportedBundleSpecification as e:\\n repo.ui.debug('filtering %s because unsupported bundle '\\n 'spec: %s\\\\n' % (\\n entry['URL'], stringutil.forcebytestr(e)))\\n continue\\n # If we don't have a spec and requested a stream clone, we don't know\\n # what the entry is so don't attempt to apply it.\\n elif streamclonerequested:\\n repo.ui.debug('filtering %s because cannot determine if a stream '\\n 'clone bundle\\\\n' % entry['URL'])\\n continue\\n \\n if 'REQUIRESNI' in entry and not sslutil.hassni:\\n repo.ui.debug('filtering %s because SNI not supported\\\\n' %\\n entry['URL'])\\n continue\\n \\n newentries.append(entry)\\n \\n return newentries\\n \\n class clonebundleentry(object):\\n \\\"\\\"\\\"Represents an item in a clone bundles manifest.\\n \\n This rich class is needed to support sorting since sorted() in Python 3\\n doesn't support ``cmp`` and our comparison is complex enough that ``key=``\\n won't work.\\n \\\"\\\"\\\"\\n \\n def __init__(self, value, prefers):\\n self.value = value\\n self.prefers = prefers\\n \\n def _cmp(self, other):\\n for prefkey, prefvalue in self.prefers:\\n avalue = self.value.get(prefkey)\\n bvalue = other.value.get(prefkey)\\n \\n # Special case for b missing attribute and a matches exactly.\\n if avalue is not None and bvalue is None and avalue == prefvalue:\\n return -1\\n \\n # Special case for a missing attribute and b matches exactly.\\n if bvalue is not None and avalue is None and bvalue == prefvalue:\\n return 1\\n \\n # We can't compare unless attribute present on both.\\n if avalue is None or bvalue is None:\\n continue\\n \\n # Same values should fall back to next attribute.\\n if avalue == bvalue:\\n continue\\n \\n # Exact matches come first.\\n if avalue == prefvalue:\\n return -1\\n if bvalue == prefvalue:\\n return 1\\n \\n # Fall back to next attribute.\\n continue\\n \\n # If we got here we couldn't sort by attributes and prefers. Fall\\n # back to index order.\\n return 0\\n \\n def __lt__(self, other):\\n return self._cmp(other) \\u003c 0\\n \\n def __gt__(self, other):\\n return self._cmp(other) \\u003e 0\\n \\n def __eq__(self, other):\\n return self._cmp(other) == 0\\n \\n def __le__(self, other):\\n return self._cmp(other) \\u003c= 0\\n \\n def __ge__(self, other):\\n return self._cmp(other) \\u003e= 0\\n \\n def __ne__(self, other):\\n return self._cmp(other) != 0\\n \\n def sortclonebundleentries(ui, entries):\\n prefers = ui.configlist('ui', 'clonebundleprefers')\\n if not prefers:\\n return list(entries)\\n \\n prefers = [p.split('=', 1) for p in prefers]\\n \\n items = sorted(clonebundleentry(v, prefers) for v in entries)\\n return [i.value for i in items]\\n \\n def trypullbundlefromurl(ui, repo, url):\\n \\\"\\\"\\\"Attempt to apply a bundle from a URL.\\\"\\\"\\\"\\n with repo.lock(), repo.transaction('bundleurl') as tr:\\n try:\\n fh = urlmod.open(ui, url)\\n cg = readbundle(ui, fh, 'stream')\\n \\n if isinstance(cg, streamclone.streamcloneapplier):\\n cg.apply(repo)\\n else:\\n bundle2.applybundle(repo, cg, tr, 'clonebundles', url)\\n return True\\n except urlerr.httperror as e:\\n ui.warn(_('HTTP error fetching bundle: %s\\\\n') %\\n stringutil.forcebytestr(e))\\n except urlerr.urlerror as e:\\n ui.warn(_('error fetching bundle: %s\\\\n') %\\n stringutil.forcebytestr(e.reason))\\n \\n return False\\n\"}]}],\"properties\":[]}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "147" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B11058%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:55 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":\"diff --git a\\/tests\\/wireprotohelpers.sh b\\/tests\\/wireprotohelpers.sh\\n--- a\\/tests\\/wireprotohelpers.sh\\n+++ b\\/tests\\/wireprotohelpers.sh\\n@@ -56,3 +56,10 @@\\n web.api.http-v2 = true\\n EOF\\n }\\n+\\n+enablehttpv2client() {\\n+ cat \\u003e\\u003e $HGRCPATH \\u003c\\u003c EOF\\n+[experimental]\\n+httppeer.advertise-v2 = true\\n+EOF\\n+}\\ndiff --git a\\/tests\\/test-wireproto-exchangev2.t b\\/tests\\/test-wireproto-exchangev2.t\\nnew file mode 100644\\n--- \\/dev\\/null\\n+++ b\\/tests\\/test-wireproto-exchangev2.t\\n@@ -0,0 +1,53 @@\\n+Tests for wire protocol version 2 exchange.\\n+Tests in this file should be folded into existing tests once protocol\\n+v2 has enough features that it can be enabled via #testcase in existing\\n+tests.\\n+\\n+ $ . $TESTDIR\\/wireprotohelpers.sh\\n+ $ enablehttpv2client\\n+\\n+ $ hg init server-simple\\n+ $ enablehttpv2 server-simple\\n+ $ cd server-simple\\n+ $ cat \\u003e\\u003e .hg\\/hgrc \\u003c\\u003c EOF\\n+ \\u003e [phases]\\n+ \\u003e publish = false\\n+ \\u003e EOF\\n+ $ echo a0 \\u003e a\\n+ $ echo b0 \\u003e b\\n+ $ hg -q commit -A -m 'commit 0'\\n+\\n+ $ echo a1 \\u003e a\\n+ $ hg commit -m 'commit 1'\\n+ $ hg phase --public -r .\\n+ $ echo a2 \\u003e a\\n+ $ hg commit -m 'commit 2'\\n+\\n+ $ hg -q up -r 0\\n+ $ echo b1 \\u003e b\\n+ $ hg -q commit -m 'head 2 commit 1'\\n+ $ echo b2 \\u003e b\\n+ $ hg -q commit -m 'head 2 commit 2'\\n+\\n+ $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log\\n+ $ cat hg.pid \\u003e $DAEMON_PIDS\\n+\\n+ $ cd ..\\n+\\n+Test basic clone\\n+\\n+ $ hg --debug clone -U http:\\/\\/localhost:$HGPORT client-simple\\n+ using http:\\/\\/localhost:$HGPORT\\/\\n+ sending capabilities command\\n+ query 1; heads\\n+ sending 2 commands\\n+ sending command heads: {}\\n+ sending command known: {\\n+ 'nodes': []\\n+ }\\n+ received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)\\n+ received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)\\n+ received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)\\n+ received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)\\ndiff --git a\\/mercurial\\/httppeer.py b\\/mercurial\\/httppeer.py\\n--- a\\/mercurial\\/httppeer.py\\n+++ b\\/mercurial\\/httppeer.py\\n@@ -802,7 +802,8 @@\\n return True\\n \\n # Other concepts.\\n- if name in ('bundle2',):\\n+ # TODO remove exchangev2 once we have a command implemented.\\n+ if name in ('bundle2', 'exchangev2'):\\n return True\\n \\n # Alias command-* to presence of command of that name.\\ndiff --git a\\/mercurial\\/exchangev2.py b\\/mercurial\\/exchangev2.py\\nnew file mode 100644\\n--- \\/dev\\/null\\n+++ b\\/mercurial\\/exchangev2.py\\n@@ -0,0 +1,55 @@\\n+# exchangev2.py - repository exchange for wire protocol version 2\\n+#\\n+# Copyright 2018 Gregory Szorc \\u003cgregory.szorc@gmail.com\\u003e\\n+#\\n+# This software may be used and distributed according to the terms of the\\n+# GNU General Public License version 2 or any later version.\\n+\\n+from __future__ import absolute_import\\n+\\n+from .node import (\\n+ nullid,\\n+)\\n+from . import (\\n+ setdiscovery,\\n+)\\n+\\n+def pull(pullop):\\n+ \\\"\\\"\\\"Pull using wire protocol version 2.\\\"\\\"\\\"\\n+ repo = pullop.repo\\n+ remote = pullop.remote\\n+\\n+ # Figure out what needs to be fetched.\\n+ common, fetch, remoteheads = _pullchangesetdiscovery(\\n+ repo, remote, pullop.heads, abortwhenunrelated=pullop.force)\\n+\\n+def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):\\n+ \\\"\\\"\\\"Determine which changesets need to be pulled.\\\"\\\"\\\"\\n+\\n+ if heads:\\n+ knownnode = repo.changelog.hasnode\\n+ if all(knownnode(head) for head in heads):\\n+ return heads, False, heads\\n+\\n+ # TODO wire protocol version 2 is capable of more efficient discovery\\n+ # than setdiscovery. Consider implementing something better.\\n+ common, fetch, remoteheads = setdiscovery.findcommonheads(\\n+ repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)\\n+\\n+ common = set(common)\\n+ remoteheads = set(remoteheads)\\n+\\n+ # If a remote head is filtered locally, put it back in the common set.\\n+ # See the comment in exchange._pulldiscoverychangegroup() for more.\\n+\\n+ if fetch and remoteheads:\\n+ nodemap = repo.unfiltered().changelog.nodemap\\n+\\n+ common |= {head for head in remoteheads if head in nodemap}\\n+\\n+ if set(remoteheads).issubset(common):\\n+ fetch = []\\n+\\n+ common.discard(nullid)\\n+\\n+ return common, fetch, remoteheads\\ndiff --git a\\/mercurial\\/exchange.py b\\/mercurial\\/exchange.py\\n--- a\\/mercurial\\/exchange.py\\n+++ b\\/mercurial\\/exchange.py\\n@@ -26,6 +26,7 @@\\n changegroup,\\n discovery,\\n error,\\n+ exchangev2,\\n lock as lockmod,\\n logexchange,\\n narrowspec,\\n@@ -1506,17 +1507,21 @@\\n \\n pullop.trmanager = transactionmanager(repo, 'pull', remote.url())\\n with repo.wlock(), repo.lock(), pullop.trmanager:\\n- # This should ideally be in _pullbundle2(). However, it needs to run\\n- # before discovery to avoid extra work.\\n- _maybeapplyclonebundle(pullop)\\n- streamclone.maybeperformlegacystreamclone(pullop)\\n- _pulldiscovery(pullop)\\n- if pullop.canusebundle2:\\n- _fullpullbundle2(repo, pullop)\\n- _pullchangeset(pullop)\\n- _pullphase(pullop)\\n- _pullbookmarks(pullop)\\n- _pullobsolete(pullop)\\n+ # Use the modern wire protocol, if available.\\n+ if remote.capable('exchangev2'):\\n+ exchangev2.pull(pullop)\\n+ else:\\n+ # This should ideally be in _pullbundle2(). However, it needs to run\\n+ # before discovery to avoid extra work.\\n+ _maybeapplyclonebundle(pullop)\\n+ streamclone.maybeperformlegacystreamclone(pullop)\\n+ _pulldiscovery(pullop)\\n+ if pullop.canusebundle2:\\n+ _fullpullbundle2(repo, pullop)\\n+ _pullchangeset(pullop)\\n+ _pullphase(pullop)\\n+ _pullbookmarks(pullop)\\n+ _pullobsolete(pullop)\\n \\n # storing remotenames\\n if repo.ui.configbool('experimental', 'remotenames'):\\n\\n\",\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "144" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+11058%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabread-conduit-error.json b/tests/phabricator/phabread-conduit-error.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabread-conduit-error.json @@ -0,0 +1,73 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:31:53 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":\"ERR-INVALID-AUTH\",\"error_info\":\"API token \\\"cli-notavalidtoken\\\" has the wrong length. API tokens should be 32 characters long.\"}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "132" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B4480%5D%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabread-str-time.json b/tests/phabricator/phabread-str-time.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabread-str-time.json @@ -0,0 +1,209 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:19 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"1285\",\"phid\":\"PHID-DREV-j3rjfvsetkqtvhk6dxye\",\"title\":\"repoview: add a new attribute _visibilityexceptions and related API\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D1285\",\"dateCreated\":\"1509645891\",\"dateModified\":\"1515574368\",\"authorPHID\":\"PHID-USER-34jnztnonbr4lhwuybwl\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"properties\":[],\"branch\":null,\"summary\":\"Currently we don't have a defined way in core to make some hidden revisions\\nvisible in filtered repo. Extensions to achieve the purpose of unhiding some\\nhidden commits, wrap repoview.pinnedrevs() function.\\n\\nTo make the above task simple and have well defined API, this patch adds a new\\nattribute '_visibilityexceptions' to repoview class which will contains\\nthe hidden revs which should be exception.\\nThis will allow to set different exceptions for different repoview objects\\nbacked by the same unfiltered repo.\\n\\nThis patch also adds API to add revs to the attribute set and get them.\\n\\nThanks to Jun for suggesting the use of repoview class instead of localrepo.\",\"testPlan\":\"\",\"lineCount\":\"19\",\"activeDiffPHID\":\"PHID-DIFF-mpgcio4dbd3k3ab2ha6x\",\"diffs\":[\"4092\",\"4051\",\"3956\",\"3784\",\"3201\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\",\"PHID-USER-bdvomxbzdb42dlftorg4\":\"PHID-USER-bdvomxbzdb42dlftorg4\",\"PHID-USER-qwhdxkyioew7vwvxqc2g\":\"PHID-USER-qwhdxkyioew7vwvxqc2g\"},\"ccs\":[\"PHID-USER-qwhdxkyioew7vwvxqc2g\",\"PHID-USER-f6tllotq6q2rtpi47wjq\",\"PHID-USER-bdvomxbzdb42dlftorg4\",\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B1285%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:20 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"4092\":{\"id\":\"4092\",\"revisionID\":\"1285\",\"dateCreated\":\"1512396989\",\"dateModified\":\"1512396993\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"9311\",\"metadata\":{\"line:first\":188},\"oldPath\":\"mercurial\\/repoview.py\",\"currentPath\":\"mercurial\\/repoview.py\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"11\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"242\",\"newLength\":\"253\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\" # repoview.py - Filtered view of a localrepo object\\n #\\n # Copyright 2012 Pierre-Yves David \\u003cpierre-yves.david@ens-lyon.org\\u003e\\n # Logilab SA \\u003ccontact@logilab.fr\\u003e\\n #\\n # This software may be used and distributed according to the terms of the\\n # GNU General Public License version 2 or any later version.\\n \\n from __future__ import absolute_import\\n \\n import copy\\n \\n from .node import nullrev\\n from . import (\\n obsolete,\\n phases,\\n tags as tagsmod,\\n )\\n \\n def hideablerevs(repo):\\n \\\"\\\"\\\"Revision candidates to be hidden\\n \\n This is a standalone function to allow extensions to wrap it.\\n \\n Because we use the set of immutable changesets as a fallback subset in\\n branchmap (see mercurial.branchmap.subsettable), you cannot set \\\"public\\\"\\n changesets as \\\"hideable\\\". Doing so would break multiple code assertions and\\n lead to crashes.\\\"\\\"\\\"\\n return obsolete.getrevs(repo, 'obsolete')\\n \\n def pinnedrevs(repo):\\n \\\"\\\"\\\"revisions blocking hidden changesets from being filtered\\n \\\"\\\"\\\"\\n \\n cl = repo.changelog\\n pinned = set()\\n pinned.update([par.rev() for par in repo[None].parents()])\\n pinned.update([cl.rev(bm) for bm in repo._bookmarks.values()])\\n \\n tags = {}\\n tagsmod.readlocaltags(repo.ui, repo, tags, {})\\n if tags:\\n rev, nodemap = cl.rev, cl.nodemap\\n pinned.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)\\n return pinned\\n \\n \\n def _revealancestors(pfunc, hidden, revs):\\n \\\"\\\"\\\"reveals contiguous chains of hidden ancestors of 'revs' by removing them\\n from 'hidden'\\n \\n - pfunc(r): a funtion returning parent of 'r',\\n - hidden: the (preliminary) hidden revisions, to be updated\\n - revs: iterable of revnum,\\n \\n (Ancestors are revealed exclusively, i.e. the elements in 'revs' are\\n *not* revealed)\\n \\\"\\\"\\\"\\n stack = list(revs)\\n while stack:\\n for p in pfunc(stack.pop()):\\n if p != nullrev and p in hidden:\\n hidden.remove(p)\\n stack.append(p)\\n \\n def computehidden(repo):\\n \\\"\\\"\\\"compute the set of hidden revision to filter\\n \\n During most operation hidden should be filtered.\\\"\\\"\\\"\\n assert not repo.changelog.filteredrevs\\n \\n hidden = hideablerevs(repo)\\n if hidden:\\n hidden = set(hidden - pinnedrevs(repo))\\n pfunc = repo.changelog.parentrevs\\n mutablephases = (phases.draft, phases.secret)\\n mutable = repo._phasecache.getrevset(repo, mutablephases)\\n \\n visible = mutable - hidden\\n _revealancestors(pfunc, hidden, visible)\\n return frozenset(hidden)\\n \\n def computeunserved(repo):\\n \\\"\\\"\\\"compute the set of revision that should be filtered when used a server\\n \\n Secret and hidden changeset should not pretend to be here.\\\"\\\"\\\"\\n assert not repo.changelog.filteredrevs\\n # fast path in simple case to avoid impact of non optimised code\\n hiddens = filterrevs(repo, 'visible')\\n if phases.hassecret(repo):\\n cl = repo.changelog\\n secret = phases.secret\\n getphase = repo._phasecache.phase\\n first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret])\\n revs = cl.revs(start=first)\\n secrets = set(r for r in revs if getphase(repo, r) \\u003e= secret)\\n return frozenset(hiddens | secrets)\\n else:\\n return hiddens\\n \\n def computemutable(repo):\\n assert not repo.changelog.filteredrevs\\n # fast check to avoid revset call on huge repo\\n if any(repo._phasecache.phaseroots[1:]):\\n getphase = repo._phasecache.phase\\n maymutable = filterrevs(repo, 'base')\\n return frozenset(r for r in maymutable if getphase(repo, r))\\n return frozenset()\\n \\n def computeimpactable(repo):\\n \\\"\\\"\\\"Everything impactable by mutable revision\\n \\n The immutable filter still have some chance to get invalidated. This will\\n happen when:\\n \\n - you garbage collect hidden changeset,\\n - public phase is moved backward,\\n - something is changed in the filtering (this could be fixed)\\n \\n This filter out any mutable changeset and any public changeset that may be\\n impacted by something happening to a mutable revision.\\n \\n This is achieved by filtered everything with a revision number egal or\\n higher than the first mutable changeset is filtered.\\\"\\\"\\\"\\n assert not repo.changelog.filteredrevs\\n cl = repo.changelog\\n firstmutable = len(cl)\\n for roots in repo._phasecache.phaseroots[1:]:\\n if roots:\\n firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))\\n # protect from nullrev root\\n firstmutable = max(0, firstmutable)\\n return frozenset(xrange(firstmutable, len(cl)))\\n \\n # function to compute filtered set\\n #\\n # When adding a new filter you MUST update the table at:\\n # mercurial.branchmap.subsettable\\n # Otherwise your filter will have to recompute all its branches cache\\n # from scratch (very slow).\\n filtertable = {'visible': computehidden,\\n 'served': computeunserved,\\n 'immutable': computemutable,\\n 'base': computeimpactable}\\n \\n def filterrevs(repo, filtername):\\n \\\"\\\"\\\"returns set of filtered revision for this filter name\\\"\\\"\\\"\\n if filtername not in repo.filteredrevcache:\\n func = filtertable[filtername]\\n repo.filteredrevcache[filtername] = func(repo.unfiltered())\\n return repo.filteredrevcache[filtername]\\n \\n class repoview(object):\\n \\\"\\\"\\\"Provide a read\\/write view of a repo through a filtered changelog\\n \\n This object is used to access a filtered version of a repository without\\n altering the original repository object itself. We can not alter the\\n original object for two main reasons:\\n - It prevents the use of a repo with multiple filters at the same time. In\\n particular when multiple threads are involved.\\n - It makes scope of the filtering harder to control.\\n \\n This object behaves very closely to the original repository. All attribute\\n operations are done on the original repository:\\n - An access to `repoview.someattr` actually returns `repo.someattr`,\\n - A write to `repoview.someattr` actually sets value of `repo.someattr`,\\n - A deletion of `repoview.someattr` actually drops `someattr`\\n from `repo.__dict__`.\\n \\n The only exception is the `changelog` property. It is overridden to return\\n a (surface) copy of `repo.changelog` with some revisions filtered. The\\n `filtername` attribute of the view control the revisions that need to be\\n filtered. (the fact the changelog is copied is an implementation detail).\\n \\n Unlike attributes, this object intercepts all method calls. This means that\\n all methods are run on the `repoview` object with the filtered `changelog`\\n property. For this purpose the simple `repoview` class must be mixed with\\n the actual class of the repository. This ensures that the resulting\\n `repoview` object have the very same methods than the repo object. This\\n leads to the property below.\\n \\n repoview.method() --\\u003e repo.__class__.method(repoview)\\n \\n The inheritance has to be done dynamically because `repo` can be of any\\n subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.\\n \\\"\\\"\\\"\\n \\n+ # hidden revs which should be visible\\n+ _visibilityexceptions = set()\\n+\\n def __init__(self, repo, filtername):\\n object.__setattr__(self, r'_unfilteredrepo', repo)\\n object.__setattr__(self, r'filtername', filtername)\\n object.__setattr__(self, r'_clcachekey', None)\\n object.__setattr__(self, r'_clcache', None)\\n \\n # not a propertycache on purpose we shall implement a proper cache later\\n @property\\n def changelog(self):\\n \\\"\\\"\\\"return a filtered version of the changeset\\n \\n this changelog must not be used for writing\\\"\\\"\\\"\\n # some cache may be implemented later\\n unfi = self._unfilteredrepo\\n unfichangelog = unfi.changelog\\n # bypass call to changelog.method\\n unfiindex = unfichangelog.index\\n unfilen = len(unfiindex) - 1\\n unfinode = unfiindex[unfilen - 1][7]\\n \\n revs = filterrevs(unfi, self.filtername)\\n cl = self._clcache\\n newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed)\\n # if cl.index is not unfiindex, unfi.changelog would be\\n # recreated, and our clcache refers to garbage object\\n if (cl is not None and\\n (cl.index is not unfiindex or newkey != self._clcachekey)):\\n cl = None\\n # could have been made None by the previous if\\n if cl is None:\\n cl = copy.copy(unfichangelog)\\n cl.filteredrevs = revs\\n object.__setattr__(self, r'_clcache', cl)\\n object.__setattr__(self, r'_clcachekey', newkey)\\n return cl\\n \\n def unfiltered(self):\\n \\\"\\\"\\\"Return an unfiltered version of a repo\\\"\\\"\\\"\\n return self._unfilteredrepo\\n \\n def filtered(self, name):\\n \\\"\\\"\\\"Return a filtered version of a repository\\\"\\\"\\\"\\n if name == self.filtername:\\n return self\\n return self.unfiltered().filtered(name)\\n \\n+ def addvisibilityexceptions(self, revs):\\n+ \\\"\\\"\\\"adds hidden revs which should be visible to set of exceptions\\\"\\\"\\\"\\n+ self._visibilityexceptions.update(revs)\\n+\\n+ def getvisibilityexceptions(self):\\n+ \\\"\\\"\\\"returns the set of hidden revs which should be visible\\\"\\\"\\\"\\n+ return self._visibilityexceptions\\n+\\n # everything access are forwarded to the proxied repo\\n def __getattr__(self, attr):\\n return getattr(self._unfilteredrepo, attr)\\n \\n def __setattr__(self, attr, value):\\n return setattr(self._unfilteredrepo, attr, value)\\n \\n def __delattr__(self, attr):\\n return delattr(self._unfilteredrepo, attr)\\n\"}]},{\"id\":\"9310\",\"metadata\":{\"line:first\":573},\"oldPath\":\"mercurial\\/localrepo.py\",\"currentPath\":\"mercurial\\/localrepo.py\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"8\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"2301\",\"newLength\":\"2309\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\" # localrepo.py - read\\/write repository class for mercurial\\n #\\n # Copyright 2005-2007 Matt Mackall \\u003cmpm@selenic.com\\u003e\\n #\\n # This software may be used and distributed according to the terms of the\\n # GNU General Public License version 2 or any later version.\\n \\n from __future__ import absolute_import\\n \\n import errno\\n import hashlib\\n import inspect\\n import os\\n import random\\n import time\\n import weakref\\n \\n from .i18n import _\\n from .node import (\\n hex,\\n nullid,\\n short,\\n )\\n from . import (\\n bookmarks,\\n branchmap,\\n bundle2,\\n changegroup,\\n changelog,\\n color,\\n context,\\n dirstate,\\n dirstateguard,\\n discovery,\\n encoding,\\n error,\\n exchange,\\n extensions,\\n filelog,\\n hook,\\n lock as lockmod,\\n manifest,\\n match as matchmod,\\n merge as mergemod,\\n mergeutil,\\n namespaces,\\n obsolete,\\n pathutil,\\n peer,\\n phases,\\n pushkey,\\n pycompat,\\n repository,\\n repoview,\\n revset,\\n revsetlang,\\n scmutil,\\n sparse,\\n store,\\n subrepo,\\n tags as tagsmod,\\n transaction,\\n txnutil,\\n util,\\n vfs as vfsmod,\\n )\\n \\n release = lockmod.release\\n urlerr = util.urlerr\\n urlreq = util.urlreq\\n \\n # set of (path, vfs-location) tuples. vfs-location is:\\n # - 'plain for vfs relative paths\\n # - '' for svfs relative paths\\n _cachedfiles = set()\\n \\n class _basefilecache(scmutil.filecache):\\n \\\"\\\"\\\"All filecache usage on repo are done for logic that should be unfiltered\\n \\\"\\\"\\\"\\n def __get__(self, repo, type=None):\\n if repo is None:\\n return self\\n return super(_basefilecache, self).__get__(repo.unfiltered(), type)\\n def __set__(self, repo, value):\\n return super(_basefilecache, self).__set__(repo.unfiltered(), value)\\n def __delete__(self, repo):\\n return super(_basefilecache, self).__delete__(repo.unfiltered())\\n \\n class repofilecache(_basefilecache):\\n \\\"\\\"\\\"filecache for files in .hg but outside of .hg\\/store\\\"\\\"\\\"\\n def __init__(self, *paths):\\n super(repofilecache, self).__init__(*paths)\\n for path in paths:\\n _cachedfiles.add((path, 'plain'))\\n \\n def join(self, obj, fname):\\n return obj.vfs.join(fname)\\n \\n class storecache(_basefilecache):\\n \\\"\\\"\\\"filecache for files in the store\\\"\\\"\\\"\\n def __init__(self, *paths):\\n super(storecache, self).__init__(*paths)\\n for path in paths:\\n _cachedfiles.add((path, ''))\\n \\n def join(self, obj, fname):\\n return obj.sjoin(fname)\\n \\n def isfilecached(repo, name):\\n \\\"\\\"\\\"check if a repo has already cached \\\"name\\\" filecache-ed property\\n \\n This returns (cachedobj-or-None, iscached) tuple.\\n \\\"\\\"\\\"\\n cacheentry = repo.unfiltered()._filecache.get(name, None)\\n if not cacheentry:\\n return None, False\\n return cacheentry.obj, True\\n \\n class unfilteredpropertycache(util.propertycache):\\n \\\"\\\"\\\"propertycache that apply to unfiltered repo only\\\"\\\"\\\"\\n \\n def __get__(self, repo, type=None):\\n unfi = repo.unfiltered()\\n if unfi is repo:\\n return super(unfilteredpropertycache, self).__get__(unfi)\\n return getattr(unfi, self.name)\\n \\n class filteredpropertycache(util.propertycache):\\n \\\"\\\"\\\"propertycache that must take filtering in account\\\"\\\"\\\"\\n \\n def cachevalue(self, obj, value):\\n object.__setattr__(obj, self.name, value)\\n \\n \\n def hasunfilteredcache(repo, name):\\n \\\"\\\"\\\"check if a repo has an unfilteredpropertycache value for \\u003cname\\u003e\\\"\\\"\\\"\\n return name in vars(repo.unfiltered())\\n \\n def unfilteredmethod(orig):\\n \\\"\\\"\\\"decorate method that always need to be run on unfiltered version\\\"\\\"\\\"\\n def wrapper(repo, *args, **kwargs):\\n return orig(repo.unfiltered(), *args, **kwargs)\\n return wrapper\\n \\n moderncaps = {'lookup', 'branchmap', 'pushkey', 'known', 'getbundle',\\n 'unbundle'}\\n legacycaps = moderncaps.union({'changegroupsubset'})\\n \\n class localpeer(repository.peer):\\n '''peer for a local repo; reflects only the most recent API'''\\n \\n def __init__(self, repo, caps=None):\\n super(localpeer, self).__init__()\\n \\n if caps is None:\\n caps = moderncaps.copy()\\n self._repo = repo.filtered('served')\\n self._ui = repo.ui\\n self._caps = repo._restrictcapabilities(caps)\\n \\n # Begin of _basepeer interface.\\n \\n @util.propertycache\\n def ui(self):\\n return self._ui\\n \\n def url(self):\\n return self._repo.url()\\n \\n def local(self):\\n return self._repo\\n \\n def peer(self):\\n return self\\n \\n def canpush(self):\\n return True\\n \\n def close(self):\\n self._repo.close()\\n \\n # End of _basepeer interface.\\n \\n # Begin of _basewirecommands interface.\\n \\n def branchmap(self):\\n return self._repo.branchmap()\\n \\n def capabilities(self):\\n return self._caps\\n \\n def debugwireargs(self, one, two, three=None, four=None, five=None):\\n \\\"\\\"\\\"Used to test argument passing over the wire\\\"\\\"\\\"\\n return \\\"%s %s %s %s %s\\\" % (one, two, three, four, five)\\n \\n def getbundle(self, source, heads=None, common=None, bundlecaps=None,\\n **kwargs):\\n chunks = exchange.getbundlechunks(self._repo, source, heads=heads,\\n common=common, bundlecaps=bundlecaps,\\n **kwargs)\\n cb = util.chunkbuffer(chunks)\\n \\n if exchange.bundle2requested(bundlecaps):\\n # When requesting a bundle2, getbundle returns a stream to make the\\n # wire level function happier. We need to build a proper object\\n # from it in local peer.\\n return bundle2.getunbundler(self.ui, cb)\\n else:\\n return changegroup.getunbundler('01', cb, None)\\n \\n def heads(self):\\n return self._repo.heads()\\n \\n def known(self, nodes):\\n return self._repo.known(nodes)\\n \\n def listkeys(self, namespace):\\n return self._repo.listkeys(namespace)\\n \\n def lookup(self, key):\\n return self._repo.lookup(key)\\n \\n def pushkey(self, namespace, key, old, new):\\n return self._repo.pushkey(namespace, key, old, new)\\n \\n def stream_out(self):\\n raise error.Abort(_('cannot perform stream clone against local '\\n 'peer'))\\n \\n def unbundle(self, cg, heads, url):\\n \\\"\\\"\\\"apply a bundle on a repo\\n \\n This function handles the repo locking itself.\\\"\\\"\\\"\\n try:\\n try:\\n cg = exchange.readbundle(self.ui, cg, None)\\n ret = exchange.unbundle(self._repo, cg, heads, 'push', url)\\n if util.safehasattr(ret, 'getchunks'):\\n # This is a bundle20 object, turn it into an unbundler.\\n # This little dance should be dropped eventually when the\\n # API is finally improved.\\n stream = util.chunkbuffer(ret.getchunks())\\n ret = bundle2.getunbundler(self.ui, stream)\\n return ret\\n except Exception as exc:\\n # If the exception contains output salvaged from a bundle2\\n # reply, we need to make sure it is printed before continuing\\n # to fail. So we build a bundle2 with such output and consume\\n # it directly.\\n #\\n # This is not very elegant but allows a \\\"simple\\\" solution for\\n # issue4594\\n output = getattr(exc, '_bundle2salvagedoutput', ())\\n if output:\\n bundler = bundle2.bundle20(self._repo.ui)\\n for out in output:\\n bundler.addpart(out)\\n stream = util.chunkbuffer(bundler.getchunks())\\n b = bundle2.getunbundler(self.ui, stream)\\n bundle2.processbundle(self._repo, b)\\n raise\\n except error.PushRaced as exc:\\n raise error.ResponseError(_('push failed:'), str(exc))\\n \\n # End of _basewirecommands interface.\\n \\n # Begin of peer interface.\\n \\n def iterbatch(self):\\n return peer.localiterbatcher(self)\\n \\n # End of peer interface.\\n \\n class locallegacypeer(repository.legacypeer, localpeer):\\n '''peer extension which implements legacy methods too; used for tests with\\n restricted capabilities'''\\n \\n def __init__(self, repo):\\n super(locallegacypeer, self).__init__(repo, caps=legacycaps)\\n \\n # Begin of baselegacywirecommands interface.\\n \\n def between(self, pairs):\\n return self._repo.between(pairs)\\n \\n def branches(self, nodes):\\n return self._repo.branches(nodes)\\n \\n def changegroup(self, basenodes, source):\\n outgoing = discovery.outgoing(self._repo, missingroots=basenodes,\\n missingheads=self._repo.heads())\\n return changegroup.makechangegroup(self._repo, outgoing, '01', source)\\n \\n def changegroupsubset(self, bases, heads, source):\\n outgoing = discovery.outgoing(self._repo, missingroots=bases,\\n missingheads=heads)\\n return changegroup.makechangegroup(self._repo, outgoing, '01', source)\\n \\n # End of baselegacywirecommands interface.\\n \\n # Increment the sub-version when the revlog v2 format changes to lock out old\\n # clients.\\n REVLOGV2_REQUIREMENT = 'exp-revlogv2.0'\\n \\n class localrepository(object):\\n \\n supportedformats = {\\n 'revlogv1',\\n 'generaldelta',\\n 'treemanifest',\\n 'manifestv2',\\n REVLOGV2_REQUIREMENT,\\n }\\n _basesupported = supportedformats | {\\n 'store',\\n 'fncache',\\n 'shared',\\n 'relshared',\\n 'dotencode',\\n 'exp-sparse',\\n }\\n openerreqs = {\\n 'revlogv1',\\n 'generaldelta',\\n 'treemanifest',\\n 'manifestv2',\\n }\\n \\n # a list of (ui, featureset) functions.\\n # only functions defined in module of enabled extensions are invoked\\n featuresetupfuncs = set()\\n \\n # list of prefix for file which can be written without 'wlock'\\n # Extensions should extend this list when needed\\n _wlockfreeprefix = {\\n # We migh consider requiring 'wlock' for the next\\n # two, but pretty much all the existing code assume\\n # wlock is not needed so we keep them excluded for\\n # now.\\n 'hgrc',\\n 'requires',\\n # XXX cache is a complicatged business someone\\n # should investigate this in depth at some point\\n 'cache\\/',\\n # XXX shouldn't be dirstate covered by the wlock?\\n 'dirstate',\\n # XXX bisect was still a bit too messy at the time\\n # this changeset was introduced. Someone should fix\\n # the remainig bit and drop this line\\n 'bisect.state',\\n }\\n \\n def __init__(self, baseui, path, create=False):\\n self.requirements = set()\\n self.filtername = None\\n # wvfs: rooted at the repository root, used to access the working copy\\n self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True)\\n # vfs: rooted at .hg, used to access repo files outside of .hg\\/store\\n self.vfs = None\\n # svfs: usually rooted at .hg\\/store, used to access repository history\\n # If this is a shared repository, this vfs may point to another\\n # repository's .hg\\/store directory.\\n self.svfs = None\\n self.root = self.wvfs.base\\n self.path = self.wvfs.join(\\\".hg\\\")\\n self.origroot = path\\n # This is only used by context.workingctx.match in order to\\n # detect files in subrepos.\\n self.auditor = pathutil.pathauditor(\\n self.root, callback=self._checknested)\\n # This is only used by context.basectx.match in order to detect\\n # files in subrepos.\\n self.nofsauditor = pathutil.pathauditor(\\n self.root, callback=self._checknested, realfs=False, cached=True)\\n self.baseui = baseui\\n self.ui = baseui.copy()\\n self.ui.copy = baseui.copy # prevent copying repo configuration\\n self.vfs = vfsmod.vfs(self.path, cacheaudited=True)\\n if (self.ui.configbool('devel', 'all-warnings') or\\n self.ui.configbool('devel', 'check-locks')):\\n self.vfs.audit = self._getvfsward(self.vfs.audit)\\n # A list of callback to shape the phase if no data were found.\\n # Callback are in the form: func(repo, roots) --\\u003e processed root.\\n # This list it to be filled by extension during repo setup\\n self._phasedefaults = []\\n try:\\n self.ui.readconfig(self.vfs.join(\\\"hgrc\\\"), self.root)\\n self._loadextensions()\\n except IOError:\\n pass\\n \\n if self.featuresetupfuncs:\\n self.supported = set(self._basesupported) # use private copy\\n extmods = set(m.__name__ for n, m\\n in extensions.extensions(self.ui))\\n for setupfunc in self.featuresetupfuncs:\\n if setupfunc.__module__ in extmods:\\n setupfunc(self.ui, self.supported)\\n else:\\n self.supported = self._basesupported\\n color.setup(self.ui)\\n \\n # Add compression engines.\\n for name in util.compengines:\\n engine = util.compengines[name]\\n if engine.revlogheader():\\n self.supported.add('exp-compression-%s' % name)\\n \\n if not self.vfs.isdir():\\n if create:\\n self.requirements = newreporequirements(self)\\n \\n if not self.wvfs.exists():\\n self.wvfs.makedirs()\\n self.vfs.makedir(notindexed=True)\\n \\n if 'store' in self.requirements:\\n self.vfs.mkdir(\\\"store\\\")\\n \\n # create an invalid changelog\\n self.vfs.append(\\n \\\"00changelog.i\\\",\\n '\\\\0\\\\0\\\\0\\\\2' # represents revlogv2\\n ' dummy changelog to prevent using the old repo layout'\\n )\\n else:\\n raise error.RepoError(_(\\\"repository %s not found\\\") % path)\\n elif create:\\n raise error.RepoError(_(\\\"repository %s already exists\\\") % path)\\n else:\\n try:\\n self.requirements = scmutil.readrequires(\\n self.vfs, self.supported)\\n except IOError as inst:\\n if inst.errno != errno.ENOENT:\\n raise\\n \\n cachepath = self.vfs.join('cache')\\n self.sharedpath = self.path\\n try:\\n sharedpath = self.vfs.read(\\\"sharedpath\\\").rstrip('\\\\n')\\n if 'relshared' in self.requirements:\\n sharedpath = self.vfs.join(sharedpath)\\n vfs = vfsmod.vfs(sharedpath, realpath=True)\\n cachepath = vfs.join('cache')\\n s = vfs.base\\n if not vfs.exists():\\n raise error.RepoError(\\n _('.hg\\/sharedpath points to nonexistent directory %s') % s)\\n self.sharedpath = s\\n except IOError as inst:\\n if inst.errno != errno.ENOENT:\\n raise\\n \\n if 'exp-sparse' in self.requirements and not sparse.enabled:\\n raise error.RepoError(_('repository is using sparse feature but '\\n 'sparse is not enabled; enable the '\\n '\\\"sparse\\\" extensions to access'))\\n \\n self.store = store.store(\\n self.requirements, self.sharedpath,\\n lambda base: vfsmod.vfs(base, cacheaudited=True))\\n self.spath = self.store.path\\n self.svfs = self.store.vfs\\n self.sjoin = self.store.join\\n self.vfs.createmode = self.store.createmode\\n self.cachevfs = vfsmod.vfs(cachepath, cacheaudited=True)\\n self.cachevfs.createmode = self.store.createmode\\n if (self.ui.configbool('devel', 'all-warnings') or\\n self.ui.configbool('devel', 'check-locks')):\\n if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs\\n self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit)\\n else: # standard vfs\\n self.svfs.audit = self._getsvfsward(self.svfs.audit)\\n self._applyopenerreqs()\\n if create:\\n self._writerequirements()\\n \\n self._dirstatevalidatewarned = False\\n \\n self._branchcaches = {}\\n self._revbranchcache = None\\n self.filterpats = {}\\n self._datafilters = {}\\n self._transref = self._lockref = self._wlockref = None\\n \\n # A cache for various files under .hg\\/ that tracks file changes,\\n # (used by the filecache decorator)\\n #\\n # Maps a property name to its util.filecacheentry\\n self._filecache = {}\\n \\n # hold sets of revision to be filtered\\n # should be cleared when something might have changed the filter value:\\n # - new changesets,\\n # - phase change,\\n # - new obsolescence marker,\\n # - working directory parent change,\\n # - bookmark changes\\n self.filteredrevcache = {}\\n \\n # post-dirstate-status hooks\\n self._postdsstatus = []\\n \\n # Cache of types representing filtered repos.\\n self._filteredrepotypes = weakref.WeakKeyDictionary()\\n \\n # generic mapping between names and nodes\\n self.names = namespaces.namespaces()\\n \\n # Key to signature value.\\n self._sparsesignaturecache = {}\\n # Signature to cached matcher instance.\\n self._sparsematchercache = {}\\n \\n def _getvfsward(self, origfunc):\\n \\\"\\\"\\\"build a ward for self.vfs\\\"\\\"\\\"\\n rref = weakref.ref(self)\\n def checkvfs(path, mode=None):\\n ret = origfunc(path, mode=mode)\\n repo = rref()\\n if (repo is None\\n or not util.safehasattr(repo, '_wlockref')\\n or not util.safehasattr(repo, '_lockref')):\\n return\\n if mode in (None, 'r', 'rb'):\\n return\\n if path.startswith(repo.path):\\n # truncate name relative to the repository (.hg)\\n path = path[len(repo.path) + 1:]\\n if path.startswith('cache\\/'):\\n msg = 'accessing cache with vfs instead of cachevfs: \\\"%s\\\"'\\n repo.ui.develwarn(msg % path, stacklevel=2, config=\\\"cache-vfs\\\")\\n if path.startswith('journal.'):\\n # journal is covered by 'lock'\\n if repo._currentlock(repo._lockref) is None:\\n repo.ui.develwarn('write with no lock: \\\"%s\\\"' % path,\\n stacklevel=2, config='check-locks')\\n elif repo._currentlock(repo._wlockref) is None:\\n # rest of vfs files are covered by 'wlock'\\n #\\n # exclude special files\\n for prefix in self._wlockfreeprefix:\\n if path.startswith(prefix):\\n return\\n repo.ui.develwarn('write with no wlock: \\\"%s\\\"' % path,\\n stacklevel=2, config='check-locks')\\n return ret\\n return checkvfs\\n \\n def _getsvfsward(self, origfunc):\\n \\\"\\\"\\\"build a ward for self.svfs\\\"\\\"\\\"\\n rref = weakref.ref(self)\\n def checksvfs(path, mode=None):\\n ret = origfunc(path, mode=mode)\\n repo = rref()\\n if repo is None or not util.safehasattr(repo, '_lockref'):\\n return\\n if mode in (None, 'r', 'rb'):\\n return\\n if path.startswith(repo.sharedpath):\\n # truncate name relative to the repository (.hg)\\n path = path[len(repo.sharedpath) + 1:]\\n if repo._currentlock(repo._lockref) is None:\\n repo.ui.develwarn('write with no lock: \\\"%s\\\"' % path,\\n stacklevel=3)\\n return ret\\n return checksvfs\\n \\n def close(self):\\n self._writecaches()\\n \\n+ def addvisibilityexceptions(self, exceptions):\\n+ # should be called on a filtered repository\\n+ pass\\n+\\n+ def getvisibilityexceptions(self):\\n+ # should be called on a filtered repository\\n+ return set()\\n+\\n def _loadextensions(self):\\n extensions.loadall(self.ui)\\n \\n def _writecaches(self):\\n if self._revbranchcache:\\n self._revbranchcache.write()\\n \\n def _restrictcapabilities(self, caps):\\n if self.ui.configbool('experimental', 'bundle2-advertise'):\\n caps = set(caps)\\n capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))\\n caps.add('bundle2=' + urlreq.quote(capsblob))\\n return caps\\n \\n def _applyopenerreqs(self):\\n self.svfs.options = dict((r, 1) for r in self.requirements\\n if r in self.openerreqs)\\n # experimental config: format.chunkcachesize\\n chunkcachesize = self.ui.configint('format', 'chunkcachesize')\\n if chunkcachesize is not None:\\n self.svfs.options['chunkcachesize'] = chunkcachesize\\n # experimental config: format.maxchainlen\\n maxchainlen = self.ui.configint('format', 'maxchainlen')\\n if maxchainlen is not None:\\n self.svfs.options['maxchainlen'] = maxchainlen\\n # experimental config: format.manifestcachesize\\n manifestcachesize = self.ui.configint('format', 'manifestcachesize')\\n if manifestcachesize is not None:\\n self.svfs.options['manifestcachesize'] = manifestcachesize\\n # experimental config: format.aggressivemergedeltas\\n aggressivemergedeltas = self.ui.configbool('format',\\n 'aggressivemergedeltas')\\n self.svfs.options['aggressivemergedeltas'] = aggressivemergedeltas\\n self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui)\\n chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan')\\n if 0 \\u003c= chainspan:\\n self.svfs.options['maxdeltachainspan'] = chainspan\\n mmapindexthreshold = self.ui.configbytes('experimental',\\n 'mmapindexthreshold')\\n if mmapindexthreshold is not None:\\n self.svfs.options['mmapindexthreshold'] = mmapindexthreshold\\n withsparseread = self.ui.configbool('experimental', 'sparse-read')\\n srdensitythres = float(self.ui.config('experimental',\\n 'sparse-read.density-threshold'))\\n srmingapsize = self.ui.configbytes('experimental',\\n 'sparse-read.min-gap-size')\\n self.svfs.options['with-sparse-read'] = withsparseread\\n self.svfs.options['sparse-read-density-threshold'] = srdensitythres\\n self.svfs.options['sparse-read-min-gap-size'] = srmingapsize\\n \\n for r in self.requirements:\\n if r.startswith('exp-compression-'):\\n self.svfs.options['compengine'] = r[len('exp-compression-'):]\\n \\n # TODO move \\\"revlogv2\\\" to openerreqs once finalized.\\n if REVLOGV2_REQUIREMENT in self.requirements:\\n self.svfs.options['revlogv2'] = True\\n \\n def _writerequirements(self):\\n scmutil.writerequires(self.vfs, self.requirements)\\n \\n def _checknested(self, path):\\n \\\"\\\"\\\"Determine if path is a legal nested repository.\\\"\\\"\\\"\\n if not path.startswith(self.root):\\n return False\\n subpath = path[len(self.root) + 1:]\\n normsubpath = util.pconvert(subpath)\\n \\n # XXX: Checking against the current working copy is wrong in\\n # the sense that it can reject things like\\n #\\n # $ hg cat -r 10 sub\\/x.txt\\n #\\n # if sub\\/ is no longer a subrepository in the working copy\\n # parent revision.\\n #\\n # However, it can of course also allow things that would have\\n # been rejected before, such as the above cat command if sub\\/\\n # is a subrepository now, but was a normal directory before.\\n # The old path auditor would have rejected by mistake since it\\n # panics when it sees sub\\/.hg\\/.\\n #\\n # All in all, checking against the working copy seems sensible\\n # since we want to prevent access to nested repositories on\\n # the filesystem *now*.\\n ctx = self[None]\\n parts = util.splitpath(subpath)\\n while parts:\\n prefix = '\\/'.join(parts)\\n if prefix in ctx.substate:\\n if prefix == normsubpath:\\n return True\\n else:\\n sub = ctx.sub(prefix)\\n return sub.checknested(subpath[len(prefix) + 1:])\\n else:\\n parts.pop()\\n return False\\n \\n def peer(self):\\n return localpeer(self) # not cached to avoid reference cycle\\n \\n def unfiltered(self):\\n \\\"\\\"\\\"Return unfiltered version of the repository\\n \\n Intended to be overwritten by filtered repo.\\\"\\\"\\\"\\n return self\\n \\n def filtered(self, name):\\n \\\"\\\"\\\"Return a filtered version of a repository\\\"\\\"\\\"\\n # Python \\u003c3.4 easily leaks types via __mro__. See\\n # https:\\/\\/bugs.python.org\\/issue17950. We cache dynamically\\n # created types so this method doesn't leak on every\\n # invocation.\\n \\n key = self.unfiltered().__class__\\n if key not in self._filteredrepotypes:\\n # Build a new type with the repoview mixin and the base\\n # class of this repo. Give it a name containing the\\n # filter name to aid debugging.\\n bases = (repoview.repoview, key)\\n cls = type(r'%sfilteredrepo' % name, bases, {})\\n self._filteredrepotypes[key] = cls\\n \\n return self._filteredrepotypes[key](self, name)\\n \\n @repofilecache('bookmarks', 'bookmarks.current')\\n def _bookmarks(self):\\n return bookmarks.bmstore(self)\\n \\n @property\\n def _activebookmark(self):\\n return self._bookmarks.active\\n \\n # _phaserevs and _phasesets depend on changelog. what we need is to\\n # call _phasecache.invalidate() if '00changelog.i' was changed, but it\\n # can't be easily expressed in filecache mechanism.\\n @storecache('phaseroots', '00changelog.i')\\n def _phasecache(self):\\n return phases.phasecache(self, self._phasedefaults)\\n \\n @storecache('obsstore')\\n def obsstore(self):\\n return obsolete.makestore(self.ui, self)\\n \\n @storecache('00changelog.i')\\n def changelog(self):\\n return changelog.changelog(self.svfs,\\n trypending=txnutil.mayhavepending(self.root))\\n \\n def _constructmanifest(self):\\n # This is a temporary function while we migrate from manifest to\\n # manifestlog. It allows bundlerepo and unionrepo to intercept the\\n # manifest creation.\\n return manifest.manifestrevlog(self.svfs)\\n \\n @storecache('00manifest.i')\\n def manifestlog(self):\\n return manifest.manifestlog(self.svfs, self)\\n \\n @repofilecache('dirstate')\\n def dirstate(self):\\n sparsematchfn = lambda: sparse.matcher(self)\\n \\n return dirstate.dirstate(self.vfs, self.ui, self.root,\\n self._dirstatevalidate, sparsematchfn)\\n \\n def _dirstatevalidate(self, node):\\n try:\\n self.changelog.rev(node)\\n return node\\n except error.LookupError:\\n if not self._dirstatevalidatewarned:\\n self._dirstatevalidatewarned = True\\n self.ui.warn(_(\\\"warning: ignoring unknown\\\"\\n \\\" working parent %s!\\\\n\\\") % short(node))\\n return nullid\\n \\n def __getitem__(self, changeid):\\n if changeid is None:\\n return context.workingctx(self)\\n if isinstance(changeid, slice):\\n # wdirrev isn't contiguous so the slice shouldn't include it\\n return [context.changectx(self, i)\\n for i in xrange(*changeid.indices(len(self)))\\n if i not in self.changelog.filteredrevs]\\n try:\\n return context.changectx(self, changeid)\\n except error.WdirUnsupported:\\n return context.workingctx(self)\\n \\n def __contains__(self, changeid):\\n \\\"\\\"\\\"True if the given changeid exists\\n \\n error.LookupError is raised if an ambiguous node specified.\\n \\\"\\\"\\\"\\n try:\\n self[changeid]\\n return True\\n except error.RepoLookupError:\\n return False\\n \\n def __nonzero__(self):\\n return True\\n \\n __bool__ = __nonzero__\\n \\n def __len__(self):\\n return len(self.changelog)\\n \\n def __iter__(self):\\n return iter(self.changelog)\\n \\n def revs(self, expr, *args):\\n '''Find revisions matching a revset.\\n \\n The revset is specified as a string ``expr`` that may contain\\n %-formatting to escape certain types. See ``revsetlang.formatspec``.\\n \\n Revset aliases from the configuration are not expanded. To expand\\n user aliases, consider calling ``scmutil.revrange()`` or\\n ``repo.anyrevs([expr], user=True)``.\\n \\n Returns a revset.abstractsmartset, which is a list-like interface\\n that contains integer revisions.\\n '''\\n expr = revsetlang.formatspec(expr, *args)\\n m = revset.match(None, expr)\\n return m(self)\\n \\n def set(self, expr, *args):\\n '''Find revisions matching a revset and emit changectx instances.\\n \\n This is a convenience wrapper around ``revs()`` that iterates the\\n result and is a generator of changectx instances.\\n \\n Revset aliases from the configuration are not expanded. To expand\\n user aliases, consider calling ``scmutil.revrange()``.\\n '''\\n for r in self.revs(expr, *args):\\n yield self[r]\\n \\n def anyrevs(self, specs, user=False, localalias=None):\\n '''Find revisions matching one of the given revsets.\\n \\n Revset aliases from the configuration are not expanded by default. To\\n expand user aliases, specify ``user=True``. To provide some local\\n definitions overriding user aliases, set ``localalias`` to\\n ``{name: definitionstring}``.\\n '''\\n if user:\\n m = revset.matchany(self.ui, specs, repo=self,\\n localalias=localalias)\\n else:\\n m = revset.matchany(None, specs, localalias=localalias)\\n return m(self)\\n \\n def url(self):\\n return 'file:' + self.root\\n \\n def hook(self, name, throw=False, **args):\\n \\\"\\\"\\\"Call a hook, passing this repo instance.\\n \\n This a convenience method to aid invoking hooks. Extensions likely\\n won't call this unless they have registered a custom hook or are\\n replacing code that is expected to call a hook.\\n \\\"\\\"\\\"\\n return hook.hook(self.ui, self, name, throw, **args)\\n \\n @filteredpropertycache\\n def _tagscache(self):\\n '''Returns a tagscache object that contains various tags related\\n caches.'''\\n \\n # This simplifies its cache management by having one decorated\\n # function (this one) and the rest simply fetch things from it.\\n class tagscache(object):\\n def __init__(self):\\n # These two define the set of tags for this repository. tags\\n # maps tag name to node; tagtypes maps tag name to 'global' or\\n # 'local'. (Global tags are defined by .hgtags across all\\n # heads, and local tags are defined in .hg\\/localtags.)\\n # They constitute the in-memory cache of tags.\\n self.tags = self.tagtypes = None\\n \\n self.nodetagscache = self.tagslist = None\\n \\n cache = tagscache()\\n cache.tags, cache.tagtypes = self._findtags()\\n \\n return cache\\n \\n def tags(self):\\n '''return a mapping of tag to node'''\\n t = {}\\n if self.changelog.filteredrevs:\\n tags, tt = self._findtags()\\n else:\\n tags = self._tagscache.tags\\n for k, v in tags.iteritems():\\n try:\\n # ignore tags to unknown nodes\\n self.changelog.rev(v)\\n t[k] = v\\n except (error.LookupError, ValueError):\\n pass\\n return t\\n \\n def _findtags(self):\\n '''Do the hard work of finding tags. Return a pair of dicts\\n (tags, tagtypes) where tags maps tag name to node, and tagtypes\\n maps tag name to a string like \\\\'global\\\\' or \\\\'local\\\\'.\\n Subclasses or extensions are free to add their own tags, but\\n should be aware that the returned dicts will be retained for the\\n duration of the localrepo object.'''\\n \\n # XXX what tagtype should subclasses\\/extensions use? Currently\\n # mq and bookmarks add tags, but do not set the tagtype at all.\\n # Should each extension invent its own tag type? Should there\\n # be one tagtype for all such \\\"virtual\\\" tags? Or is the status\\n # quo fine?\\n \\n \\n # map tag name to (node, hist)\\n alltags = tagsmod.findglobaltags(self.ui, self)\\n # map tag name to tag type\\n tagtypes = dict((tag, 'global') for tag in alltags)\\n \\n tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)\\n \\n # Build the return dicts. Have to re-encode tag names because\\n # the tags module always uses UTF-8 (in order not to lose info\\n # writing to the cache), but the rest of Mercurial wants them in\\n # local encoding.\\n tags = {}\\n for (name, (node, hist)) in alltags.iteritems():\\n if node != nullid:\\n tags[encoding.tolocal(name)] = node\\n tags['tip'] = self.changelog.tip()\\n tagtypes = dict([(encoding.tolocal(name), value)\\n for (name, value) in tagtypes.iteritems()])\\n return (tags, tagtypes)\\n \\n def tagtype(self, tagname):\\n '''\\n return the type of the given tag. result can be:\\n \\n 'local' : a local tag\\n 'global' : a global tag\\n None : tag does not exist\\n '''\\n \\n return self._tagscache.tagtypes.get(tagname)\\n \\n def tagslist(self):\\n '''return a list of tags ordered by revision'''\\n if not self._tagscache.tagslist:\\n l = []\\n for t, n in self.tags().iteritems():\\n l.append((self.changelog.rev(n), t, n))\\n self._tagscache.tagslist = [(t, n) for r, t, n in sorted(l)]\\n \\n return self._tagscache.tagslist\\n \\n def nodetags(self, node):\\n '''return the tags associated with a node'''\\n if not self._tagscache.nodetagscache:\\n nodetagscache = {}\\n for t, n in self._tagscache.tags.iteritems():\\n nodetagscache.setdefault(n, []).append(t)\\n for tags in nodetagscache.itervalues():\\n tags.sort()\\n self._tagscache.nodetagscache = nodetagscache\\n return self._tagscache.nodetagscache.get(node, [])\\n \\n def nodebookmarks(self, node):\\n \\\"\\\"\\\"return the list of bookmarks pointing to the specified node\\\"\\\"\\\"\\n marks = []\\n for bookmark, n in self._bookmarks.iteritems():\\n if n == node:\\n marks.append(bookmark)\\n return sorted(marks)\\n \\n def branchmap(self):\\n '''returns a dictionary {branch: [branchheads]} with branchheads\\n ordered by increasing revision number'''\\n branchmap.updatecache(self)\\n return self._branchcaches[self.filtername]\\n \\n @unfilteredmethod\\n def revbranchcache(self):\\n if not self._revbranchcache:\\n self._revbranchcache = branchmap.revbranchcache(self.unfiltered())\\n return self._revbranchcache\\n \\n def branchtip(self, branch, ignoremissing=False):\\n '''return the tip node for a given branch\\n \\n If ignoremissing is True, then this method will not raise an error.\\n This is helpful for callers that only expect None for a missing branch\\n (e.g. namespace).\\n \\n '''\\n try:\\n return self.branchmap().branchtip(branch)\\n except KeyError:\\n if not ignoremissing:\\n raise error.RepoLookupError(_(\\\"unknown branch '%s'\\\") % branch)\\n else:\\n pass\\n \\n def lookup(self, key):\\n return self[key].node()\\n \\n def lookupbranch(self, key, remote=None):\\n repo = remote or self\\n if key in repo.branchmap():\\n return key\\n \\n repo = (remote and remote.local()) and remote or self\\n return repo[key].branch()\\n \\n def known(self, nodes):\\n cl = self.changelog\\n nm = cl.nodemap\\n filtered = cl.filteredrevs\\n result = []\\n for n in nodes:\\n r = nm.get(n)\\n resp = not (r is None or r in filtered)\\n result.append(resp)\\n return result\\n \\n def local(self):\\n return self\\n \\n def publishing(self):\\n # it's safe (and desirable) to trust the publish flag unconditionally\\n # so that we don't finalize changes shared between users via ssh or nfs\\n return self.ui.configbool('phases', 'publish', untrusted=True)\\n \\n def cancopy(self):\\n # so statichttprepo's override of local() works\\n if not self.local():\\n return False\\n if not self.publishing():\\n return True\\n # if publishing we can't copy if there is filtered content\\n return not self.filtered('visible').changelog.filteredrevs\\n \\n def shared(self):\\n '''the type of shared repository (None if not shared)'''\\n if self.sharedpath != self.path:\\n return 'store'\\n return None\\n \\n def wjoin(self, f, *insidef):\\n return self.vfs.reljoin(self.root, f, *insidef)\\n \\n def file(self, f):\\n if f[0] == '\\/':\\n f = f[1:]\\n return filelog.filelog(self.svfs, f)\\n \\n def changectx(self, changeid):\\n return self[changeid]\\n \\n def setparents(self, p1, p2=nullid):\\n with self.dirstate.parentchange():\\n copies = self.dirstate.setparents(p1, p2)\\n pctx = self[p1]\\n if copies:\\n # Adjust copy records, the dirstate cannot do it, it\\n # requires access to parents manifests. Preserve them\\n # only for entries added to first parent.\\n for f in copies:\\n if f not in pctx and copies[f] in pctx:\\n self.dirstate.copy(copies[f], f)\\n if p2 == nullid:\\n for f, s in sorted(self.dirstate.copies().items()):\\n if f not in pctx and s not in pctx:\\n self.dirstate.copy(None, f)\\n \\n def filectx(self, path, changeid=None, fileid=None):\\n \\\"\\\"\\\"changeid can be a changeset revision, node, or tag.\\n fileid can be a file revision or node.\\\"\\\"\\\"\\n return context.filectx(self, path, changeid, fileid)\\n \\n def getcwd(self):\\n return self.dirstate.getcwd()\\n \\n def pathto(self, f, cwd=None):\\n return self.dirstate.pathto(f, cwd)\\n \\n def _loadfilter(self, filter):\\n if filter not in self.filterpats:\\n l = []\\n for pat, cmd in self.ui.configitems(filter):\\n if cmd == '!':\\n continue\\n mf = matchmod.match(self.root, '', [pat])\\n fn = None\\n params = cmd\\n for name, filterfn in self._datafilters.iteritems():\\n if cmd.startswith(name):\\n fn = filterfn\\n params = cmd[len(name):].lstrip()\\n break\\n if not fn:\\n fn = lambda s, c, **kwargs: util.filter(s, c)\\n # Wrap old filters not supporting keyword arguments\\n if not inspect.getargspec(fn)[2]:\\n oldfn = fn\\n fn = lambda s, c, **kwargs: oldfn(s, c)\\n l.append((mf, fn, params))\\n self.filterpats[filter] = l\\n return self.filterpats[filter]\\n \\n def _filter(self, filterpats, filename, data):\\n for mf, fn, cmd in filterpats:\\n if mf(filename):\\n self.ui.debug(\\\"filtering %s through %s\\\\n\\\" % (filename, cmd))\\n data = fn(data, cmd, ui=self.ui, repo=self, filename=filename)\\n break\\n \\n return data\\n \\n @unfilteredpropertycache\\n def _encodefilterpats(self):\\n return self._loadfilter('encode')\\n \\n @unfilteredpropertycache\\n def _decodefilterpats(self):\\n return self._loadfilter('decode')\\n \\n def adddatafilter(self, name, filter):\\n self._datafilters[name] = filter\\n \\n def wread(self, filename):\\n if self.wvfs.islink(filename):\\n data = self.wvfs.readlink(filename)\\n else:\\n data = self.wvfs.read(filename)\\n return self._filter(self._encodefilterpats, filename, data)\\n \\n def wwrite(self, filename, data, flags, backgroundclose=False):\\n \\\"\\\"\\\"write ``data`` into ``filename`` in the working directory\\n \\n This returns length of written (maybe decoded) data.\\n \\\"\\\"\\\"\\n data = self._filter(self._decodefilterpats, filename, data)\\n if 'l' in flags:\\n self.wvfs.symlink(data, filename)\\n else:\\n self.wvfs.write(filename, data, backgroundclose=backgroundclose)\\n if 'x' in flags:\\n self.wvfs.setflags(filename, False, True)\\n return len(data)\\n \\n def wwritedata(self, filename, data):\\n return self._filter(self._decodefilterpats, filename, data)\\n \\n def currenttransaction(self):\\n \\\"\\\"\\\"return the current transaction or None if non exists\\\"\\\"\\\"\\n if self._transref:\\n tr = self._transref()\\n else:\\n tr = None\\n \\n if tr and tr.running():\\n return tr\\n return None\\n \\n def transaction(self, desc, report=None):\\n if (self.ui.configbool('devel', 'all-warnings')\\n or self.ui.configbool('devel', 'check-locks')):\\n if self._currentlock(self._lockref) is None:\\n raise error.ProgrammingError('transaction requires locking')\\n tr = self.currenttransaction()\\n if tr is not None:\\n scmutil.registersummarycallback(self, tr, desc)\\n return tr.nest()\\n \\n # abort here if the journal already exists\\n if self.svfs.exists(\\\"journal\\\"):\\n raise error.RepoError(\\n _(\\\"abandoned transaction found\\\"),\\n hint=_(\\\"run 'hg recover' to clean up transaction\\\"))\\n \\n idbase = \\\"%.40f#%f\\\" % (random.random(), time.time())\\n ha = hex(hashlib.sha1(idbase).digest())\\n txnid = 'TXN:' + ha\\n self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)\\n \\n self._writejournal(desc)\\n renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]\\n if report:\\n rp = report\\n else:\\n rp = self.ui.warn\\n vfsmap = {'plain': self.vfs} # root of .hg\\/\\n # we must avoid cyclic reference between repo and transaction.\\n reporef = weakref.ref(self)\\n # Code to track tag movement\\n #\\n # Since tags are all handled as file content, it is actually quite hard\\n # to track these movement from a code perspective. So we fallback to a\\n # tracking at the repository level. One could envision to track changes\\n # to the '.hgtags' file through changegroup apply but that fails to\\n # cope with case where transaction expose new heads without changegroup\\n # being involved (eg: phase movement).\\n #\\n # For now, We gate the feature behind a flag since this likely comes\\n # with performance impacts. The current code run more often than needed\\n # and do not use caches as much as it could. The current focus is on\\n # the behavior of the feature so we disable it by default. The flag\\n # will be removed when we are happy with the performance impact.\\n #\\n # Once this feature is no longer experimental move the following\\n # documentation to the appropriate help section:\\n #\\n # The ``HG_TAG_MOVED`` variable will be set if the transaction touched\\n # tags (new or changed or deleted tags). In addition the details of\\n # these changes are made available in a file at:\\n # ``REPOROOT\\/.hg\\/changes\\/tags.changes``.\\n # Make sure you check for HG_TAG_MOVED before reading that file as it\\n # might exist from a previous transaction even if no tag were touched\\n # in this one. Changes are recorded in a line base format::\\n #\\n # \\u003caction\\u003e \\u003chex-node\\u003e \\u003ctag-name\\u003e\\\\n\\n #\\n # Actions are defined as follow:\\n # \\\"-R\\\": tag is removed,\\n # \\\"+A\\\": tag is added,\\n # \\\"-M\\\": tag is moved (old value),\\n # \\\"+M\\\": tag is moved (new value),\\n tracktags = lambda x: None\\n # experimental config: experimental.hook-track-tags\\n shouldtracktags = self.ui.configbool('experimental', 'hook-track-tags')\\n if desc != 'strip' and shouldtracktags:\\n oldheads = self.changelog.headrevs()\\n def tracktags(tr2):\\n repo = reporef()\\n oldfnodes = tagsmod.fnoderevs(repo.ui, repo, oldheads)\\n newheads = repo.changelog.headrevs()\\n newfnodes = tagsmod.fnoderevs(repo.ui, repo, newheads)\\n # notes: we compare lists here.\\n # As we do it only once buiding set would not be cheaper\\n changes = tagsmod.difftags(repo.ui, repo, oldfnodes, newfnodes)\\n if changes:\\n tr2.hookargs['tag_moved'] = '1'\\n with repo.vfs('changes\\/tags.changes', 'w',\\n atomictemp=True) as changesfile:\\n # note: we do not register the file to the transaction\\n # because we needs it to still exist on the transaction\\n # is close (for txnclose hooks)\\n tagsmod.writediff(changesfile, changes)\\n def validate(tr2):\\n \\\"\\\"\\\"will run pre-closing hooks\\\"\\\"\\\"\\n # XXX the transaction API is a bit lacking here so we take a hacky\\n # path for now\\n #\\n # We cannot add this as a \\\"pending\\\" hooks since the 'tr.hookargs'\\n # dict is copied before these run. In addition we needs the data\\n # available to in memory hooks too.\\n #\\n # Moreover, we also need to make sure this runs before txnclose\\n # hooks and there is no \\\"pending\\\" mechanism that would execute\\n # logic only if hooks are about to run.\\n #\\n # Fixing this limitation of the transaction is also needed to track\\n # other families of changes (bookmarks, phases, obsolescence).\\n #\\n # This will have to be fixed before we remove the experimental\\n # gating.\\n tracktags(tr2)\\n repo = reporef()\\n if repo.ui.configbool('experimental', 'single-head-per-branch'):\\n scmutil.enforcesinglehead(repo, tr2, desc)\\n if hook.hashook(repo.ui, 'pretxnclose-bookmark'):\\n for name, (old, new) in sorted(tr.changes['bookmarks'].items()):\\n args = tr.hookargs.copy()\\n args.update(bookmarks.preparehookargs(name, old, new))\\n repo.hook('pretxnclose-bookmark', throw=True,\\n txnname=desc,\\n **pycompat.strkwargs(args))\\n if hook.hashook(repo.ui, 'pretxnclose-phase'):\\n cl = repo.unfiltered().changelog\\n for rev, (old, new) in tr.changes['phases'].items():\\n args = tr.hookargs.copy()\\n node = hex(cl.node(rev))\\n args.update(phases.preparehookargs(node, old, new))\\n repo.hook('pretxnclose-phase', throw=True, txnname=desc,\\n **pycompat.strkwargs(args))\\n \\n repo.hook('pretxnclose', throw=True,\\n txnname=desc, **pycompat.strkwargs(tr.hookargs))\\n def releasefn(tr, success):\\n repo = reporef()\\n if success:\\n # this should be explicitly invoked here, because\\n # in-memory changes aren't written out at closing\\n # transaction, if tr.addfilegenerator (via\\n # dirstate.write or so) isn't invoked while\\n # transaction running\\n repo.dirstate.write(None)\\n else:\\n # discard all changes (including ones already written\\n # out) in this transaction\\n repo.dirstate.restorebackup(None, 'journal.dirstate')\\n \\n repo.invalidate(clearfilecache=True)\\n \\n tr = transaction.transaction(rp, self.svfs, vfsmap,\\n \\\"journal\\\",\\n \\\"undo\\\",\\n aftertrans(renames),\\n self.store.createmode,\\n validator=validate,\\n releasefn=releasefn,\\n checkambigfiles=_cachedfiles)\\n tr.changes['revs'] = set()\\n tr.changes['obsmarkers'] = set()\\n tr.changes['phases'] = {}\\n tr.changes['bookmarks'] = {}\\n \\n tr.hookargs['txnid'] = txnid\\n # note: writing the fncache only during finalize mean that the file is\\n # outdated when running hooks. As fncache is used for streaming clone,\\n # this is not expected to break anything that happen during the hooks.\\n tr.addfinalize('flush-fncache', self.store.write)\\n def txnclosehook(tr2):\\n \\\"\\\"\\\"To be run if transaction is successful, will schedule a hook run\\n \\\"\\\"\\\"\\n # Don't reference tr2 in hook() so we don't hold a reference.\\n # This reduces memory consumption when there are multiple\\n # transactions per lock. This can likely go away if issue5045\\n # fixes the function accumulation.\\n hookargs = tr2.hookargs\\n \\n def hookfunc():\\n repo = reporef()\\n if hook.hashook(repo.ui, 'txnclose-bookmark'):\\n bmchanges = sorted(tr.changes['bookmarks'].items())\\n for name, (old, new) in bmchanges:\\n args = tr.hookargs.copy()\\n args.update(bookmarks.preparehookargs(name, old, new))\\n repo.hook('txnclose-bookmark', throw=False,\\n txnname=desc, **pycompat.strkwargs(args))\\n \\n if hook.hashook(repo.ui, 'txnclose-phase'):\\n cl = repo.unfiltered().changelog\\n phasemv = sorted(tr.changes['phases'].items())\\n for rev, (old, new) in phasemv:\\n args = tr.hookargs.copy()\\n node = hex(cl.node(rev))\\n args.update(phases.preparehookargs(node, old, new))\\n repo.hook('txnclose-phase', throw=False, txnname=desc,\\n **pycompat.strkwargs(args))\\n \\n repo.hook('txnclose', throw=False, txnname=desc,\\n **pycompat.strkwargs(hookargs))\\n reporef()._afterlock(hookfunc)\\n tr.addfinalize('txnclose-hook', txnclosehook)\\n tr.addpostclose('warms-cache', self._buildcacheupdater(tr))\\n def txnaborthook(tr2):\\n \\\"\\\"\\\"To be run if transaction is aborted\\n \\\"\\\"\\\"\\n reporef().hook('txnabort', throw=False, txnname=desc,\\n **tr2.hookargs)\\n tr.addabort('txnabort-hook', txnaborthook)\\n # avoid eager cache invalidation. in-memory data should be identical\\n # to stored data if transaction has no error.\\n tr.addpostclose('refresh-filecachestats', self._refreshfilecachestats)\\n self._transref = weakref.ref(tr)\\n scmutil.registersummarycallback(self, tr, desc)\\n return tr\\n \\n def _journalfiles(self):\\n return ((self.svfs, 'journal'),\\n (self.vfs, 'journal.dirstate'),\\n (self.vfs, 'journal.branch'),\\n (self.vfs, 'journal.desc'),\\n (self.vfs, 'journal.bookmarks'),\\n (self.svfs, 'journal.phaseroots'))\\n \\n def undofiles(self):\\n return [(vfs, undoname(x)) for vfs, x in self._journalfiles()]\\n \\n @unfilteredmethod\\n def _writejournal(self, desc):\\n self.dirstate.savebackup(None, 'journal.dirstate')\\n self.vfs.write(\\\"journal.branch\\\",\\n encoding.fromlocal(self.dirstate.branch()))\\n self.vfs.write(\\\"journal.desc\\\",\\n \\\"%d\\\\n%s\\\\n\\\" % (len(self), desc))\\n self.vfs.write(\\\"journal.bookmarks\\\",\\n self.vfs.tryread(\\\"bookmarks\\\"))\\n self.svfs.write(\\\"journal.phaseroots\\\",\\n self.svfs.tryread(\\\"phaseroots\\\"))\\n \\n def recover(self):\\n with self.lock():\\n if self.svfs.exists(\\\"journal\\\"):\\n self.ui.status(_(\\\"rolling back interrupted transaction\\\\n\\\"))\\n vfsmap = {'': self.svfs,\\n 'plain': self.vfs,}\\n transaction.rollback(self.svfs, vfsmap, \\\"journal\\\",\\n self.ui.warn,\\n checkambigfiles=_cachedfiles)\\n self.invalidate()\\n return True\\n else:\\n self.ui.warn(_(\\\"no interrupted transaction available\\\\n\\\"))\\n return False\\n \\n def rollback(self, dryrun=False, force=False):\\n wlock = lock = dsguard = None\\n try:\\n wlock = self.wlock()\\n lock = self.lock()\\n if self.svfs.exists(\\\"undo\\\"):\\n dsguard = dirstateguard.dirstateguard(self, 'rollback')\\n \\n return self._rollback(dryrun, force, dsguard)\\n else:\\n self.ui.warn(_(\\\"no rollback information available\\\\n\\\"))\\n return 1\\n finally:\\n release(dsguard, lock, wlock)\\n \\n @unfilteredmethod # Until we get smarter cache management\\n def _rollback(self, dryrun, force, dsguard):\\n ui = self.ui\\n try:\\n args = self.vfs.read('undo.desc').splitlines()\\n (oldlen, desc, detail) = (int(args[0]), args[1], None)\\n if len(args) \\u003e= 3:\\n detail = args[2]\\n oldtip = oldlen - 1\\n \\n if detail and ui.verbose:\\n msg = (_('repository tip rolled back to revision %d'\\n ' (undo %s: %s)\\\\n')\\n % (oldtip, desc, detail))\\n else:\\n msg = (_('repository tip rolled back to revision %d'\\n ' (undo %s)\\\\n')\\n % (oldtip, desc))\\n except IOError:\\n msg = _('rolling back unknown transaction\\\\n')\\n desc = None\\n \\n if not force and self['.'] != self['tip'] and desc == 'commit':\\n raise error.Abort(\\n _('rollback of last commit while not checked out '\\n 'may lose data'), hint=_('use -f to force'))\\n \\n ui.status(msg)\\n if dryrun:\\n return 0\\n \\n parents = self.dirstate.parents()\\n self.destroying()\\n vfsmap = {'plain': self.vfs, '': self.svfs}\\n transaction.rollback(self.svfs, vfsmap, 'undo', ui.warn,\\n checkambigfiles=_cachedfiles)\\n if self.vfs.exists('undo.bookmarks'):\\n self.vfs.rename('undo.bookmarks', 'bookmarks', checkambig=True)\\n if self.svfs.exists('undo.phaseroots'):\\n self.svfs.rename('undo.phaseroots', 'phaseroots', checkambig=True)\\n self.invalidate()\\n \\n parentgone = (parents[0] not in self.changelog.nodemap or\\n parents[1] not in self.changelog.nodemap)\\n if parentgone:\\n # prevent dirstateguard from overwriting already restored one\\n dsguard.close()\\n \\n self.dirstate.restorebackup(None, 'undo.dirstate')\\n try:\\n branch = self.vfs.read('undo.branch')\\n self.dirstate.setbranch(encoding.tolocal(branch))\\n except IOError:\\n ui.warn(_('named branch could not be reset: '\\n 'current branch is still \\\\'%s\\\\'\\\\n')\\n % self.dirstate.branch())\\n \\n parents = tuple([p.rev() for p in self[None].parents()])\\n if len(parents) \\u003e 1:\\n ui.status(_('working directory now based on '\\n 'revisions %d and %d\\\\n') % parents)\\n else:\\n ui.status(_('working directory now based on '\\n 'revision %d\\\\n') % parents)\\n mergemod.mergestate.clean(self, self['.'].node())\\n \\n # TODO: if we know which new heads may result from this rollback, pass\\n # them to destroy(), which will prevent the branchhead cache from being\\n # invalidated.\\n self.destroyed()\\n return 0\\n \\n def _buildcacheupdater(self, newtransaction):\\n \\\"\\\"\\\"called during transaction to build the callback updating cache\\n \\n Lives on the repository to help extension who might want to augment\\n this logic. For this purpose, the created transaction is passed to the\\n method.\\n \\\"\\\"\\\"\\n # we must avoid cyclic reference between repo and transaction.\\n reporef = weakref.ref(self)\\n def updater(tr):\\n repo = reporef()\\n repo.updatecaches(tr)\\n return updater\\n \\n @unfilteredmethod\\n def updatecaches(self, tr=None):\\n \\\"\\\"\\\"warm appropriate caches\\n \\n If this function is called after a transaction closed. The transaction\\n will be available in the 'tr' argument. This can be used to selectively\\n update caches relevant to the changes in that transaction.\\n \\\"\\\"\\\"\\n if tr is not None and tr.hookargs.get('source') == 'strip':\\n # During strip, many caches are invalid but\\n # later call to `destroyed` will refresh them.\\n return\\n \\n if tr is None or tr.changes['revs']:\\n # updating the unfiltered branchmap should refresh all the others,\\n self.ui.debug('updating the branch cache\\\\n')\\n branchmap.updatecache(self.filtered('served'))\\n \\n def invalidatecaches(self):\\n \\n if '_tagscache' in vars(self):\\n # can't use delattr on proxy\\n del self.__dict__['_tagscache']\\n \\n self.unfiltered()._branchcaches.clear()\\n self.invalidatevolatilesets()\\n self._sparsesignaturecache.clear()\\n \\n def invalidatevolatilesets(self):\\n self.filteredrevcache.clear()\\n obsolete.clearobscaches(self)\\n \\n def invalidatedirstate(self):\\n '''Invalidates the dirstate, causing the next call to dirstate\\n to check if it was modified since the last time it was read,\\n rereading it if it has.\\n \\n This is different to dirstate.invalidate() that it doesn't always\\n rereads the dirstate. Use dirstate.invalidate() if you want to\\n explicitly read the dirstate again (i.e. restoring it to a previous\\n known good state).'''\\n if hasunfilteredcache(self, 'dirstate'):\\n for k in self.dirstate._filecache:\\n try:\\n delattr(self.dirstate, k)\\n except AttributeError:\\n pass\\n delattr(self.unfiltered(), 'dirstate')\\n \\n def invalidate(self, clearfilecache=False):\\n '''Invalidates both store and non-store parts other than dirstate\\n \\n If a transaction is running, invalidation of store is omitted,\\n because discarding in-memory changes might cause inconsistency\\n (e.g. incomplete fncache causes unintentional failure, but\\n redundant one doesn't).\\n '''\\n unfiltered = self.unfiltered() # all file caches are stored unfiltered\\n for k in list(self._filecache.keys()):\\n # dirstate is invalidated separately in invalidatedirstate()\\n if k == 'dirstate':\\n continue\\n if (k == 'changelog' and\\n self.currenttransaction() and\\n self.changelog._delayed):\\n # The changelog object may store unwritten revisions. We don't\\n # want to lose them.\\n # TODO: Solve the problem instead of working around it.\\n continue\\n \\n if clearfilecache:\\n del self._filecache[k]\\n try:\\n delattr(unfiltered, k)\\n except AttributeError:\\n pass\\n self.invalidatecaches()\\n if not self.currenttransaction():\\n # TODO: Changing contents of store outside transaction\\n # causes inconsistency. We should make in-memory store\\n # changes detectable, and abort if changed.\\n self.store.invalidatecaches()\\n \\n def invalidateall(self):\\n '''Fully invalidates both store and non-store parts, causing the\\n subsequent operation to reread any outside changes.'''\\n # extension should hook this to invalidate its caches\\n self.invalidate()\\n self.invalidatedirstate()\\n \\n @unfilteredmethod\\n def _refreshfilecachestats(self, tr):\\n \\\"\\\"\\\"Reload stats of cached files so that they are flagged as valid\\\"\\\"\\\"\\n for k, ce in self._filecache.items():\\n if k == 'dirstate' or k not in self.__dict__:\\n continue\\n ce.refresh()\\n \\n def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc,\\n inheritchecker=None, parentenvvar=None):\\n parentlock = None\\n # the contents of parentenvvar are used by the underlying lock to\\n # determine whether it can be inherited\\n if parentenvvar is not None:\\n parentlock = encoding.environ.get(parentenvvar)\\n try:\\n l = lockmod.lock(vfs, lockname, 0, releasefn=releasefn,\\n acquirefn=acquirefn, desc=desc,\\n inheritchecker=inheritchecker,\\n parentlock=parentlock)\\n except error.LockHeld as inst:\\n if not wait:\\n raise\\n # show more details for new-style locks\\n if ':' in inst.locker:\\n host, pid = inst.locker.split(\\\":\\\", 1)\\n self.ui.warn(\\n _(\\\"waiting for lock on %s held by process %r \\\"\\n \\\"on host %r\\\\n\\\") % (desc, pid, host))\\n else:\\n self.ui.warn(_(\\\"waiting for lock on %s held by %r\\\\n\\\") %\\n (desc, inst.locker))\\n # default to 600 seconds timeout\\n l = lockmod.lock(vfs, lockname,\\n int(self.ui.config(\\\"ui\\\", \\\"timeout\\\")),\\n releasefn=releasefn, acquirefn=acquirefn,\\n desc=desc)\\n self.ui.warn(_(\\\"got lock after %s seconds\\\\n\\\") % l.delay)\\n return l\\n \\n def _afterlock(self, callback):\\n \\\"\\\"\\\"add a callback to be run when the repository is fully unlocked\\n \\n The callback will be executed when the outermost lock is released\\n (with wlock being higher level than 'lock').\\\"\\\"\\\"\\n for ref in (self._wlockref, self._lockref):\\n l = ref and ref()\\n if l and l.held:\\n l.postrelease.append(callback)\\n break\\n else: # no lock have been found.\\n callback()\\n \\n def lock(self, wait=True):\\n '''Lock the repository store (.hg\\/store) and return a weak reference\\n to the lock. Use this before modifying the store (e.g. committing or\\n stripping). If you are opening a transaction, get a lock as well.)\\n \\n If both 'lock' and 'wlock' must be acquired, ensure you always acquires\\n 'wlock' first to avoid a dead-lock hazard.'''\\n l = self._currentlock(self._lockref)\\n if l is not None:\\n l.lock()\\n return l\\n \\n l = self._lock(self.svfs, \\\"lock\\\", wait, None,\\n self.invalidate, _('repository %s') % self.origroot)\\n self._lockref = weakref.ref(l)\\n return l\\n \\n def _wlockchecktransaction(self):\\n if self.currenttransaction() is not None:\\n raise error.LockInheritanceContractViolation(\\n 'wlock cannot be inherited in the middle of a transaction')\\n \\n def wlock(self, wait=True):\\n '''Lock the non-store parts of the repository (everything under\\n .hg except .hg\\/store) and return a weak reference to the lock.\\n \\n Use this before modifying files in .hg.\\n \\n If both 'lock' and 'wlock' must be acquired, ensure you always acquires\\n 'wlock' first to avoid a dead-lock hazard.'''\\n l = self._wlockref and self._wlockref()\\n if l is not None and l.held:\\n l.lock()\\n return l\\n \\n # We do not need to check for non-waiting lock acquisition. Such\\n # acquisition would not cause dead-lock as they would just fail.\\n if wait and (self.ui.configbool('devel', 'all-warnings')\\n or self.ui.configbool('devel', 'check-locks')):\\n if self._currentlock(self._lockref) is not None:\\n self.ui.develwarn('\\\"wlock\\\" acquired after \\\"lock\\\"')\\n \\n def unlock():\\n if self.dirstate.pendingparentchange():\\n self.dirstate.invalidate()\\n else:\\n self.dirstate.write(None)\\n \\n self._filecache['dirstate'].refresh()\\n \\n l = self._lock(self.vfs, \\\"wlock\\\", wait, unlock,\\n self.invalidatedirstate, _('working directory of %s') %\\n self.origroot,\\n inheritchecker=self._wlockchecktransaction,\\n parentenvvar='HG_WLOCK_LOCKER')\\n self._wlockref = weakref.ref(l)\\n return l\\n \\n def _currentlock(self, lockref):\\n \\\"\\\"\\\"Returns the lock if it's held, or None if it's not.\\\"\\\"\\\"\\n if lockref is None:\\n return None\\n l = lockref()\\n if l is None or not l.held:\\n return None\\n return l\\n \\n def currentwlock(self):\\n \\\"\\\"\\\"Returns the wlock if it's held, or None if it's not.\\\"\\\"\\\"\\n return self._currentlock(self._wlockref)\\n \\n def _filecommit(self, fctx, manifest1, manifest2, linkrev, tr, changelist):\\n \\\"\\\"\\\"\\n commit an individual file as part of a larger transaction\\n \\\"\\\"\\\"\\n \\n fname = fctx.path()\\n fparent1 = manifest1.get(fname, nullid)\\n fparent2 = manifest2.get(fname, nullid)\\n if isinstance(fctx, context.filectx):\\n node = fctx.filenode()\\n if node in [fparent1, fparent2]:\\n self.ui.debug('reusing %s filelog entry\\\\n' % fname)\\n if manifest1.flags(fname) != fctx.flags():\\n changelist.append(fname)\\n return node\\n \\n flog = self.file(fname)\\n meta = {}\\n copy = fctx.renamed()\\n if copy and copy[0] != fname:\\n # Mark the new revision of this file as a copy of another\\n # file. This copy data will effectively act as a parent\\n # of this new revision. If this is a merge, the first\\n # parent will be the nullid (meaning \\\"look up the copy data\\\")\\n # and the second one will be the other parent. For example:\\n #\\n # 0 --- 1 --- 3 rev1 changes file foo\\n # \\\\ \\/ rev2 renames foo to bar and changes it\\n # \\\\- 2 -\\/ rev3 should have bar with all changes and\\n # should record that bar descends from\\n # bar in rev2 and foo in rev1\\n #\\n # this allows this merge to succeed:\\n #\\n # 0 --- 1 --- 3 rev4 reverts the content change from rev2\\n # \\\\ \\/ merging rev3 and rev4 should use bar@rev2\\n # \\\\- 2 --- 4 as the merge base\\n #\\n \\n cfname = copy[0]\\n crev = manifest1.get(cfname)\\n newfparent = fparent2\\n \\n if manifest2: # branch merge\\n if fparent2 == nullid or crev is None: # copied on remote side\\n if cfname in manifest2:\\n crev = manifest2[cfname]\\n newfparent = fparent1\\n \\n # Here, we used to search backwards through history to try to find\\n # where the file copy came from if the source of a copy was not in\\n # the parent directory. However, this doesn't actually make sense to\\n # do (what does a copy from something not in your working copy even\\n # mean?) and it causes bugs (eg, issue4476). Instead, we will warn\\n # the user that copy information was dropped, so if they didn't\\n # expect this outcome it can be fixed, but this is the correct\\n # behavior in this circumstance.\\n \\n if crev:\\n self.ui.debug(\\\" %s: copy %s:%s\\\\n\\\" % (fname, cfname, hex(crev)))\\n meta[\\\"copy\\\"] = cfname\\n meta[\\\"copyrev\\\"] = hex(crev)\\n fparent1, fparent2 = nullid, newfparent\\n else:\\n self.ui.warn(_(\\\"warning: can't find ancestor for '%s' \\\"\\n \\\"copied from '%s'!\\\\n\\\") % (fname, cfname))\\n \\n elif fparent1 == nullid:\\n fparent1, fparent2 = fparent2, nullid\\n elif fparent2 != nullid:\\n # is one parent an ancestor of the other?\\n fparentancestors = flog.commonancestorsheads(fparent1, fparent2)\\n if fparent1 in fparentancestors:\\n fparent1, fparent2 = fparent2, nullid\\n elif fparent2 in fparentancestors:\\n fparent2 = nullid\\n \\n # is the file changed?\\n text = fctx.data()\\n if fparent2 != nullid or flog.cmp(fparent1, text) or meta:\\n changelist.append(fname)\\n return flog.add(text, meta, tr, linkrev, fparent1, fparent2)\\n # are just the flags changed during merge?\\n elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():\\n changelist.append(fname)\\n \\n return fparent1\\n \\n def checkcommitpatterns(self, wctx, vdirs, match, status, fail):\\n \\\"\\\"\\\"check for commit arguments that aren't committable\\\"\\\"\\\"\\n if match.isexact() or match.prefix():\\n matched = set(status.modified + status.added + status.removed)\\n \\n for f in match.files():\\n f = self.dirstate.normalize(f)\\n if f == '.' or f in matched or f in wctx.substate:\\n continue\\n if f in status.deleted:\\n fail(f, _('file not found!'))\\n if f in vdirs: # visited directory\\n d = f + '\\/'\\n for mf in matched:\\n if mf.startswith(d):\\n break\\n else:\\n fail(f, _(\\\"no match under directory!\\\"))\\n elif f not in self.dirstate:\\n fail(f, _(\\\"file not tracked!\\\"))\\n \\n @unfilteredmethod\\n def commit(self, text=\\\"\\\", user=None, date=None, match=None, force=False,\\n editor=False, extra=None):\\n \\\"\\\"\\\"Add a new revision to current repository.\\n \\n Revision information is gathered from the working directory,\\n match can be used to filter the committed files. If editor is\\n supplied, it is called to get a commit message.\\n \\\"\\\"\\\"\\n if extra is None:\\n extra = {}\\n \\n def fail(f, msg):\\n raise error.Abort('%s: %s' % (f, msg))\\n \\n if not match:\\n match = matchmod.always(self.root, '')\\n \\n if not force:\\n vdirs = []\\n match.explicitdir = vdirs.append\\n match.bad = fail\\n \\n wlock = lock = tr = None\\n try:\\n wlock = self.wlock()\\n lock = self.lock() # for recent changelog (see issue4368)\\n \\n wctx = self[None]\\n merge = len(wctx.parents()) \\u003e 1\\n \\n if not force and merge and not match.always():\\n raise error.Abort(_('cannot partially commit a merge '\\n '(do not specify files or patterns)'))\\n \\n status = self.status(match=match, clean=force)\\n if force:\\n status.modified.extend(status.clean) # mq may commit clean files\\n \\n # check subrepos\\n subs, commitsubs, newstate = subrepo.precommit(\\n self.ui, wctx, status, match, force=force)\\n \\n # make sure all explicit patterns are matched\\n if not force:\\n self.checkcommitpatterns(wctx, vdirs, match, status, fail)\\n \\n cctx = context.workingcommitctx(self, status,\\n text, user, date, extra)\\n \\n # internal config: ui.allowemptycommit\\n allowemptycommit = (wctx.branch() != wctx.p1().branch()\\n or extra.get('close') or merge or cctx.files()\\n or self.ui.configbool('ui', 'allowemptycommit'))\\n if not allowemptycommit:\\n return None\\n \\n if merge and cctx.deleted():\\n raise error.Abort(_(\\\"cannot commit merge with missing files\\\"))\\n \\n ms = mergemod.mergestate.read(self)\\n mergeutil.checkunresolved(ms)\\n \\n if editor:\\n cctx._text = editor(self, cctx, subs)\\n edited = (text != cctx._text)\\n \\n # Save commit message in case this transaction gets rolled back\\n # (e.g. by a pretxncommit hook). Leave the content alone on\\n # the assumption that the user will use the same editor again.\\n msgfn = self.savecommitmessage(cctx._text)\\n \\n # commit subs and write new state\\n if subs:\\n for s in sorted(commitsubs):\\n sub = wctx.sub(s)\\n self.ui.status(_('committing subrepository %s\\\\n') %\\n subrepo.subrelpath(sub))\\n sr = sub.commit(cctx._text, user, date)\\n newstate[s] = (newstate[s][0], sr)\\n subrepo.writestate(self, newstate)\\n \\n p1, p2 = self.dirstate.parents()\\n hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')\\n try:\\n self.hook(\\\"precommit\\\", throw=True, parent1=hookp1,\\n parent2=hookp2)\\n tr = self.transaction('commit')\\n ret = self.commitctx(cctx, True)\\n except: # re-raises\\n if edited:\\n self.ui.write(\\n _('note: commit message saved in %s\\\\n') % msgfn)\\n raise\\n # update bookmarks, dirstate and mergestate\\n bookmarks.update(self, [p1, p2], ret)\\n cctx.markcommitted(ret)\\n ms.reset()\\n tr.close()\\n \\n finally:\\n lockmod.release(tr, lock, wlock)\\n \\n def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):\\n # hack for command that use a temporary commit (eg: histedit)\\n # temporary commit got stripped before hook release\\n if self.changelog.hasnode(ret):\\n self.hook(\\\"commit\\\", node=node, parent1=parent1,\\n parent2=parent2)\\n self._afterlock(commithook)\\n return ret\\n \\n @unfilteredmethod\\n def commitctx(self, ctx, error=False):\\n \\\"\\\"\\\"Add a new revision to current repository.\\n Revision information is passed via the context argument.\\n \\\"\\\"\\\"\\n \\n tr = None\\n p1, p2 = ctx.p1(), ctx.p2()\\n user = ctx.user()\\n \\n lock = self.lock()\\n try:\\n tr = self.transaction(\\\"commit\\\")\\n trp = weakref.proxy(tr)\\n \\n if ctx.manifestnode():\\n # reuse an existing manifest revision\\n mn = ctx.manifestnode()\\n files = ctx.files()\\n elif ctx.files():\\n m1ctx = p1.manifestctx()\\n m2ctx = p2.manifestctx()\\n mctx = m1ctx.copy()\\n \\n m = mctx.read()\\n m1 = m1ctx.read()\\n m2 = m2ctx.read()\\n \\n # check in files\\n added = []\\n changed = []\\n removed = list(ctx.removed())\\n linkrev = len(self)\\n self.ui.note(_(\\\"committing files:\\\\n\\\"))\\n for f in sorted(ctx.modified() + ctx.added()):\\n self.ui.note(f + \\\"\\\\n\\\")\\n try:\\n fctx = ctx[f]\\n if fctx is None:\\n removed.append(f)\\n else:\\n added.append(f)\\n m[f] = self._filecommit(fctx, m1, m2, linkrev,\\n trp, changed)\\n m.setflag(f, fctx.flags())\\n except OSError as inst:\\n self.ui.warn(_(\\\"trouble committing %s!\\\\n\\\") % f)\\n raise\\n except IOError as inst:\\n errcode = getattr(inst, 'errno', errno.ENOENT)\\n if error or errcode and errcode != errno.ENOENT:\\n self.ui.warn(_(\\\"trouble committing %s!\\\\n\\\") % f)\\n raise\\n \\n # update manifest\\n self.ui.note(_(\\\"committing manifest\\\\n\\\"))\\n removed = [f for f in sorted(removed) if f in m1 or f in m2]\\n drop = [f for f in removed if f in m]\\n for f in drop:\\n del m[f]\\n mn = mctx.write(trp, linkrev,\\n p1.manifestnode(), p2.manifestnode(),\\n added, drop)\\n files = changed + removed\\n else:\\n mn = p1.manifestnode()\\n files = []\\n \\n # update changelog\\n self.ui.note(_(\\\"committing changelog\\\\n\\\"))\\n self.changelog.delayupdate(tr)\\n n = self.changelog.add(mn, files, ctx.description(),\\n trp, p1.node(), p2.node(),\\n user, ctx.date(), ctx.extra().copy())\\n xp1, xp2 = p1.hex(), p2 and p2.hex() or ''\\n self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,\\n parent2=xp2)\\n # set the new commit is proper phase\\n targetphase = subrepo.newcommitphase(self.ui, ctx)\\n if targetphase:\\n # retract boundary do not alter parent changeset.\\n # if a parent have higher the resulting phase will\\n # be compliant anyway\\n #\\n # if minimal phase was 0 we don't need to retract anything\\n phases.registernew(self, tr, targetphase, [n])\\n tr.close()\\n return n\\n finally:\\n if tr:\\n tr.release()\\n lock.release()\\n \\n @unfilteredmethod\\n def destroying(self):\\n '''Inform the repository that nodes are about to be destroyed.\\n Intended for use by strip and rollback, so there's a common\\n place for anything that has to be done before destroying history.\\n \\n This is mostly useful for saving state that is in memory and waiting\\n to be flushed when the current lock is released. Because a call to\\n destroyed is imminent, the repo will be invalidated causing those\\n changes to stay in memory (waiting for the next unlock), or vanish\\n completely.\\n '''\\n # When using the same lock to commit and strip, the phasecache is left\\n # dirty after committing. Then when we strip, the repo is invalidated,\\n # causing those changes to disappear.\\n if '_phasecache' in vars(self):\\n self._phasecache.write()\\n \\n @unfilteredmethod\\n def destroyed(self):\\n '''Inform the repository that nodes have been destroyed.\\n Intended for use by strip and rollback, so there's a common\\n place for anything that has to be done after destroying history.\\n '''\\n # When one tries to:\\n # 1) destroy nodes thus calling this method (e.g. strip)\\n # 2) use phasecache somewhere (e.g. commit)\\n #\\n # then 2) will fail because the phasecache contains nodes that were\\n # removed. We can either remove phasecache from the filecache,\\n # causing it to reload next time it is accessed, or simply filter\\n # the removed nodes now and write the updated cache.\\n self._phasecache.filterunknown(self)\\n self._phasecache.write()\\n \\n # refresh all repository caches\\n self.updatecaches()\\n \\n # Ensure the persistent tag cache is updated. Doing it now\\n # means that the tag cache only has to worry about destroyed\\n # heads immediately after a strip\\/rollback. That in turn\\n # guarantees that \\\"cachetip == currenttip\\\" (comparing both rev\\n # and node) always means no nodes have been added or destroyed.\\n \\n # XXX this is suboptimal when qrefresh'ing: we strip the current\\n # head, refresh the tag cache, then immediately add a new head.\\n # But I think doing it this way is necessary for the \\\"instant\\n # tag cache retrieval\\\" case to work.\\n self.invalidate()\\n \\n def walk(self, match, node=None):\\n '''\\n walk recursively through the directory tree or a given\\n changeset, finding all files matched by the match\\n function\\n '''\\n self.ui.deprecwarn('use repo[node].walk instead of repo.walk', '4.3')\\n return self[node].walk(match)\\n \\n def status(self, node1='.', node2=None, match=None,\\n ignored=False, clean=False, unknown=False,\\n listsubrepos=False):\\n '''a convenience method that calls node1.status(node2)'''\\n return self[node1].status(node2, match, ignored, clean, unknown,\\n listsubrepos)\\n \\n def addpostdsstatus(self, ps):\\n \\\"\\\"\\\"Add a callback to run within the wlock, at the point at which status\\n fixups happen.\\n \\n On status completion, callback(wctx, status) will be called with the\\n wlock held, unless the dirstate has changed from underneath or the wlock\\n couldn't be grabbed.\\n \\n Callbacks should not capture and use a cached copy of the dirstate --\\n it might change in the meanwhile. Instead, they should access the\\n dirstate via wctx.repo().dirstate.\\n \\n This list is emptied out after each status run -- extensions should\\n make sure it adds to this list each time dirstate.status is called.\\n Extensions should also make sure they don't call this for statuses\\n that don't involve the dirstate.\\n \\\"\\\"\\\"\\n \\n # The list is located here for uniqueness reasons -- it is actually\\n # managed by the workingctx, but that isn't unique per-repo.\\n self._postdsstatus.append(ps)\\n \\n def postdsstatus(self):\\n \\\"\\\"\\\"Used by workingctx to get the list of post-dirstate-status hooks.\\\"\\\"\\\"\\n return self._postdsstatus\\n \\n def clearpostdsstatus(self):\\n \\\"\\\"\\\"Used by workingctx to clear post-dirstate-status hooks.\\\"\\\"\\\"\\n del self._postdsstatus[:]\\n \\n def heads(self, start=None):\\n if start is None:\\n cl = self.changelog\\n headrevs = reversed(cl.headrevs())\\n return [cl.node(rev) for rev in headrevs]\\n \\n heads = self.changelog.heads(start)\\n # sort the output in rev descending order\\n return sorted(heads, key=self.changelog.rev, reverse=True)\\n \\n def branchheads(self, branch=None, start=None, closed=False):\\n '''return a (possibly filtered) list of heads for the given branch\\n \\n Heads are returned in topological order, from newest to oldest.\\n If branch is None, use the dirstate branch.\\n If start is not None, return only heads reachable from start.\\n If closed is True, return heads that are marked as closed as well.\\n '''\\n if branch is None:\\n branch = self[None].branch()\\n branches = self.branchmap()\\n if branch not in branches:\\n return []\\n # the cache returns heads ordered lowest to highest\\n bheads = list(reversed(branches.branchheads(branch, closed=closed)))\\n if start is not None:\\n # filter out the heads that cannot be reached from startrev\\n fbheads = set(self.changelog.nodesbetween([start], bheads)[2])\\n bheads = [h for h in bheads if h in fbheads]\\n return bheads\\n \\n def branches(self, nodes):\\n if not nodes:\\n nodes = [self.changelog.tip()]\\n b = []\\n for n in nodes:\\n t = n\\n while True:\\n p = self.changelog.parents(n)\\n if p[1] != nullid or p[0] == nullid:\\n b.append((t, n, p[0], p[1]))\\n break\\n n = p[0]\\n return b\\n \\n def between(self, pairs):\\n r = []\\n \\n for top, bottom in pairs:\\n n, l, i = top, [], 0\\n f = 1\\n \\n while n != bottom and n != nullid:\\n p = self.changelog.parents(n)[0]\\n if i == f:\\n l.append(n)\\n f = f * 2\\n n = p\\n i += 1\\n \\n r.append(l)\\n \\n return r\\n \\n def checkpush(self, pushop):\\n \\\"\\\"\\\"Extensions can override this function if additional checks have\\n to be performed before pushing, or call it if they override push\\n command.\\n \\\"\\\"\\\"\\n \\n @unfilteredpropertycache\\n def prepushoutgoinghooks(self):\\n \\\"\\\"\\\"Return util.hooks consists of a pushop with repo, remote, outgoing\\n methods, which are called before pushing changesets.\\n \\\"\\\"\\\"\\n return util.hooks()\\n \\n def pushkey(self, namespace, key, old, new):\\n try:\\n tr = self.currenttransaction()\\n hookargs = {}\\n if tr is not None:\\n hookargs.update(tr.hookargs)\\n hookargs['namespace'] = namespace\\n hookargs['key'] = key\\n hookargs['old'] = old\\n hookargs['new'] = new\\n self.hook('prepushkey', throw=True, **hookargs)\\n except error.HookAbort as exc:\\n self.ui.write_err(_(\\\"pushkey-abort: %s\\\\n\\\") % exc)\\n if exc.hint:\\n self.ui.write_err(_(\\\"(%s)\\\\n\\\") % exc.hint)\\n return False\\n self.ui.debug('pushing key for \\\"%s:%s\\\"\\\\n' % (namespace, key))\\n ret = pushkey.push(self, namespace, key, old, new)\\n def runhook():\\n self.hook('pushkey', namespace=namespace, key=key, old=old, new=new,\\n ret=ret)\\n self._afterlock(runhook)\\n return ret\\n \\n def listkeys(self, namespace):\\n self.hook('prelistkeys', throw=True, namespace=namespace)\\n self.ui.debug('listing keys for \\\"%s\\\"\\\\n' % namespace)\\n values = pushkey.list(self, namespace)\\n self.hook('listkeys', namespace=namespace, values=values)\\n return values\\n \\n def debugwireargs(self, one, two, three=None, four=None, five=None):\\n '''used to test argument passing over the wire'''\\n return \\\"%s %s %s %s %s\\\" % (one, two, three, four, five)\\n \\n def savecommitmessage(self, text):\\n fp = self.vfs('last-message.txt', 'wb')\\n try:\\n fp.write(text)\\n finally:\\n fp.close()\\n return self.pathto(fp.name[len(self.root) + 1:])\\n \\n # used to avoid circular references so destructors work\\n def aftertrans(files):\\n renamefiles = [tuple(t) for t in files]\\n def a():\\n for vfs, src, dest in renamefiles:\\n # if src and dest refer to a same file, vfs.rename is a no-op,\\n # leaving both src and dest on disk. delete dest to make sure\\n # the rename couldn't be such a no-op.\\n vfs.tryunlink(dest)\\n try:\\n vfs.rename(src, dest)\\n except OSError: # journal file does not yet exist\\n pass\\n return a\\n \\n def undoname(fn):\\n base, name = os.path.split(fn)\\n assert name.startswith('journal')\\n return os.path.join(base, name.replace('journal', 'undo', 1))\\n \\n def instance(ui, path, create):\\n return localrepository(ui, util.urllocalpath(path), create)\\n \\n def islocal(path):\\n return True\\n \\n def newreporequirements(repo):\\n \\\"\\\"\\\"Determine the set of requirements for a new local repository.\\n \\n Extensions can wrap this function to specify custom requirements for\\n new repositories.\\n \\\"\\\"\\\"\\n ui = repo.ui\\n requirements = {'revlogv1'}\\n if ui.configbool('format', 'usestore'):\\n requirements.add('store')\\n if ui.configbool('format', 'usefncache'):\\n requirements.add('fncache')\\n if ui.configbool('format', 'dotencode'):\\n requirements.add('dotencode')\\n \\n compengine = ui.config('experimental', 'format.compression')\\n if compengine not in util.compengines:\\n raise error.Abort(_('compression engine %s defined by '\\n 'experimental.format.compression not available') %\\n compengine,\\n hint=_('run \\\"hg debuginstall\\\" to list available '\\n 'compression engines'))\\n \\n # zlib is the historical default and doesn't need an explicit requirement.\\n if compengine != 'zlib':\\n requirements.add('exp-compression-%s' % compengine)\\n \\n if scmutil.gdinitconfig(ui):\\n requirements.add('generaldelta')\\n if ui.configbool('experimental', 'treemanifest'):\\n requirements.add('treemanifest')\\n if ui.configbool('experimental', 'manifestv2'):\\n requirements.add('manifestv2')\\n \\n revlogv2 = ui.config('experimental', 'revlogv2')\\n if revlogv2 == 'enable-unstable-format-and-corrupt-my-data':\\n requirements.remove('revlogv1')\\n # generaldelta is implied by revlogv2.\\n requirements.discard('generaldelta')\\n requirements.add(REVLOGV2_REQUIREMENT)\\n \\n return requirements\\n\"}]}],\"properties\":{\"hg:meta\":{\"date\":\"1509404054 -19800\",\"node\":\"44fc1c1f1774a76423b9c732af6938435099bcc5\",\"user\":\"Pulkit Goyal \\u003c7895pulkit@gmail.com\\u003e\",\"parent\":\"8feef8ef8389a3b544e0a74624f1efc3a8d85d35\"}}}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B4092%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:21 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":\"diff --git a\\/mercurial\\/repoview.py b\\/mercurial\\/repoview.py\\n--- a\\/mercurial\\/repoview.py\\n+++ b\\/mercurial\\/repoview.py\\n@@ -185,6 +185,9 @@\\n subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.\\n \\\"\\\"\\\"\\n \\n+ # hidden revs which should be visible\\n+ _visibilityexceptions = set()\\n+\\n def __init__(self, repo, filtername):\\n object.__setattr__(self, r'_unfilteredrepo', repo)\\n object.__setattr__(self, r'filtername', filtername)\\n@@ -231,6 +234,14 @@\\n return self\\n return self.unfiltered().filtered(name)\\n \\n+ def addvisibilityexceptions(self, revs):\\n+ \\\"\\\"\\\"adds hidden revs which should be visible to set of exceptions\\\"\\\"\\\"\\n+ self._visibilityexceptions.update(revs)\\n+\\n+ def getvisibilityexceptions(self):\\n+ \\\"\\\"\\\"returns the set of hidden revs which should be visible\\\"\\\"\\\"\\n+ return self._visibilityexceptions\\n+\\n # everything access are forwarded to the proxied repo\\n def __getattr__(self, attr):\\n return getattr(self._unfilteredrepo, attr)\\ndiff --git a\\/mercurial\\/localrepo.py b\\/mercurial\\/localrepo.py\\n--- a\\/mercurial\\/localrepo.py\\n+++ b\\/mercurial\\/localrepo.py\\n@@ -570,6 +570,14 @@\\n def close(self):\\n self._writecaches()\\n \\n+ def addvisibilityexceptions(self, exceptions):\\n+ # should be called on a filtered repository\\n+ pass\\n+\\n+ def getvisibilityexceptions(self):\\n+ # should be called on a filtered repository\\n+ return set()\\n+\\n def _loadextensions(self):\\n extensions.loadall(self.ui)\\n \\n\\n\",\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "143" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+4092%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-comment-created.json b/tests/phabricator/phabsend-comment-created.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-comment-created.json @@ -0,0 +1,617 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:55 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"almanacServicePHID\":null,\"refRules\":{\"fetchRules\":[],\"trackRules\":[],\"permanentRefRules\":[]},\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22callsigns%22%3A+%5B%22HG%22%5D%7D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:56 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19395,\"phid\":\"PHID-DIFF-bfatspvpv25tfkj2zeqw\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19395\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1178" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22comment%22%3A+%7B%22addLines%22%3A+1%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22comment%22%2C+%22delLines%22%3A+0%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+1%2C+%22corpus%22%3A+%22%2Bcomment%5Cn%22%2C+%22delLines%22%3A+0%2C+%22newLength%22%3A+1%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+0%2C+%22oldOffset%22%3A+0%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%22unix%3Afilemode%22%3A+%22100644%22%7D%2C+%22oldPath%22%3A+null%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+1%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%223244dc4a33342b4d91ad534ae091685244ac5ed4%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:57 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22d5dddca9023d1025bf135b946a4dfe38901ab46d%5C%22%2C+%5C%22parent%5C%22%3A+%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19395%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:57 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22d5dddca9023d1025bf135b946a4dfe38901ab46d%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22d5dddca9023d1025bf135b946a4dfe38901ab46d%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19395%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:58 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create comment for phabricator test\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create comment for phabricator test\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "180" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+comment+for+phabricator+test%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:59 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7919,\"phid\":\"PHID-DREV-mrxkguxqg3qmf6o3ah4d\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-leebtwz4loeiuwx\"},{\"phid\":\"PHID-XACT-DREV-lpxwfvxsdm6y5lq\"},{\"phid\":\"PHID-XACT-DREV-fb3qpskghwcxurl\"},{\"phid\":\"PHID-XACT-DREV-bmekz2k4c3bmsog\"},{\"phid\":\"PHID-XACT-DREV-tydrnhs4cnyi2ng\"},{\"phid\":\"PHID-XACT-DREV-lbctcnaslgwcjvu\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "413" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-bfatspvpv25tfkj2zeqw%22%7D%2C+%7B%22type%22%3A+%22comment%22%2C+%22value%22%3A+%22For+default+branch%22%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+comment+for+phabricator+test%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:00 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7919\",\"phid\":\"PHID-DREV-mrxkguxqg3qmf6o3ah4d\",\"title\":\"create comment for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7919\",\"dateCreated\":\"1579221179\",\"dateModified\":\"1579221179\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"1\",\"activeDiffPHID\":\"PHID-DIFF-bfatspvpv25tfkj2zeqw\",\"diffs\":[\"19395\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7919%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:00 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22f7db812bbe1db49d86823e6d7b9ab4b30539f801%5C%22%2C+%5C%22parent%5C%22%3A+%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19395%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:01 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22f7db812bbe1db49d86823e6d7b9ab4b30539f801%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22f7db812bbe1db49d86823e6d7b9ab4b30539f801%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19395%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-comment-updated.json b/tests/phabricator/phabsend-comment-updated.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-comment-updated.json @@ -0,0 +1,549 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:10 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"19395\":{\"id\":\"19395\",\"revisionID\":\"7919\",\"dateCreated\":\"1579221176\",\"dateModified\":\"1579221179\",\"sourceControlBaseRevision\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52928\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"mzg_LBhhVYqb\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\",\"parent\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"user\":\"test\"},\"local:commits\":{\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\",\"parents\":[\"3244dc4a33342b4d91ad534ae091685244ac5ed4\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "154" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22revisionIDs%22%3A+%5B7919%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:11 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"almanacServicePHID\":null,\"refRules\":{\"fetchRules\":[],\"trackRules\":[],\"permanentRefRules\":[]},\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22callsigns%22%3A+%5B%22HG%22%5D%7D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:11 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19396,\"phid\":\"PHID-DIFF-peqlcs25nvzqrns6izrf\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19396\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1193" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22comment%22%3A+%7B%22addLines%22%3A+2%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22comment%22%2C+%22delLines%22%3A+0%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+2%2C+%22corpus%22%3A+%22%2Bcomment%5Cn%2Bcomment2%5Cn%22%2C+%22delLines%22%3A+0%2C+%22newLength%22%3A+2%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+0%2C+%22oldOffset%22%3A+0%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%22unix%3Afilemode%22%3A+%22100644%22%7D%2C+%22oldPath%22%3A+null%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+1%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%223244dc4a33342b4d91ad534ae091685244ac5ed4%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:12 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%221849d7828727a28e14c589323e4f8c9a1c8d2816%5C%22%2C+%5C%22parent%5C%22%3A+%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19396%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:13 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%221849d7828727a28e14c589323e4f8c9a1c8d2816%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%221849d7828727a28e14c589323e4f8c9a1c8d2816%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19396%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:13 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create comment for phabricator test\",\"revisionID\":7919},\"revisionIDFieldInfo\":{\"value\":7919,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create comment for phabricator test\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "257" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+comment+for+phabricator+test%5Cn%5CnDifferential+Revision%3A+https%3A%2F%2Fphab.mercurial-scm.org%2FD7919%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:14 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7919,\"phid\":\"PHID-DREV-mrxkguxqg3qmf6o3ah4d\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-fstsdazolwve3l5\"},{\"phid\":\"PHID-XACT-DREV-ctvtbwhgeyr4oau\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "452" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22objectIdentifier%22%3A+7919%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-peqlcs25nvzqrns6izrf%22%7D%2C+%7B%22type%22%3A+%22comment%22%2C+%22value%22%3A+%22Address+review+comments%22%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+comment+for+phabricator+test%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:15 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7919\",\"phid\":\"PHID-DREV-mrxkguxqg3qmf6o3ah4d\",\"title\":\"create comment for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7919\",\"dateCreated\":\"1579221179\",\"dateModified\":\"1579221194\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":2,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-peqlcs25nvzqrns6izrf\",\"diffs\":[\"19396\",\"19395\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7919%5D%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-create-alpha.json b/tests/phabricator/phabsend-create-alpha.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-create-alpha.json @@ -0,0 +1,617 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:00 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"almanacServicePHID\":null,\"refRules\":{\"fetchRules\":[],\"trackRules\":[],\"permanentRefRules\":[]},\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22callsigns%22%3A+%5B%22HG%22%5D%7D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:01 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19390,\"phid\":\"PHID-DIFF-36wohqs4e4l6spcrzg65\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19390\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1172" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22alpha%22%3A+%7B%22addLines%22%3A+1%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22alpha%22%2C+%22delLines%22%3A+0%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+1%2C+%22corpus%22%3A+%22%2Balpha%5Cn%22%2C+%22delLines%22%3A+0%2C+%22newLength%22%3A+1%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+0%2C+%22oldOffset%22%3A+0%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%22unix%3Afilemode%22%3A+%22100644%22%7D%2C+%22oldPath%22%3A+null%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+1%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%220000000000000000000000000000000000000000%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:01 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22d386117f30e6b1282897bdbde75ac21e095163d4%5C%22%2C+%5C%22parent%5C%22%3A+%5C%220000000000000000000000000000000000000000%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19390%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:02 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22d386117f30e6b1282897bdbde75ac21e095163d4%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22d386117f30e6b1282897bdbde75ac21e095163d4%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%220000000000000000000000000000000000000000%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19390%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:03 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create alpha for phabricator test \\u20ac\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create alpha for phabricator test \\u20ac\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "187" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+alpha+for+phabricator+test+%5Cu20ac%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:03 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7915,\"phid\":\"PHID-DREV-3mzbavd2ajsbar5l3esr\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-55yg7c5j7d6wjfv\"},{\"phid\":\"PHID-XACT-DREV-wizrkanyez7gzuu\"},{\"phid\":\"PHID-XACT-DREV-aobh3arrwbdwoh7\"},{\"phid\":\"PHID-XACT-DREV-zwea5upt4cn23ve\"},{\"phid\":\"PHID-XACT-DREV-dklz3iyhmwcoi5p\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "340" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-36wohqs4e4l6spcrzg65%22%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+alpha+for+phabricator+test+%5Cu20ac%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:04 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7915\",\"phid\":\"PHID-DREV-3mzbavd2ajsbar5l3esr\",\"title\":\"create alpha for phabricator test \\u20ac\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7915\",\"dateCreated\":\"1579221124\",\"dateModified\":\"1579221124\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"1\",\"activeDiffPHID\":\"PHID-DIFF-36wohqs4e4l6spcrzg65\",\"diffs\":[\"19390\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7915%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:05 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22347bf67801e55faaffe1616c6bac53cdf6b6dfc2%5C%22%2C+%5C%22parent%5C%22%3A+%5C%220000000000000000000000000000000000000000%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19390%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:06 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22347bf67801e55faaffe1616c6bac53cdf6b6dfc2%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22347bf67801e55faaffe1616c6bac53cdf6b6dfc2%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%220000000000000000000000000000000000000000%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19390%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-create-public.json b/tests/phabricator/phabsend-create-public.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-create-public.json @@ -0,0 +1,957 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:37 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"almanacServicePHID\":null,\"refRules\":{\"fetchRules\":[],\"trackRules\":[],\"permanentRefRules\":[]},\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22callsigns%22%3A+%5B%22HG%22%5D%7D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:37 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19393,\"phid\":\"PHID-DIFF-e64weyerxtutv2jvj2dt\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19393\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1156" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22beta%22%3A+%7B%22addLines%22%3A+1%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22beta%22%2C+%22delLines%22%3A+1%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+1%2C+%22corpus%22%3A+%22-beta%5Cn%2Bpublic+change%5Cn%22%2C+%22delLines%22%3A+1%2C+%22newLength%22%3A+1%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+1%2C+%22oldOffset%22%3A+1%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%7D%2C+%22oldPath%22%3A+%22beta%22%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+2%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%22a692622e693757674f85ff481c7ff77057a7f82a%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:38 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%2C+%5C%22parent%5C%22%3A+%5C%22a692622e693757674f85ff481c7ff77057a7f82a%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19393%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:39 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%22a692622e693757674f85ff481c7ff77057a7f82a%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19393%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:39 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create public change for phabricator testing\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create public change for phabricator testing\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "189" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+public+change+for+phabricator+testing%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:40 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7917,\"phid\":\"PHID-DREV-yhl3yvijs4jploa5iqm4\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-kljgpfhorijhw6v\"},{\"phid\":\"PHID-XACT-DREV-muujhcz6hb4n77e\"},{\"phid\":\"PHID-XACT-DREV-a74sh3ztjjnn2rh\"},{\"phid\":\"PHID-XACT-DREV-eboclo4ac3olsht\"},{\"phid\":\"PHID-XACT-DREV-d6mrwth26sbchrm\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "342" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-e64weyerxtutv2jvj2dt%22%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+public+change+for+phabricator+testing%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:41 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19394,\"phid\":\"PHID-DIFF-pqdlhei24n47fzeofjph\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19394\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1168" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22alpha%22%3A+%7B%22addLines%22%3A+1%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22alpha%22%2C+%22delLines%22%3A+2%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+1%2C+%22corpus%22%3A+%22-alpha%5Cn-more%5Cn%2Bdraft+change%5Cn%22%2C+%22delLines%22%3A+2%2C+%22newLength%22%3A+1%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+2%2C+%22oldOffset%22%3A+1%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%7D%2C+%22oldPath%22%3A+%22alpha%22%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+2%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%227b4185ab5d16acf98e41d566be38c5dbea10878d%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:42 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22251c1c333fc660c18e841b9bebeabc37c3e56455%5C%22%2C+%5C%22parent%5C%22%3A+%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19394%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:42 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22251c1c333fc660c18e841b9bebeabc37c3e56455%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22251c1c333fc660c18e841b9bebeabc37c3e56455%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19394%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:43 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create draft change for phabricator testing\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create draft change for phabricator testing\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "188" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+draft+change+for+phabricator+testing%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:44 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7918,\"phid\":\"PHID-DREV-sfsckrwrwc77rdl3k5rz\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-rpqqvsy7pcpvau6\"},{\"phid\":\"PHID-XACT-DREV-mjyhm2rmcu57gow\"},{\"phid\":\"PHID-XACT-DREV-qhnb42g3u3yex2y\"},{\"phid\":\"PHID-XACT-DREV-4a7yil3a62stly2\"},{\"phid\":\"PHID-XACT-DREV-ipielqp34itcncl\"},{\"phid\":\"PHID-XACT-DREV-cmv7ezhpsxlbj3a\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "443" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-pqdlhei24n47fzeofjph%22%7D%2C+%7B%22type%22%3A+%22parents.set%22%2C+%22value%22%3A+%5B%22PHID-DREV-yhl3yvijs4jploa5iqm4%22%5D%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+draft+change+for+phabricator+testing%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:45 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7918\",\"phid\":\"PHID-DREV-sfsckrwrwc77rdl3k5rz\",\"title\":\"create draft change for phabricator testing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7918\",\"dateCreated\":\"1579221164\",\"dateModified\":\"1579221164\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":2},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"3\",\"activeDiffPHID\":\"PHID-DIFF-pqdlhei24n47fzeofjph\",\"diffs\":[\"19394\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[\"PHID-DREV-yhl3yvijs4jploa5iqm4\"]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"},{\"id\":\"7917\",\"phid\":\"PHID-DREV-yhl3yvijs4jploa5iqm4\",\"title\":\"create public change for phabricator testing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7917\",\"dateCreated\":\"1579221160\",\"dateModified\":\"1579221164\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":1},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-e64weyerxtutv2jvj2dt\",\"diffs\":[\"19393\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "154" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7917%2C+7918%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:45 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%2C+%5C%22parent%5C%22%3A+%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19394%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:46 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%223244dc4a33342b4d91ad534ae091685244ac5ed4%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%227b4185ab5d16acf98e41d566be38c5dbea10878d%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19394%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-skipped.json b/tests/phabricator/phabsend-skipped.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-skipped.json @@ -0,0 +1,141 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:17 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"19396\":{\"id\":\"19396\",\"revisionID\":\"7919\",\"dateCreated\":\"1579221192\",\"dateModified\":\"1579221194\",\"sourceControlBaseRevision\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52929\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sOtQ9WtAYaL5\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"2\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n+comment2\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"1849d7828727a28e14c589323e4f8c9a1c8d2816\",\"parent\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"user\":\"test\"},\"local:commits\":{\"1849d7828727a28e14c589323e4f8c9a1c8d2816\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"1849d7828727a28e14c589323e4f8c9a1c8d2816\",\"parents\":[\"3244dc4a33342b4d91ad534ae091685244ac5ed4\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"19395\":{\"id\":\"19395\",\"revisionID\":\"7919\",\"dateCreated\":\"1579221176\",\"dateModified\":\"1579221179\",\"sourceControlBaseRevision\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52928\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"mzg_LBhhVYqb\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\",\"parent\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"user\":\"test\"},\"local:commits\":{\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"f7db812bbe1db49d86823e6d7b9ab4b30539f801\",\"parents\":[\"3244dc4a33342b4d91ad534ae091685244ac5ed4\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "154" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22revisionIDs%22%3A+%5B7919%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:33:18 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7919\",\"phid\":\"PHID-DREV-mrxkguxqg3qmf6o3ah4d\",\"title\":\"create comment for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7919\",\"dateCreated\":\"1579221179\",\"dateModified\":\"1579221194\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":2,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-peqlcs25nvzqrns6izrf\",\"diffs\":[\"19396\",\"19395\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "146" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7919%5D%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/phabricator/phabsend-update-alpha-create-beta.json b/tests/phabricator/phabsend-update-alpha-create-beta.json new file mode 100644 --- /dev/null +++ b/tests/phabricator/phabsend-update-alpha-create-beta.json @@ -0,0 +1,1028 @@ +{ + "interactions": [ + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:18 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"19390\":{\"id\":\"19390\",\"revisionID\":\"7915\",\"dateCreated\":\"1579221121\",\"dateModified\":\"1579221124\",\"sourceControlBaseRevision\":\"0000000000000000000000000000000000000000\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52923\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"g6dr_XSxA9EP\"},\"oldPath\":null,\"currentPath\":\"alpha\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+alpha\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"347bf67801e55faaffe1616c6bac53cdf6b6dfc2\",\"parent\":\"0000000000000000000000000000000000000000\",\"user\":\"test\"},\"local:commits\":{\"347bf67801e55faaffe1616c6bac53cdf6b6dfc2\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"347bf67801e55faaffe1616c6bac53cdf6b6dfc2\",\"parents\":[\"0000000000000000000000000000000000000000\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "154" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22revisionIDs%22%3A+%5B7915%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:18 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"almanacServicePHID\":null,\"refRules\":{\"fetchRules\":[],\"trackRules\":[],\"permanentRefRules\":[]},\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22constraints%22%3A+%7B%22callsigns%22%3A+%5B%22HG%22%5D%7D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:19 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19391,\"phid\":\"PHID-DIFF-fu7z4h6aahgcq2h2q33b\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19391\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1183" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22alpha%22%3A+%7B%22addLines%22%3A+2%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22alpha%22%2C+%22delLines%22%3A+0%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+2%2C+%22corpus%22%3A+%22%2Balpha%5Cn%2Bmore%5Cn%22%2C+%22delLines%22%3A+0%2C+%22newLength%22%3A+2%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+0%2C+%22oldOffset%22%3A+0%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%22unix%3Afilemode%22%3A+%22100644%22%7D%2C+%22oldPath%22%3A+null%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+1%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%220000000000000000000000000000000000000000%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:20 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%2C+%5C%22parent%5C%22%3A+%5C%220000000000000000000000000000000000000000%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19391%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:20 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%220000000000000000000000000000000000000000%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19391%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:21 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create alpha for phabricator test \\u20ac\",\"revisionID\":7915},\"revisionIDFieldInfo\":{\"value\":7915,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create alpha for phabricator test \\u20ac\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "264" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+alpha+for+phabricator+test+%5Cu20ac%5Cn%5CnDifferential+Revision%3A+https%3A%2F%2Fphab.mercurial-scm.org%2FD7915%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:22 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7915,\"phid\":\"PHID-DREV-3mzbavd2ajsbar5l3esr\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-46hca4nfzc2t7qf\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "374" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22objectIdentifier%22%3A+7915%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-fu7z4h6aahgcq2h2q33b%22%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+alpha+for+phabricator+test+%5Cu20ac%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:23 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"diffid\":19392,\"phid\":\"PHID-DIFF-vn5llgg5oh2rkzquipx4\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/19392\\/\"},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.creatediff", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "1169" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22bookmark%22%3A+null%2C+%22branch%22%3A+%22default%22%2C+%22changes%22%3A+%7B%22beta%22%3A+%7B%22addLines%22%3A+1%2C+%22awayPaths%22%3A+%5B%5D%2C+%22commitHash%22%3A+null%2C+%22currentPath%22%3A+%22beta%22%2C+%22delLines%22%3A+0%2C+%22fileType%22%3A+1%2C+%22hunks%22%3A+%5B%7B%22addLines%22%3A+1%2C+%22corpus%22%3A+%22%2Bbeta%5Cn%22%2C+%22delLines%22%3A+0%2C+%22newLength%22%3A+1%2C+%22newOffset%22%3A+1%2C+%22oldLength%22%3A+0%2C+%22oldOffset%22%3A+0%7D%5D%2C+%22metadata%22%3A+%7B%7D%2C+%22newProperties%22%3A+%7B%22unix%3Afilemode%22%3A+%22100644%22%7D%2C+%22oldPath%22%3A+null%2C+%22oldProperties%22%3A+%7B%7D%2C+%22type%22%3A+1%7D%7D%2C+%22creationMethod%22%3A+%22phabsend%22%2C+%22lintStatus%22%3A+%22none%22%2C+%22repositoryPHID%22%3A+%22PHID-REPO-bvunnehri4u2isyr7bc3%22%2C+%22sourceControlBaseRevision%22%3A+%22c44b38f24a454b288ac6977d9d75f71df027994b%22%2C+%22sourceControlPath%22%3A+%22%2F%22%2C+%22sourceControlSystem%22%3A+%22hg%22%2C+%22sourceMachine%22%3A+%22%22%2C+%22sourcePath%22%3A+%22%2F%22%2C+%22unitStatus%22%3A+%22none%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:23 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%229e6901f21d5bfd37793dc2cef58a33a3441c2f3b%5C%22%2C+%5C%22parent%5C%22%3A+%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19392%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:24 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%229e6901f21d5bfd37793dc2cef58a33a3441c2f3b%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%229e6901f21d5bfd37793dc2cef58a33a3441c2f3b%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19392%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:25 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create beta for phabricator test\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"},\"transactions\":[{\"type\":\"title\",\"value\":\"create beta for phabricator test\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "177" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22corpus%22%3A+%22create+beta+for+phabricator+test%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "connection": [ + "close" + ], + "content-type": [ + "application/json" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:25 GMT" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "transfer-encoding": [ + "chunked" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":{\"object\":{\"id\":7916,\"phid\":\"PHID-DREV-nk73cg2l2oqfozxnw2i3\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-qyy3foasgvhwuwc\"},{\"phid\":\"PHID-XACT-DREV-ke7lc4r5bg2um6j\"},{\"phid\":\"PHID-XACT-DREV-tayq76rfuwaxlo5\"},{\"phid\":\"PHID-XACT-DREV-6lnwmq75f43mu4l\"},{\"phid\":\"PHID-XACT-DREV-leh7oir7ayewz2p\"},{\"phid\":\"PHID-XACT-DREV-adrkqplhnjym4ln\"}]},\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "432" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22transactions%22%3A+%5B%7B%22type%22%3A+%22update%22%2C+%22value%22%3A+%22PHID-DIFF-vn5llgg5oh2rkzquipx4%22%7D%2C+%7B%22type%22%3A+%22parents.set%22%2C+%22value%22%3A+%5B%22PHID-DREV-3mzbavd2ajsbar5l3esr%22%5D%7D%2C+%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22create+beta+for+phabricator+test%22%7D%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:26 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":[{\"id\":\"7916\",\"phid\":\"PHID-DREV-nk73cg2l2oqfozxnw2i3\",\"title\":\"create beta for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7916\",\"dateCreated\":\"1579221145\",\"dateModified\":\"1579221145\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"1\",\"activeDiffPHID\":\"PHID-DIFF-vn5llgg5oh2rkzquipx4\",\"diffs\":[\"19392\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[\"PHID-DREV-3mzbavd2ajsbar5l3esr\"]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"},{\"id\":\"7915\",\"phid\":\"PHID-DREV-3mzbavd2ajsbar5l3esr\",\"title\":\"create alpha for phabricator test \\u20ac\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7915\",\"dateCreated\":\"1579221124\",\"dateModified\":\"1579221145\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":2,\"lines.removed\":0},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-fu7z4h6aahgcq2h2q33b\",\"diffs\":[\"19391\",\"19390\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.query", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "154" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7915%2C+7916%5D%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:27 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "482" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22date%5C%22%3A+%5C%220+0%5C%22%2C+%5C%22node%5C%22%3A+%5C%22a692622e693757674f85ff481c7ff77057a7f82a%5C%22%2C+%5C%22parent%5C%22%3A+%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%2C+%5C%22user%5C%22%3A+%5C%22test%5C%22%7D%22%2C+%22diff_id%22%3A+19392%2C+%22name%22%3A+%22hg%3Ameta%22%7D&output=json&__conduit__=1" + } + }, + { + "response": { + "headers": { + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json" + ], + "transfer-encoding": [ + "chunked" + ], + "strict-transport-security": [ + "max-age=0; includeSubdomains; preload" + ], + "date": [ + "Fri, 17 Jan 2020 00:32:27 GMT" + ], + "cache-control": [ + "no-store" + ], + "expires": [ + "Sat, 01 Jan 2000 00:00:00 GMT" + ], + "server": [ + "Apache/2.4.10 (Debian)" + ], + "x-frame-options": [ + "Deny" + ], + "referrer-policy": [ + "no-referrer" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "body": { + "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}" + } + }, + "request": { + "method": "POST", + "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "user-agent": [ + "mercurial/proto-1.0 (Mercurial 5.2.2+620-6ee2ba170fe6+20200116)" + ], + "accept": [ + "application/mercurial-0.1" + ], + "content-length": [ + "594" + ], + "host": [ + "phab.mercurial-scm.org" + ] + }, + "body": "params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22data%22%3A+%22%7B%5C%22a692622e693757674f85ff481c7ff77057a7f82a%5C%22%3A+%7B%5C%22author%5C%22%3A+%5C%22test%5C%22%2C+%5C%22authorEmail%5C%22%3A+%5C%22test%5C%22%2C+%5C%22branch%5C%22%3A+%5C%22default%5C%22%2C+%5C%22commit%5C%22%3A+%5C%22a692622e693757674f85ff481c7ff77057a7f82a%5C%22%2C+%5C%22parents%5C%22%3A+%5B%5C%22c44b38f24a454b288ac6977d9d75f71df027994b%5C%22%5D%2C+%5C%22time%5C%22%3A+0%7D%7D%22%2C+%22diff_id%22%3A+19392%2C+%22name%22%3A+%22local%3Acommits%22%7D&output=json&__conduit__=1" + } + } + ], + "version": 1 +} \ No newline at end of file diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t --- a/tests/test-phabricator.t +++ b/tests/test-phabricator.t @@ -20,3 +20,195 @@ > hgphab.phabtoken = cli-hahayouwish > EOF $ VCR="$TESTDIR/phabricator" + +Error is handled reasonably. We override the phabtoken here so that +when you're developing changes to phabricator.py you can edit the +above config and have a real token in the test but not have to edit +this test. + $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \ + > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head + abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long. + +Basic phabread: + $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head + # HG changeset patch + # Date 1536771503 0 + # Parent a5de21c9e3703f8e8eb064bd7d893ff2f703c66a + exchangev2: start to implement pull with wire protocol v2 + + Wire protocol version 2 will take a substantially different + approach to exchange than version 1 (at least as far as pulling + is concerned). + + This commit establishes a new exchangev2 module for holding + +phabupdate with an accept: + $ hg phabupdate --accept D4564 \ + > -m 'I think I like where this is headed. Will read rest of series later.'\ + > --test-vcr "$VCR/accept-4564.json" + abort: Conduit Error (ERR-CONDUIT-CORE): Validation errors: + - You can not accept this revision because it has already been closed. Only open revisions can be accepted. + [255] + $ hg phabupdate --accept D7913 -m 'LGTM' --test-vcr "$VCR/accept-7913.json" + +Create a differential diff: + $ HGENCODING=utf-8; export HGENCODING + $ echo alpha > alpha + $ hg ci --addremove -m 'create alpha for phabricator test €' + adding alpha + $ hg phabsend -r . --test-vcr "$VCR/phabsend-create-alpha.json" + D7915 - created - d386117f30e6: create alpha for phabricator test \xe2\x82\xac (esc) + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d386117f30e6-24ffe649-phabsend.hg + $ echo more >> alpha + $ HGEDITOR=true hg ci --amend + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/347bf67801e5-3bf313e4-amend.hg + $ echo beta > beta + $ hg ci --addremove -m 'create beta for phabricator test' + adding beta + $ hg phabsend -r ".^::" --test-vcr "$VCR/phabsend-update-alpha-create-beta.json" + D7915 - updated - c44b38f24a45: create alpha for phabricator test \xe2\x82\xac (esc) + D7916 - created - 9e6901f21d5b: create beta for phabricator test + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9e6901f21d5b-1fcd4f0e-phabsend.hg + $ unset HGENCODING + +The amend won't explode after posting a public commit. The local tag is left +behind to identify it. + + $ echo 'public change' > beta + $ hg ci -m 'create public change for phabricator testing' + $ hg phase --public . + $ echo 'draft change' > alpha + $ hg ci -m 'create draft change for phabricator testing' + $ hg phabsend --amend -r '.^::' --test-vcr "$VCR/phabsend-create-public.json" + D7917 - created - 7b4185ab5d16: create public change for phabricator testing + D7918 - created - 251c1c333fc6: create draft change for phabricator testing + warning: not updating public commit 2:7b4185ab5d16 + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/251c1c333fc6-41cb7c3b-phabsend.hg + $ hg tags -v + tip 3:3244dc4a3334 + D7917 2:7b4185ab5d16 local + + $ hg debugcallconduit user.search --test-vcr "$VCR/phab-conduit.json" < { + > "constraints": { + > "isBot": true + > } + > } + > EOF + { + "cursor": { + "after": null, + "before": null, + "limit": 100, + "order": null + }, + "data": [], + "maps": {}, + "query": { + "queryKey": null + } + } + +Template keywords + $ hg log -T'{rev} {phabreview|json}\n' + 3 {"id": "D7918", "url": "https://phab.mercurial-scm.org/D7918"} + 2 {"id": "D7917", "url": "https://phab.mercurial-scm.org/D7917"} + 1 {"id": "D7916", "url": "https://phab.mercurial-scm.org/D7916"} + 0 {"id": "D7915", "url": "https://phab.mercurial-scm.org/D7915"} + + $ hg log -T'{rev} {if(phabreview, "{phabreview.url} {phabreview.id}")}\n' + 3 https://phab.mercurial-scm.org/D7918 D7918 + 2 https://phab.mercurial-scm.org/D7917 D7917 + 1 https://phab.mercurial-scm.org/D7916 D7916 + 0 https://phab.mercurial-scm.org/D7915 D7915 + +Commenting when phabsending: + $ echo comment > comment + $ hg ci --addremove -m "create comment for phabricator test" + adding comment + $ hg phabsend -r . -m "For default branch" --test-vcr "$VCR/phabsend-comment-created.json" + D7919 - created - d5dddca9023d: create comment for phabricator test + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d5dddca9023d-adf673ba-phabsend.hg + $ echo comment2 >> comment + $ hg ci --amend + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f7db812bbe1d-8fcded77-amend.hg + $ hg phabsend -r . -m "Address review comments" --test-vcr "$VCR/phabsend-comment-updated.json" + D7919 - updated - 1849d7828727: create comment for phabricator test + +Phabsending a skipped commit: + $ hg phabsend --no-amend -r . --test-vcr "$VCR/phabsend-skipped.json" + D7919 - skipped - 1849d7828727: create comment for phabricator test + +Phabreading a DREV with a local:commits time as a string: + $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285 + # HG changeset patch + # User Pulkit Goyal <7895pulkit@gmail.com> + # Date 1509404054 -19800 + # Node ID 44fc1c1f1774a76423b9c732af6938435099bcc5 + # Parent 8feef8ef8389a3b544e0a74624f1efc3a8d85d35 + repoview: add a new attribute _visibilityexceptions and related API + + Currently we don't have a defined way in core to make some hidden revisions + visible in filtered repo. Extensions to achieve the purpose of unhiding some + hidden commits, wrap repoview.pinnedrevs() function. + + To make the above task simple and have well defined API, this patch adds a new + attribute '_visibilityexceptions' to repoview class which will contains + the hidden revs which should be exception. + This will allow to set different exceptions for different repoview objects + backed by the same unfiltered repo. + + This patch also adds API to add revs to the attribute set and get them. + + Thanks to Jun for suggesting the use of repoview class instead of localrepo. + + Differential Revision: https://phab.mercurial-scm.org/D1285 + diff --git a/mercurial/repoview.py b/mercurial/repoview.py + --- a/mercurial/repoview.py + +++ b/mercurial/repoview.py + @@ * @@ (glob) + subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`. + """ + + + # hidden revs which should be visible + + _visibilityexceptions = set() + + + def __init__(self, repo, filtername): + object.__setattr__(self, r'_unfilteredrepo', repo) + object.__setattr__(self, r'filtername', filtername) + @@ -231,6 +234,14 @@ + return self + return self.unfiltered().filtered(name) + + + def addvisibilityexceptions(self, revs): + + """adds hidden revs which should be visible to set of exceptions""" + + self._visibilityexceptions.update(revs) + + + + def getvisibilityexceptions(self): + + """returns the set of hidden revs which should be visible""" + + return self._visibilityexceptions + + + # everything access are forwarded to the proxied repo + def __getattr__(self, attr): + return getattr(self._unfilteredrepo, attr) + diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py + --- a/mercurial/localrepo.py + +++ b/mercurial/localrepo.py + @@ -570,6 +570,14 @@ + def close(self): + self._writecaches() + + + def addvisibilityexceptions(self, exceptions): + + # should be called on a filtered repository + + pass + + + + def getvisibilityexceptions(self): + + # should be called on a filtered repository + + return set() + + + def _loadextensions(self): + extensions.loadall(self.ui) + + + + $ cd ..