Commit Graph

51673 Commits

Author SHA1 Message Date
Mark Thomas
0822231d79 pyrenderdag: add python bindings for renderdag
Reviewed By: quark-zju

Differential Revision: D19272576

fbshipit-source-id: f79019d3506efe03675f49b9ad728582b22bd205
2020-01-06 15:00:06 -08:00
Mark Thomas
e91c6ffa7c renderdag: make test fixtures common
Summary:
Move the test fixtures into a common module, so that they don't need to be
repeated in each test.  Since each fixtures is now a struct, this also makes it
clearer what each of the items are.

Reviewed By: quark-zju

Differential Revision: D19288290

fbshipit-source-id: 394805c652592177f11ccb096b8e5e95361456e4
2020-01-06 15:00:06 -08:00
Mark Thomas
cdd0f39805 renderdag: add test case for long messages
Reviewed By: quark-zju

Differential Revision: D19288289

fbshipit-source-id: d7d7023900d4f7c8d1ed14d15217548875a349c6
2020-01-06 15:00:05 -08:00
Mark Thomas
693ca3ff6a renderdag: Use builder pattern for output renderers
Summary:
Generalize construction of output renderers (renderers that render to `String`)
to avoid duplication of options.  At the moment there is only one, but later we
may add new options.

This also allows us to construct output renderers from any renderer that
renders to `GraphRow`, which means we can create adapters that modify or
re-order the rows of the graph.

Reviewed By: quark-zju

Differential Revision: D19286350

fbshipit-source-id: a5649ca2f48e263ee24584339179655fb612d3d1
2020-01-06 15:00:05 -08:00
Mark Thomas
213b3f086c renderdag: add a DAG rendering crate
Summary:
A new implementation for rendering DAGs.

This new crate implements a generic DAG renderer, that can convert a
topologically sorted sequence of DAG nodes into a sequence of strings suitable
for rendering to a terminal.

The new renderer differs from the old renderer in a few important ways:

* It prioritizes keeping commits linear, and will allow gaps to form if
  that will allow the history of the commits to be kept in a straight
  line.  This makes it easier to track long parallel histories.

* It supports octopus merges (nodes with more than two parents).  Even
  though Mercurial doesn't support octopus merge commits, summary DAGs
  with omitted nodes can still end up with logical octopus merges.

* It supports reservation of columns for specific nodes.  This can be
  used to support smartlog-style indentation of draft stacks without
  needing to hack around it by creating fake nodes.

* It separates out forming the graph from generating the lines.  This
  allows multiple back-ends for generating different styles of graph.

There are three back-ends implemented:

`AsciiRenderer` renders similar to the old graph renderer, using ASCII
characters.  For example:

```
  o  F
  |
  | o  E
  | |
  | | o  D
.-----'
o | |  C
+---'
o |  B
:/
o  A
```

`AsciiLargeRenderer` uses larger ASCII blocks to give a clearer picture of
complex graphs.  For example:

```
   o   F
   |
   |
   |  o   E
   |  |
   |  |
   |  |  o   D
  ______/
 / |  |
o  |  |   C
| ___/
|/ |
o  |      B
: /
:/
o   A
```

`BoxDrawingRenderer` uses Unicode box drawing characters to give a more
continuous rendering of the graph, however requires support for these
characters in the terminal font.  For example:

```
  o  F
  │
  │ o  E
  │ │
  │ │ o  D
╭─────╯
o │ │  C
├───╯
o │  B
├─╯
o  A
│
~
```

Reviewed By: quark-zju

Differential Revision: D19272579

fbshipit-source-id: bb6fa4685c965544cc3b6b9261df3a3ec161b41f
2020-01-06 15:00:04 -08:00
Jun Wu
8e3a606106 graphql: do not error out if signal_summary is None
Summary:
This can happen for "Reserved" diffs.

Reported By: hyr

Differential Revision: D19270860

fbshipit-source-id: 24e9b8c08fc16e3089e0dc3f8064a5e9671d9ace
2020-01-06 14:27:43 -08:00
svcscm
ffdc02c183 Updating submodules
Summary:
GitHub commits:

efc66e197a

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b4e1ff8d4409400d89031a8aa6943db5b2a573bc
2020-01-06 12:59:54 -08:00
Genevieve Helsel
a03dac0a83 reactivate test_abort_split_with_pending_add
Reviewed By: chadaustin

Differential Revision: D19167578

fbshipit-source-id: fa2c848a4e157bcf9c466b4b65132168201e4d97
2020-01-06 08:52:27 -08:00
Genevieve Helsel
26f4427200 add eden debug parents
Summary: adds a cli debug command to inspect the working copy parent. by default just returns eden's snapshot contents, but adds optional --hg flag to print Mercurial's dirstate information

Reviewed By: chadaustin

Differential Revision: D19167518

fbshipit-source-id: b65e112df6abe4e0e7a8a528a90b2e3d17297e66
2020-01-06 08:52:27 -08:00
svcscm
3a5f7cd348 Updating submodules
Summary:
GitHub commits:

9f739b3865

Reviewed By: zpao

fbshipit-source-id: f4c4ed231764c93c7ac45a84064f3735c797fbed
2020-01-06 08:52:27 -08:00
svcscm
354a856e13 Updating submodules
Summary:
GitHub commits:

ca78b4cec2
25f36d9487
8d6dad4233
23add38cf9
879d0b4d3d

Reviewed By: zpao

fbshipit-source-id: 9f1d21d12f45142939a38d598edac08727545369
2020-01-05 22:22:10 -08:00
svcscm
edf5f7d718 Updating submodules
Summary:
GitHub commits:

f2a603d2df
323a2bc3e5
04c07965ef
c179d38294
6fac956f22

Reviewed By: zpao

fbshipit-source-id: 558f35dbf1adb3b45179629c61d77488e441d4e3
2020-01-05 16:22:33 -08:00
svcscm
694ffecfc9 Updating submodules
Summary:
GitHub commits:

72178dba37

Reviewed By: zpao

fbshipit-source-id: 293b782d0ed2758e236220912a322214e7191414
2020-01-04 17:25:47 -08:00
svcscm
e7a3a9e49f Updating submodules
Summary:
GitHub commits:

8c7c0e201e
b84db9a971
0524fa0b36
2df7b2ba54
80553514ed
4eb66bc7aa

Reviewed By: zpao

fbshipit-source-id: 97d0605beabcfc15236038215208acf034f8eba4
2020-01-03 17:06:25 -08:00
Jon Maltiel Swenson
cc1a7ddcde Kill rsocket server stack
Summary: This stack is deprecated in favor of the rocket stack.

Reviewed By: rhodo

Differential Revision: D18123600

fbshipit-source-id: db6e3bf4add9c49cf8f1d2f12f97b207e87c7302
2020-01-03 15:53:10 -08:00
svcscm
95b8dde266 Updating submodules
Summary:
GitHub commits:

94e22ff147
d818f91cc6
411e289794
f8995818ce
34b6dfdf8f
83957dc510
95578decbf
19808a511d

Reviewed By: zpao

fbshipit-source-id: 51d1c1bb4b17a302b4fe1be0b36f9f29b25d017a
2020-01-03 14:36:44 -08:00
Jun Wu
a97842c8c2 fbscmquery: fix globalrev graphql query
Summary: `"globalrev"` is invalid. Use `GLOBAL_REV` instead.

Reviewed By: singhsrb

Differential Revision: D19271059

fbshipit-source-id: c26347b92b1b92a5f958f2f71dbdfdf3635a0876
2020-01-03 12:40:04 -08:00
svcscm
cce18eb482 Updating submodules
Summary:
GitHub commits:

a5048c8f19

Reviewed By: zpao

fbshipit-source-id: c6960b011747963548caae6275fdd9c070b783fc
2020-01-03 10:29:19 -08:00
svcscm
7e24f0f737 Updating submodules
Summary:
GitHub commits:

212c6d0aaa
ed1fe9f267

Reviewed By: zpao

fbshipit-source-id: 8520bfadc1ae1a8b007f9363e61c1a4aef617890
2020-01-03 10:29:19 -08:00
svcscm
f9eb69f100 Updating submodules
Summary:
GitHub commits:

3fb718407d
09634ef57a
8f520a0228
7c98d71567
36e454b275
b1cc91a499
603238265c

Reviewed By: zpao

fbshipit-source-id: 4b8a80327e1e62b7f507d3ea38023dac22921926
2020-01-02 18:52:20 -08:00
svcscm
51eea50c8a Updating submodules
Summary:
GitHub commits:

123ae291fc
b9e9d4f7d9
86ea03e727
1cd1bfb668
917504ac42
06cc652030
e63819cbe3
6d21d8cfd3
b636829d55
19d0faece2
9860344e10

Reviewed By: zpao

fbshipit-source-id: 1de7509af788dc7861cfc779936fbc9e0146a5a5
2020-01-02 18:52:19 -08:00
svcscm
e348dbd6be Updating submodules
Summary:
GitHub commits:

c3da1769aa
dc5d27c6b2
6f6f6fdd20
99642ef23b
506f80638d
267ff5b58e
0d9f8b35f8
4cac5847b4
cbf71eab61

Reviewed By: zpao

fbshipit-source-id: 10e4e08f4a0cfb473d81336d5040bc18515bc35d
2020-01-02 12:51:34 -08:00
Lukas Piatkowski
0e13cf88dc rust-shed: move stats to the shed
Summary: This change also introduces a dummy no-op stats implementation for non-fbcode builds.

Reviewed By: farnz

Differential Revision: D19193954

fbshipit-source-id: f513368a2387987bf129ddf935217c90b7c84f2a
2020-01-02 11:10:59 -08:00
svcscm
5cb6809133 Updating submodules
Summary:
GitHub commits:

96c62e344d

Reviewed By: zpao

fbshipit-source-id: a1ccbee192f5528b479caa34f89192198a6cc73f
2020-01-02 11:10:59 -08:00
svcscm
7a095941a6 Updating submodules
Summary:
GitHub commits:

f9956e1c40
0952dd21c4

Reviewed By: zpao

fbshipit-source-id: 8b64c48584529c36b944ad7009d17f269c3888d9
2020-01-01 17:22:24 -08:00
svcscm
be6ec9e2f0 Updating submodules
Summary:
GitHub commits:

ee33267833
edbf08b464
d3d6888e42

Reviewed By: zpao

fbshipit-source-id: a97c75a8ca92bb7149675e5e1c9370dd49255537
2019-12-31 18:22:33 -08:00
svcscm
cf690db663 Updating submodules
Summary:
GitHub commits:

7eff52a6a4
5237da1c26

Reviewed By: zpao

fbshipit-source-id: 388066dff3e81b34dab372acb33a58ec93c7cd10
2019-12-30 18:17:35 -08:00
Jun Wu
3db941beb4 phabstatus: handle JSON decode error
Summary:
Sometimes GraphQL does not return JSON result. Do not crash on the client-side.

Context:
https://fb.workplace.com/groups/scm/permalink/2565497036833234/

Reviewed By: farnz

Differential Revision: D19254348

fbshipit-source-id: 75ca93b1dc8648d5c59915ecf450b9366df13c01
2019-12-30 16:45:11 -08:00
svcscm
d7504bffa5 Updating submodules
Summary:
GitHub commits:

8502bd8dc7
a1535c3c14
68e0a1add2

Reviewed By: zpao

fbshipit-source-id: 70d60116ec81634d5b406da08334ac874db95f8c
2019-12-30 15:59:06 -08:00
Simon Farnsworth
deacaed311 Don't delete bookmarks in drawdag if there are none
Summary: In Mononoke tests, we have failures because `hg book -fd` aborts if it's not given any bookmark names. Fix up this function to not run `hg book -fd` if there are no bookmarks

Reviewed By: quark-zju

Differential Revision: D19251930

fbshipit-source-id: 2f1696d9207ad64a94c28941e72806d9b0e686fe
2019-12-30 15:41:14 -08:00
svcscm
c929ba23e7 Updating submodules
Summary:
GitHub commits:

d703b38a0c
4123e210f4
9950d3a409
6eb1e3cbcb

Reviewed By: yns88

fbshipit-source-id: 0357db2e58677adfd48b0e50860175a16a16c871
2019-12-30 15:41:14 -08:00
svcscm
a97f52df0e Updating submodules
Summary:
GitHub commits:

0bb2aba145
dfa0822a2a
b8bac00147

Reviewed By: yns88

fbshipit-source-id: 79256c20a3a31238c338b25a0091cd67e263b00b
2019-12-29 20:22:15 -08:00
svcscm
919d3f08b9 Updating submodules
Summary:
GitHub commits:

e28240f022
6544bc52f6
67fc298b69

Reviewed By: yns88

fbshipit-source-id: 327534440563702f9282f0afd48484305e1e8eb3
2019-12-29 07:22:58 -08:00
svcscm
928777ef4c Updating submodules
Summary:
GitHub commits:

897a338539
9266e6d584

Reviewed By: yns88

fbshipit-source-id: c3859b3d5251bbd36460c45e7ffe58d5d70e8f1c
2019-12-28 13:22:46 -08:00
svcscm
b54e2d8855 Updating submodules
Summary:
GitHub commits:

f60ae87f1b

Reviewed By: zpao

fbshipit-source-id: b70978e22c873eebc8e938c75cb74bd01744d4b8
2019-12-27 16:22:44 -08:00
svcscm
00314c37c9 Updating submodules
Summary:
GitHub commits:

1795752a8f

Reviewed By: zpao

fbshipit-source-id: 3dd36d81ed63e8fea65dab929c4867ada381c94e
2019-12-26 17:22:58 -08:00
svcscm
c7c13ca1c7 Updating submodules
Summary:
GitHub commits:

1702a53f74

Reviewed By: zpao

fbshipit-source-id: 584b98b2171079c3c2bdeb5fdb59bd7c9233ab89
2019-12-25 22:24:30 -08:00
svcscm
d2c411433b Updating submodules
Summary:
GitHub commits:

7e50dc4814
cffede7584
c9851f2ebd
579e49bb6a
2fc9d7b729
aee75f8150
b871922bf6
dd261dfb81

Reviewed By: zpao

fbshipit-source-id: 28bb24af4eabdf017026879ac4991a4a84d99bb7
2019-12-24 23:22:32 -08:00
svcscm
4bfa0c5ade Updating submodules
Summary:
GitHub commits:

a5325e50c7

Reviewed By: zpao

fbshipit-source-id: 3acac5e117d90b2c2de968a6880f0c18aeeca590
2019-12-24 21:22:34 -08:00
svcscm
aa1144005a Updating submodules
Summary:
GitHub commits:

a6a87383a0
2b38127267
5e7152ddfd
f519c88f80
5c4a5b59df
6455ab0d93
37fd2b9694
058608f66d
0109931f0f
41f33e8c3c
9dae0abe05

Reviewed By: zpao

fbshipit-source-id: b22ab3b7c0bb4f3c0317a09354532b0d05246ce2
2019-12-23 21:17:47 -08:00
Adam Simpkins
e45e2c6f9a unbreak dirstate.status() in EdenFS repositories
Summary:
D19190259 broke `dirstate.status()` in EdenFS checkouts.  Fix the code to
properly check if the dirstatemap supports `nonnormalsetfiltered`

Reviewed By: quark-zju

Differential Revision: D19221147

fbshipit-source-id: 17f69f5b461467bfb67858fb21dc0230b928a740
2019-12-23 16:44:12 -08:00
Jun Wu
c214a2de9e test-profile: fix the test
Summary: Use `debugpython` to replave `python`

Reviewed By: akushner

Differential Revision: D19221125

fbshipit-source-id: 68f5d83f9abe38174492fdaaf7496875696c4302
2019-12-23 16:37:10 -08:00
Jun Wu
3170aa7cbc test-parse-index2: remove the test
Summary:
The test is broken by D19190496 because the test uses some weird test cases
about legacy Pythons.

The "parseindex2" test is revlog-related. The revlog is kind of stable, tested
indirectly in countless tests, and is also going away. We don't run the code
on legacy versions of Pythons.The "parseindex2" test does not provide much
value. Therefore just remove it.

Reviewed By: akushner

Differential Revision: D19221126

fbshipit-source-id: 5b904d97caa47f92098435ee85c1bb8b725c9f84
2019-12-23 16:37:10 -08:00
Jun Wu
9d36855838 bindings: add hgtime
Summary:
This makes it possible to use the hgtime parsing utilities in Python.
Namely, patterns like `since 6 days ago to now` can now be parsed.

Reviewed By: sfilipco

Differential Revision: D18946335

fbshipit-source-id: c12ea3437301f20a8c457525c0798f471b8f174a
2019-12-22 11:27:33 -08:00
Jun Wu
624e47ac1c hgtime: add a way to change "now" for testing
Summary:
The existing tests rely on this feature.
This requires replacing all `Local::` usage with `HgTime::now()`.

Reviewed By: sfilipco

Differential Revision: D18946336

fbshipit-source-id: 1a92183cc96f2fcb013b68a32e78f09f28a49452
2019-12-22 11:27:33 -08:00
Jun Wu
8812c8c97d hgtime: fix bounds of "a to b" range
Summary:
For example, `2018 to 2019` should be parsed as `2018-1-1 to 2019-12-31 23:59:59`,
not `2018-1-1 to 2019-1-1`.

Fix it to match the desired behavior.

Reviewed By: sfilipco

Differential Revision: D18946331

fbshipit-source-id: 640bbe49352d1f01855183ea9927bb0009646243
2019-12-22 11:27:33 -08:00
Jun Wu
c624847c84 hgtime: limit year in 1900 to 9999
Summary:
The Python `datatime` stdlib has limitations:

- `datetime.datetime` can only express year 1 to 9999.
- `strptime` requires year >= 1900.

Limit the `HgTime` to 1900 ..= 9999 range to be consistent.

Note: Mercurial has an `i32` range limit, which seems to problematic
since `i32::MAX` is Jan 19, 2038. So I kept using `i64`.

This addressed some XXX comments about not returning errors.

The code change is mostly because added error handling.

Reviewed By: sfilipco

Differential Revision: D18946333

fbshipit-source-id: 0e4756457b0f13451dc5008ef19d4670a7aaa7fb
2019-12-22 11:27:32 -08:00
Jun Wu
5c7acfc1ca dag: add a NamedDag that keeps Dag and IdMap consistent
Summary:
It turns out the interaction between dag and idmap can be complex, especially
when a non-master id gets re-assigned a master id.

A high-level structure is helpful here to handle the corner cases correctly.

This diff adds basic definitions, and one of the most complex function - build.
The build function is ported from pydag.

Reviewed By: sfilipco

Differential Revision: D18838994

fbshipit-source-id: a2f6db3b188d5fd04d8e1d6df40ba985e33281f6
2019-12-22 11:27:32 -08:00
Jun Wu
61e0f06417 dag: add ways to remove non-master ids in Dag and IdMap
Summary: First step to implement segment and idmap rewrites for non-master ids.

Reviewed By: sfilipco

Differential Revision: D18838996

fbshipit-source-id: 0380c0193d9078a2a2d7fde9c5f565e8dbc8e713
2019-12-22 11:27:32 -08:00
Jun Wu
784da69352 indexedlog: support efficient index deletion by prefix
Summary:
The index can delete all keys matching a prefix more efficiently than deleting
them one by one. Expose this feature.

The `dag` crate will use this feature to delete all "non-master" segments and
ids efficiently.

Reviewed By: sfilipco

Differential Revision: D18825296

fbshipit-source-id: b8531695609238a16913254af61004170f12954e
2019-12-22 11:27:31 -08:00