phabricator: update hgmatcher to cope with the new data format
The new conduit format can't be matched by the existing matcher since it shifts
all the data into an urlencoded string of JSON, the order of which isn't stable
between runs. Instead detect JSON values of params and load them into python
dicts, which python will then naturally deep-equal compare.
Differential Revision: https://phab.mercurial-scm.org/D7055
phabricator: treat non-utf-8 text files as binary as phabricator requires
Phabricator can't cope with text files that are not UTF-8, so requires them to
be submitted as binary files instead. This has the unfortunate effect of
making them practically unreviewable in Phabricator since it will only display
the separate versions of the file in other views, not a diff. `phabread`ing
such submissions are similar, since it will just output the binary patch, but
`hg import` copes with it fine and `hg diff` afterwards will show the actual
changes. It is still a marked improvement over trying to submit them as text,
which just leads to corruption (Phabricator will either output ? or HTML
entities for non-UTF-8 characters, depending on context).
Running decode on the whole file like this seems slightly unfortunate, but I'm
not aware of a better way.
Needs to be done to p1() version as well to detect conversions to UTF-8.
Differential Revision: https://phab.mercurial-scm.org/D7054
phabricator: switch to the creatediff endpoint
This lets the extension submit binary files, as well as set branch info so that
it is exposed in the Phabricator interface.
Differential Revision: https://phab.mercurial-scm.org/D7053
phabricator: change conduit data format to match arcanist
The existing form isn't handled well by Phabricator for certain data types.
Differential Revision: https://phab.mercurial-scm.org/D7052
phabricator: remove tests and all recordings
The next commit is going to change the format of conduit API requests so none
of the VCR recordings will match and all the tests will fail.
Differential Revision: https://phab.mercurial-scm.org/D7051
phabricator: convert phabhunk and phabchange keys to bytes when finalising
I thought I had included this code already but I'd missed it out. One of the
disadvantages of attrs is that all the keys are unicode strings on py3, but we
need them to be byte strings.
Differential Revision: https://phab.mercurial-scm.org/D7066
phabricator: add
addadded function
This is the most complicated part of the new code, and is responsible for
adding all added files, whether brand new, copied, or moved. This also
includes creating the phabchanges for the original files that have been moved
or copied from, since they might need their awayPaths and type updating if
multiple copies are involved.
Differential Revision: https://phab.mercurial-scm.org/D7050
sidedatacopies: directly fetch copies information from sidedata
When using the sidedata mode, we don't need a complicated and expensive
`context` object. Instead we directly fetch copies information from the
sidedata (through a changelogrevision object). More optimisations coming.
revision: large amount; added files: large amount; rename small amount;
c3b14617fbd7 9ba6ab77fd29
filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3)
base: ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3)
before: ! wall 4.681985 comb 4.680000 user 4.640000 sys 0.040000 (median of 3)
after: ! wall 3.955894 comb 3.950000 user 3.940000 sys 0.010000 (median of 3)
revision: large amount; added files: small amount; rename small amount;
c3b14617fbd7 f650a9b140d2
filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781)
base: ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3)
before: ! wall 6.459592 comb 6.470000 user 6.390000 sys 0.080000 (median of 3)
after: ! wall 5.505774 comb 5.500000 user 5.410000 sys 0.090000 (median of 3)
revision: large amount; added files: large amount; rename large amount;
08ea3258278e d9fa043f30c0
filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4)
base: ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8)
before: ! wall 0.961048 comb 0.960000 user 0.940000 sys 0.020000 (median of 11)
after: ! wall 0.882950 comb 0.880000 user 0.880000 sys 0.000000 (median of 11)
revision: small amount; added files: large amount; rename large amount;
df6f7a526b60 a83dc6a2d56f
filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6
base: ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128)
before: ! wall 0.021649 comb 0.020000 user 0.020000 sys 0.000000 (median of 135)
after: ! wall 0.020951 comb 0.020000 user 0.020000 sys 0.000000 (median of 141)
revision: small amount; added files: large amount; rename small amount;
4aa4e1f8e19a 169138063d63
filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7)
base: ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392)
before: ! wall 0.004022 comb 0.000000 user 0.000000 sys 0.000000 (median of 735)
after: ! wall 0.003988 comb 0.000000 user 0.000000 sys 0.000000 (median of 736)
revision: small amount; added files: small amount; rename small amount;
4bc173b045a6 964879152e2e
filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250)
base: ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180)
before: ! wall 0.000118 comb 0.000000 user 0.000000 sys 0.000000 (median of 19170)
after: ! wall 0.000097 comb 0.000000 user 0.000000 sys 0.000000 (median of 27276)
revision: medium amount; added files: large amount; rename medium amount;
c95f1ced15f2 2c68e87c3efe
filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4)
base: ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10)
before: ! wall 0.679500 comb 0.680000 user 0.680000 sys 0.000000 (median of 15)
after: ! wall 0.596779 comb 0.600000 user 0.600000 sys 0.000000 (median of 17)
revision: medium amount; added files: medium amount; rename small amount;
d343da0c55a8 d7746d32bf9d
filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10
base: ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45)
before: ! wall 0.149675 comb 0.150000 user 0.150000 sys 0.000000 (median of 66)
after: ! wall 0.130786 comb 0.130000 user 0.130000 sys 0.000000 (median of 75)
Differential Revision: https://phab.mercurial-scm.org/D7072