Commit Graph

15 Commits

Author SHA1 Message Date
Lukasz Langa
dfda82e492 Upgrade to 18.5b1
Summary: Mostly empty lines removed and added.  A few bugfixes on excessive line splitting.

Reviewed By: quark-zju

Differential Revision: D8199128

fbshipit-source-id: 90c1616061bfd7cfbba0b75f03f89683340374d5
2018-05-30 02:23:58 -07:00
Shish Girling
1137cc5743 display 'Landing' status in hg ssl output
Summary:
It's super-useful to know the difference between "Accepted (You need to go and click the land button)" and "Accepted (We're just waiting for the land system to do its thing, no work for you right now)"

Alternative approach in D8074898

Reviewed By: mitrandir77

Differential Revision: D8074794

fbshipit-source-id: fdfda64e3a542518b8609e3a415d8cb3156373cf
2018-05-22 02:51:56 -07:00
Mateusz Moneta
4cfb665650 Update markers during hg pullbackup
Summary:
Before this change `hg pullbackup` did not set correct markers on commits.

This change make possible to see what changes already landed even when we are restoring repository from backup.
Before the change `fbclone` + `hg pullbackup` of repo with `C1` commit landed would result in:
```
o  o C2
|    |
o  o C1
|  /
|
o
```
after:
```
o  o C2
|    |
o  x C1
|  /
|
o
```

Reviewed By: StanislavGlebik

Differential Revision: D7032572

fbshipit-source-id: ffee3c7cc23c24a3df9a89c999c9dd2de226dbff
2018-04-13 21:51:23 -07:00
Ryan McElroy
297c6ce041 phabstatus: remove O(n^2) double loop
Summary:
This was unneeded. We can just populate the dict directly.
Note that now we catch any errors in the expected data format gracefully
and no longer stack trace with bad inputs.

Reviewed By: DurhamG

Differential Revision: D6826455

fbshipit-source-id: adc9cc1fc4895f3c67b112d914f566601336ce3b
2018-04-13 21:51:07 -07:00
Ryan McElroy
57daa71514 phabstatus: remove bad early exit
Summary:
This would cause us to return data outside of our contract, which
crashes in a worse, less useful way that if we catch things ourselves and
print useful debug information.

Reviewed By: quark-zju

Differential Revision: D6826454

fbshipit-source-id: 9cdb2987f762c98c6167ffcea03545bc46eb2119
2018-04-13 21:51:07 -07:00
Ryan McElroy
389ac72c31 phabstatus: mock full graphql response
Summary:
This will allow us to expose bugs in the graphql client code and
write tests to prevent future regressions. Note that this exposes a KeyError
bug when the response is malformed.

Having finally, we have arrived at full graphql responses both from the real
system and from mocking. We can now write tests more confidently.

Reviewed By: DurhamG

Differential Revision: D6826452

fbshipit-source-id: 4fd246fbafb353ce0138289262cbdfd0e9e35229
2018-04-13 21:51:07 -07:00
Ryan McElroy
83dd5f6841 phabstatus: no longer mock unused fields
Summary:
I do not know why all of these fields that we never checked were
mocked in the fist place.

Reviewed By: DurhamG

Differential Revision: D6826457

fbshipit-source-id: 78d336940b6146b61684c7789172298497c0b57f
2018-04-13 21:51:07 -07:00
Ryan McElroy
9c0bd152ae phabstatus: reverse mock order to prevent O(n^2) behavior
Reviewed By: DurhamG

Differential Revision: D6826451

fbshipit-source-id: dd14dbed5e1e018fd67e6f2ff2a6e2c6caf1c031
2018-04-13 21:51:07 -07:00
Ryan McElroy
3fe4fbbda9 phabstatus: expand test to cover more code
Summary:
Previously, we mocked returns from the code that processed the
graphql data, but that code has some bugs that were therefore not testable.
Here we move the tests to return mock graphql data, so we can also test the
processing functions. In future commits, we will fix some of the possible
issues.

Reviewed By: DurhamG

Differential Revision: D6826453

fbshipit-source-id: 5a390723e48ccf2477295602dd85bd065c072bd3
2018-04-13 21:51:07 -07:00
Ryan McElroy
f9de59f662 phabstatus: reindent query
Summary: Separate commit to make previous one easier to review

Reviewed By: quark-zju

Differential Revision: D6826448

fbshipit-source-id: 95ee95887476ae3f718265aa26605e7dbb7799e6
2018-04-13 21:51:06 -07:00
Ryan McElroy
264617b4d6 phabstatus: refactor graphql code into sub-functions
Summary:
In future commits, we want to make the test mock actual wire results
from graphql, not just the final results from the processing function. This
is a step in that direction.

Reviewed By: DurhamG

Differential Revision: D6826456

fbshipit-source-id: 529b17f8068506d38e87e18aa9974f478c87a206
2018-04-13 21:51:06 -07:00
Ryan McElroy
0b734e33e7 phabstatus: use shorter query alias for ssl lookup
Summary:
Mostly this just makes the lookups nicer to write. In a future commit,
we'll be wrapping more of these in try/catch blocks so the shorter lines will
really help.

Reviewed By: DurhamG

Differential Revision: D6826447

fbshipit-source-id: e07494176a09e1ec22fb70dfc34cf029d152d254
2018-04-13 21:51:06 -07:00
Phil Cohen
e40d91ef22 hg: fix import statements that cause HGDEMANDIMPORT=disable
Summary:
These import statements are actually broken -- I don't know how they were working before. (Perhaps because `demandimport` tries a few different paths.)

But this makes them work without demandimport.

Test Plan: HGDEMANDIMPORT=disable ./hg st

Reviewers: quark, singhsrb, #mercurial

Reviewed By: singhsrb

Subscribers: quark

Differential Revision: https://phabricator.intern.facebook.com/D6713858

Signature: 6713858:1515787418:23a78b8a439e7d114ead81dc9a136478f98f7e50
2018-01-12 12:20:29 -08:00
Francisco Massa
8efc997f51 phabricator-graphql: nice error message if ~/.arcrc is bad
Summary: When running hg ssl, if the .arcrc file is not proper JSON
(e.g., has a trailing comma), json.loads raises an exception that
was not being caught and lead to a stacktrace.

Test Plan: Locally run hg ssl with a bag .arcrc and the stack trace was gone.
Also write a test in test-fb-hgext-phabstatus.t

Reviewers: simonfar

Subscribers: luizmramos

Tasks: T24993088

Tags:
2018-01-12 10:46:25 +00:00
Phil Cohen
82285d3577 phabricator: move to extlib
Summary: Update import statements and code to match core linters.

Test Plan:
`run-tests.py -j8`

Source these versions of phabdiff.py, arcdiff.py, and phabstatus.py in my hgrc. Run hg st, diff, ssl and observe no crashes.

Reviewers: durham, rmcelroy, phillco, #mercurial

Reviewed By: rmcelroy

Subscribers: rmcelroy, quark, awestern

Differential Revision: https://phabricator.intern.facebook.com/D6680961

Signature: 6680961:1515578477:ea5f1591e390f6ca8a94f652daeb1db9de819fea
2018-01-10 08:39:19 -08:00