Commit Graph

7 Commits

Author SHA1 Message Date
David Budischek
43f060988c Prevent deletion of configured bookmarks
Summary: Bookmarks that are set to be non fastforward moveable should also not be deleteable

Reviewed By: StanislavGlebik

Differential Revision: D14420457

fbshipit-source-id: a10231466350c0b25437972c66472b46044fc625
2019-03-18 04:12:09 -07:00
David Budischek
2a93fe345c Block non fastforward bookmark moves
Summary:
This is a hook in mercurial, in Mononoke it will be part of the implementation. By default all non fastforward pushes are blocked, except when using the NON_FAST_FORWARD pushvar (--non-forward-move is also needed to circumvent client side restrictions). Additionally certain bookmarks (e.g. master) shouldn't be able to be moved in a non fastforward manner at all. This can be done by setting block_non_fast_forward field in config.

Pushrebase can only move the bookmark that is actually being pushrebased so we do not need to check whether it is a fastforward move (it always is)

Reviewed By: StanislavGlebik

Differential Revision: D14405696

fbshipit-source-id: 782b49c26a753918418e02c06dcfab76e3394dc1
2019-03-18 04:12:09 -07:00
Jeremy Fitzhardinge
32330eb699 mononoke/bundle_resolver: remove unused lazy_static dep
Reviewed By: zertosh

Differential Revision: D14422817

fbshipit-source-id: a9cc62353e1f07211576d8a1d20d2c439dd1fdb8
2019-03-12 17:30:30 -07:00
David Budischek
a76d7c1cdd Log pushrebase commits to scribe
Summary:
Currently we are logging new commits from BlobRepo. This will lead to issues once CommitCloud starts using Mononoke as we cannot differentiate between phases at that level. The solution is to log commits when they are pushrebased as this guarantees that they are public commits.

Note: This only introduces the new logic, cleaning up the existing implementation is part of D14279210

Reviewed By: StanislavGlebik

Differential Revision: D14279065

fbshipit-source-id: d714fae7164a8af815fc7716379ff0b7eb4826fb
2019-03-12 04:50:45 -07:00
Stanislau Hlebik
d4e93edae5 mononoke: add copy/rename sources to list of conflict files in pushrebase
Summary:
Copy & rename sources must be included in the list of conflict files so that if
a copy was modified between root and `onto` bookmark then pushrebase should
fail with conflicts.

Note that some some merge cases are not handled yet - see TODO in the code

Reviewed By: lukaspiatkowski

Differential Revision: D14322036

fbshipit-source-id: d69bcceaa24987dd1e9d67e77f6a3205b580a7d8
2019-03-11 05:18:31 -07:00
Stanislau Hlebik
816305f75a monononoke: earlier merge detection in pushrebase
Summary:
Mononoke does not support pushrebasing over a merge commit. Previously
`find_closest_ancestor_root` didn't detect merges.
In cases like

```

o <- onto
|
o   o <- commit to pushrebase
|\ /
| o
o  <- main branch
...

```

`find_closest_ancestor_root` would go to the main branch and finally fail with
`RootTooFarBehind` error. By detecting merge commit earlier we could print
better error message and avoid doing useless traversal

Reviewed By: lukaspiatkowski

Differential Revision: D14321616

fbshipit-source-id: 2aa53a2627f25897a241616a429864f1cfca3100
2019-03-11 04:20:32 -07:00
Kostia Balytskyi
e561682ecd mononoke: rename crates to contain underscores instead of dashes
Summary: Let's not use dashes in crate names.

Reviewed By: StanislavGlebik

Differential Revision: D14341596

fbshipit-source-id: 85a7ded60cf2e326997ac70ee47a29116af97590
2019-03-06 07:18:28 -08:00