Commit Graph

5 Commits

Author SHA1 Message Date
Jun Wu
ead30c096c phrevset: rewrite pull -r Dxxx into pull -r HASH
Summary: This matches user expectation.

Reviewed By: sfilipco

Differential Revision: D21320629

fbshipit-source-id: 0464b813c01fe31a2ca9473d5b389e563c7a2827
2020-05-06 15:29:57 -07:00
Jun Wu
495bf73f13 phrevset: implement autopull in revset layer
Summary:
Implement autopull so non-automation `hg pull -r Dxxxx`, `hg up Dxxxx` will
pull `Dxxxx` automatically.

Since we now autopull the commits, error messages are removed. The old code
actually causes issues because it will raise at `"D1234" in repo`, which is
a surprise to many code paths, including the revset autopull logic, which
uses `x in repo` to decide whether `x` is unknown.

Note `hg pull -r Dxxxx` is not using the revset layer and needs to be handled
separately. It works for hg servers right now because the server can translate
`Dxxx` to a commit hash. It probably does not work for a Mononoke server.

Reviewed By: sfilipco

Differential Revision: D21320626

fbshipit-source-id: 939abe12e3a9a8ed5ca7ed29bb4f90fb39e7674a
2020-05-06 15:29:57 -07:00
Jun Wu
3de6513f0e revset: make autopull commit pull seletivepull bookmarks
Summary: This ensures lagged master issue does not happen by pulling a single commit.

Reviewed By: DurhamG

Differential Revision: D20845384

fbshipit-source-id: 3ba16c07fe264fe2b6aecd494bbb832af7b390a0
2020-04-24 11:16:23 -07:00
Jun Wu
368d59e436 revset: attempt to pull the revset expression as a single name
Summary:
For names like `a-b-c`, it can be parsed in multiple ways:

- `"a-b-c"`
- `"a-b" - "c"`
- `"a" - "b-c"`

Mercurial uses `repo.lookup` in the parser to accept names like `"a-b-c"`.
Do it for the whole revset expression too.

But do not do it for every lookup (ex. testing `"a-b"` or `"b-c"` in the above
case), because that can be exceedingly expensive.

Reviewed By: DurhamG

Differential Revision: D20831014

fbshipit-source-id: f507e04ce24c953b096ccd836c356f50f11d2006
2020-04-24 11:16:22 -07:00
Jun Wu
bd55a2e946 phrevset: improve error message if the commit hash is not found
Summary:
Make the error cleaner and more actionable. We don't autopull the commit
because the revset layer might be not ready for it (ex. it expects commit
graph to be immutable and might have done some calculations based on the
old graph already).

Reviewed By: sfilipco

Differential Revision: D20845159

fbshipit-source-id: c51f2f52c612ff14a88fb891c10d1faad1094635
2020-04-07 19:05:05 -07:00