mononoke: simplify pushrebase replay

Summary:
Pretty big cleanup. The biggest part is simplifying comparing logic.
Pushrebase replay compared replayed pushrebase commits with their hg
counterparts. Because previously we didn't log enough data from hg servers we
had to jump through a lot of hoops to find out which commits should be compared
to which.
Now we are logging `ordered_added_revs` i.e. which commits mercurial produced
after the hg pushrebase, which is exactly what we need for comparison. So a lot
of code can be simplified.

That does mean though that some of the recorded pushrebases we won't be able to
replay because they don't have `ordered_added_revs`. At the moment we have
~300K pushrebases without `ordered_added_revs` and ~100K with. I think this
change is worth it given how simpler the code is and I'd argue 100K is a pretty
big number. For the rest 300K pushrebases we can later manually fill in
`ordered_added_revs` field if we consider it's necessary.

After this diff pushrebase replay won't use hg repo, and so we can run it on
normal twshared jobs instead of on hg servers.

A few smaller changes:
1) Also note that for now this diff makes pushrebase replay single threaded, while
previously we ran comparison in parallel. That will be fixed in the next diffs.

2) Pushrebase replay now always compare commits i.e. `--compare-commits` option
was removed

Also change repo id in tw spec to 20

Reviewed By: HarveyHunt

Differential Revision: D14122963

fbshipit-source-id: 0f8da7cffb13899f11143a01d1a301fdf8ea7f00
This commit is contained in:
Stanislau Hlebik 2019-02-25 09:24:37 -08:00 committed by Facebook Github Bot
parent 125bfbc803
commit cb70c58b45

View File

@ -170,10 +170,17 @@ readonly=true
CONFIG
fi
if [[ -v PUSHREBASE_REWRITE_DATES ]]; then
cat >> repos/repo/server.toml <<CONFIG
[pushrebase]
rewritedates=true
CONFIG
else
cat >> repos/repo/server.toml <<CONFIG
[pushrebase]
rewritedates=false
CONFIG
fi
if [[ ! -v ENABLE_ACL_CHECKER ]]; then
cat >> repos/repo/server.toml <<CONFIG