tests/phabricator/phabimport-multi-drev.json
author Arun Kulshreshtha <akulshreshtha@janestreet.com>
Tue, 30 Aug 2022 15:29:55 -0400
changeset 49491 c6a1beba27e9
parent 44579 a7f8c657a3f0
permissions -rw-r--r--
bisect: avoid copying ancestor list for non-merge commits During a bisection, hg needs to compute a list of all ancestors for every candidate commit. This is accomplished via a bottom-up traversal of the set of candidates, during which each revision's ancestor list is populated using the ancestor list of its parent(s). Previously, this involved copying the entire list, which could be very long in if the bisection range was large. To help improve this, we can observe that each candidate commit is visited exactly once, at which point its ancestor list is copied into its children's lists and then dropped. In the case of non-merge commits, a commit's ancestor list consists exactly of its parent's list plus itself. This means that we can trivially reuse the parent's existing list for one of its non-merge children, which avoids copying entirely if that commit is the parent's only child. This makes bisections over linear ranges of commits much faster. During some informal testing in the large publicly-available `mozilla-central` repository, this noticeably sped up bisections over large ranges of history: Setup: $ cd mozilla-central $ hg bisect --reset $ hg bisect --good 0 $ hg log -r tip -T '{rev}\n' 628417 Test: $ time hg bisect --bad tip --noupdate Before: real 3m35.927s user 3m35.553s sys 0m0.319s After: real 1m41.142s user 1m40.810s sys 0m0.285s

{
    "version": 1, 
    "interactions": [
        {
            "response": {
                "status": {
                    "message": "OK", 
                    "code": 200
                }, 
                "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\":\"1579222305\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"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\":\"1579222286\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"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}"
                }, 
                "headers": {
                    "expires": [
                        "Sat, 01 Jan 2000 00:00:00 GMT"
                    ], 
                    "transfer-encoding": [
                        "chunked"
                    ], 
                    "strict-transport-security": [
                        "max-age=0; includeSubdomains; preload"
                    ], 
                    "x-xss-protection": [
                        "1; mode=block"
                    ], 
                    "date": [
                        "Wed, 04 Mar 2020 22:52:46 GMT"
                    ], 
                    "referrer-policy": [
                        "no-referrer"
                    ], 
                    "content-type": [
                        "application/json"
                    ], 
                    "x-frame-options": [
                        "Deny"
                    ], 
                    "x-content-type-options": [
                        "nosniff"
                    ], 
                    "cache-control": [
                        "no-store"
                    ], 
                    "server": [
                        "Apache/2.4.10 (Debian)"
                    ]
                }
            }, 
            "request": {
                "method": "POST", 
                "uri": "https://phab.mercurial-scm.org//api/differential.query", 
                "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7917%2C+7918%5D%7D&__conduit__=1", 
                "headers": {
                    "user-agent": [
                        "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
                    ], 
                    "host": [
                        "phab.mercurial-scm.org"
                    ], 
                    "content-type": [
                        "application/x-www-form-urlencoded"
                    ], 
                    "accept": [
                        "application/mercurial-0.1"
                    ], 
                    "content-length": [
                        "154"
                    ]
                }
            }
        }, 
        {
            "response": {
                "status": {
                    "message": "OK", 
                    "code": 200
                }, 
                "body": {
                    "string": "{\"result\":{\"19394\":{\"id\":\"19394\",\"revisionID\":\"7918\",\"dateCreated\":\"1579221161\",\"dateModified\":\"1579221164\",\"sourceControlBaseRevision\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52927\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sjHKTvwwqRoW\"},\"oldPath\":\"alpha\",\"currentPath\":\"alpha\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"2\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"2\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"-alpha\\n-more\\n+draft change\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"parent\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"user\":\"test\"},\"local:commits\":{\"3244dc4a33342b4d91ad534ae091685244ac5ed4\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"parents\":[\"7b4185ab5d16acf98e41d566be38c5dbea10878d\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"19393\":{\"id\":\"19393\",\"revisionID\":\"7917\",\"dateCreated\":\"1579221158\",\"dateModified\":\"1579221160\",\"sourceControlBaseRevision\":\"a692622e693757674f85ff481c7ff77057a7f82a\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52926\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"uKa4JPWhh2di\"},\"oldPath\":\"beta\",\"currentPath\":\"beta\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"1\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"1\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"-beta\\n+public change\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"parent\":\"a692622e693757674f85ff481c7ff77057a7f82a\",\"user\":\"test\"},\"local:commits\":{\"7b4185ab5d16acf98e41d566be38c5dbea10878d\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"parents\":[\"a692622e693757674f85ff481c7ff77057a7f82a\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}"
                }, 
                "headers": {
                    "expires": [
                        "Sat, 01 Jan 2000 00:00:00 GMT"
                    ], 
                    "transfer-encoding": [
                        "chunked"
                    ], 
                    "strict-transport-security": [
                        "max-age=0; includeSubdomains; preload"
                    ], 
                    "x-xss-protection": [
                        "1; mode=block"
                    ], 
                    "date": [
                        "Wed, 04 Mar 2020 22:52:46 GMT"
                    ], 
                    "referrer-policy": [
                        "no-referrer"
                    ], 
                    "content-type": [
                        "application/json"
                    ], 
                    "x-frame-options": [
                        "Deny"
                    ], 
                    "x-content-type-options": [
                        "nosniff"
                    ], 
                    "cache-control": [
                        "no-store"
                    ], 
                    "server": [
                        "Apache/2.4.10 (Debian)"
                    ]
                }
            }, 
            "request": {
                "method": "POST", 
                "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", 
                "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B19393%2C+19394%5D%7D&__conduit__=1", 
                "headers": {
                    "user-agent": [
                        "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
                    ], 
                    "host": [
                        "phab.mercurial-scm.org"
                    ], 
                    "content-type": [
                        "application/x-www-form-urlencoded"
                    ], 
                    "accept": [
                        "application/mercurial-0.1"
                    ], 
                    "content-length": [
                        "156"
                    ]
                }
            }
        }, 
        {
            "response": {
                "status": {
                    "message": "OK", 
                    "code": 200
                }, 
                "body": {
                    "string": "{\"result\":\"diff --git a\\/beta b\\/beta\\n--- a\\/beta\\n+++ b\\/beta\\n@@ -1 +1 @@\\n-beta\\n+public change\\n\\n\",\"error_code\":null,\"error_info\":null}"
                }, 
                "headers": {
                    "expires": [
                        "Sat, 01 Jan 2000 00:00:00 GMT"
                    ], 
                    "transfer-encoding": [
                        "chunked"
                    ], 
                    "strict-transport-security": [
                        "max-age=0; includeSubdomains; preload"
                    ], 
                    "x-xss-protection": [
                        "1; mode=block"
                    ], 
                    "date": [
                        "Wed, 04 Mar 2020 22:52:47 GMT"
                    ], 
                    "referrer-policy": [
                        "no-referrer"
                    ], 
                    "content-type": [
                        "application/json"
                    ], 
                    "x-frame-options": [
                        "Deny"
                    ], 
                    "x-content-type-options": [
                        "nosniff"
                    ], 
                    "cache-control": [
                        "no-store"
                    ], 
                    "server": [
                        "Apache/2.4.10 (Debian)"
                    ]
                }
            }, 
            "request": {
                "method": "POST", 
                "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff", 
                "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+19393%7D&__conduit__=1", 
                "headers": {
                    "user-agent": [
                        "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
                    ], 
                    "host": [
                        "phab.mercurial-scm.org"
                    ], 
                    "content-type": [
                        "application/x-www-form-urlencoded"
                    ], 
                    "accept": [
                        "application/mercurial-0.1"
                    ], 
                    "content-length": [
                        "144"
                    ]
                }
            }
        }, 
        {
            "response": {
                "status": {
                    "message": "OK", 
                    "code": 200
                }, 
                "body": {
                    "string": "{\"result\":\"diff --git a\\/alpha b\\/alpha\\n--- a\\/alpha\\n+++ b\\/alpha\\n@@ -1,2 +1 @@\\n-alpha\\n-more\\n+draft change\\n\\n\",\"error_code\":null,\"error_info\":null}"
                }, 
                "headers": {
                    "expires": [
                        "Sat, 01 Jan 2000 00:00:00 GMT"
                    ], 
                    "transfer-encoding": [
                        "chunked"
                    ], 
                    "strict-transport-security": [
                        "max-age=0; includeSubdomains; preload"
                    ], 
                    "x-xss-protection": [
                        "1; mode=block"
                    ], 
                    "date": [
                        "Wed, 04 Mar 2020 22:52:47 GMT"
                    ], 
                    "referrer-policy": [
                        "no-referrer"
                    ], 
                    "content-type": [
                        "application/json"
                    ], 
                    "x-frame-options": [
                        "Deny"
                    ], 
                    "x-content-type-options": [
                        "nosniff"
                    ], 
                    "cache-control": [
                        "no-store"
                    ], 
                    "server": [
                        "Apache/2.4.10 (Debian)"
                    ]
                }
            }, 
            "request": {
                "method": "POST", 
                "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff", 
                "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+19394%7D&__conduit__=1", 
                "headers": {
                    "user-agent": [
                        "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
                    ], 
                    "host": [
                        "phab.mercurial-scm.org"
                    ], 
                    "content-type": [
                        "application/x-www-form-urlencoded"
                    ], 
                    "accept": [
                        "application/mercurial-0.1"
                    ], 
                    "content-length": [
                        "144"
                    ]
                }
            }
        }
    ]
}