Fri, 30 Jun 2017 13:47:24 +0200 obsolete: small doc update for 'successorssets'
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 13:47:24 +0200] rev 33272
obsolete: small doc update for 'successorssets' Clarify successorssets documentation before we start updating the main function. This patch serie will introduce the successorssets template, the opposite of predecessor templates. Successors will use successorssets function and requires some improvement so before doing that, we clean up successorssets a bit.
Tue, 04 Jul 2017 18:52:28 -0700 phabricator: do not read a same revision twice
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 18:52:28 -0700] rev 33271
phabricator: do not read a same revision twice It's possible to set up non-linear dependencies in Phabricator like: o D4 |\ | o D3 | | o | D2 |/ o D1 The old `phabread` code will print D1 twice. This patch adds de-duplication to prevent that. Test Plan: Construct the above dependencies in a Phabricator test instance and make sure the old code prints D1 twice while the new code won't.
Tue, 04 Jul 2017 16:41:28 -0700 patch: make parsepatch optionally trim context lines
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:41:28 -0700] rev 33270
patch: make parsepatch optionally trim context lines Previously there is a suspicious `if False and delta > 0` which dates back to the beginning of hgext/record.py (b2607267236d). The "trimming context lines" feature could be useful (and is used by the next patch). So let's enable it. This patch adds a new `maxcontext` parameter to `recordhunk` and `parsepatch`, changing the `if False` condition to respect it. The old `trimcontext` implementation is also wrong - it does not update `toline` correctly and it does not do the right thing for `before` context. A doctest was added to guard us from making a similar mistake again. Since `maxcontext` is set to `None` (unlimited), there is no behavior change.
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: try to fetch differential revisions in batch
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33269
phabricator: try to fetch differential revisions in batch Previously, we read Differential Revisions one by one by calling `differential.query`. Fetching them one by one is suboptimal. Unfortunately, there is no Conduit API that allows us to get a stack of diffids using a single API call. This patch tries to be smarter using a simple heuristic: when fetching D59 as a stack, previous IDs like D51, D52, D53, ..., D58 are likely belonging to a same stack so just fetch them as well. Since `differential.query` only returns cheap metadata without expensive diff content, it shouldn't be a big problem for the server. Using a test Phabricator instance, this patch reduces `phabread` reading a 10 patch stack from about 13 to 30 seconds to 8 seconds.
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: avoid calling differential.getcommitmessage
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33268
phabricator: avoid calling differential.getcommitmessage Previously, we call differential.getcommitmessage API to get commit messages. Now we read that from "Differential Revision" object fetched via "differential.query" API. This removes one API call per patch.
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: rework phabread to reduce memory usage and round-trips
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33267
phabricator: rework phabread to reduce memory usage and round-trips This patch reworked phabread a bit so it fetches the lightweight "Differential Revision" metadata for a stack first. Then read other data. This allows the code to: a) send 1 request to get all `hg:meta` data instead of N requests b) patches are read in desired order, no need to buffer the output "b)" reduces the memory usage from O(N^2) to O(N) since we no longer keep old patch contents in memory. The above `N` means the number of patches in the stack.
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: abort if phabsend gets empty revs
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33266
phabricator: abort if phabsend gets empty revs Previously we didn't abort. Now we abort if revs is empty. This is consistent with "hg export" behavior. Maybe "return 1" is also a reasonable behavior, but that's inconsistent with the existing "hg export".
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: do not upload new diff if nothing changes
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33265
phabricator: do not upload new diff if nothing changes Previously, `phabsend` uploads new diffs as long as the commit hash changes. That's suboptimal because sometimes the diff is exactly the same as before, the commit hash change is caused by a parent hash change, or commit message change which do not affect diff content. This patch adds a check examining actual diff contents to skip uploading new diffs in that case.
Tue, 04 Jul 2017 16:36:48 -0700 phabricator: add node and p1 to hg:meta property
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:36:48 -0700] rev 33264
phabricator: add node and p1 to hg:meta property The "hg:meta" property is for extra metadata to reconstruct the patch. Previously it does not have node or parent information since I think by reading the patch again, the commit message will be mangled (like, added the "Differential Revision" line) and we cannot preserve the commit hash. However, the "parent" information could be useful. It could be helpful to locate the "base revision" so in case of a conflict applying the patch directly, we might be able to use 3-way merge to resolve it correctly. Note: "local:commits" is an existing "property" used by Phabricator that has the node and parent information. However, it lacks of timezone information and requires "author" and "authorEmail" to be separated. So we are using a different "property" - "hg:meta" to be distinguished from "local:commits".
Tue, 04 Jul 2017 16:16:37 -0700 phabricator: check associated Differential Revision from commit message
Jun Wu <quark@fb.com> [Tue, 04 Jul 2017 16:16:37 -0700] rev 33263
phabricator: check associated Differential Revision from commit message Previously, only tags can "associate" a changeset to a Differential Revision. But the usual pattern (arc patch or hg phabread) is to put the Differential Revision URL in commit message. This patch makes the code read commit message to find associated Differential Revision if associated tags are not found. This makes some workflows possible. For example, if the author loses their repo, or switch to another computer, they can continue download their own patches from Phabricator and update them without needing to manually create tags.
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip