Summary:
When using the `debugedenimporthelper` subcommand that is part of `hg` itself
it is much more important to make sure that we don't try to use `stdout` as
the import communication mechanism.
The old `hg_import_helper.py` script more carefully set up its own `UI` object
to try and avoid ever printing any messages to `stdout`. However it isn't
easily possible to do this as part of the normal `hg` program. Therefore
abort the command if `hg debugedenimporthelper` is ever run without an
`--out-fd` argument.
This also helps avoid potentially confusing users by printing binary data to
stdout if they invoke accidentally `hg debugedenimporthelper` interactively in
a terminal.
Reviewed By: chadaustin
Differential Revision: D14222372
fbshipit-source-id: 7e0829dff41b2bca28c7f4539b90c6c354f8c79f
Summary:
This starts to fix some of the `hg debugedenimporthelper` behavior and make it
work more like most other hg subcommands with respect to how it finds the hg
repository.
Previously the code was copied into hg largely as-is from an external script
that took the repository path as a separate argument. This resulted in
confusing behavior as it completely ignored the normal repository object
opened by `hg`.
This makes `debugedenimporthelper` honor the normal hg repo object if the
extra repository path argument is not specified.
Reviewed By: chadaustin
Differential Revision: D14222323
fbshipit-source-id: 57048178b588dd1dd7150184665d6c13427d6b56
Summary: `AsRef<Path>` is more ergonomic than `&Path` since the former can accept `PathBuf`, `String`, etc.
Differential Revision: D14223167
fbshipit-source-id: 12d26adaa63855c339e04734c19d6697624f9c9e
Summary:
When the pack directory is missing, os.listdir will throw an OSError. Instead
of failing repack, let's just ignore the error.
Reviewed By: singhsrb
Differential Revision: D14234830
fbshipit-source-id: 14e683b7d850ab316d9821031e91a19e5f2f4c1e
Summary:
Instead of falling back to python, we should just skip the current repack. The
python code already does this, but the rust one will report the error to the
user (and scuba).
Reviewed By: singhsrb
Differential Revision: D14234831
fbshipit-source-id: d285499ae85205d6ccee3c22eb50352d77673488
Summary:
The order of imports we're trying to follow is: std, remote crates
(ie: crates.io), local crates (ie: fbcode crates), and crate local. A new line
in between each group can be used to prevent rustfmt from re-ordering them.
Reviewed By: singhsrb
Differential Revision: D14243163
fbshipit-source-id: fbbb07693af14b13ae6b3f4e788972d99193fd64
Summary:
The order of imports we're trying to follow is: std, remote crates
(ie: crates.io), local crates (ie: fbcode crates), and crate local. A new line
in between each group can be used to prevent rustfmt from re-ordering them.
Reviewed By: singhsrb
Differential Revision: D14243162
fbshipit-source-id: 6fc2cceb3d6834b602be20b8b8f74e0f61b227e1
Summary:
This diff focuses on addding deserialization. Because the most effective way
of testing deserialization is doing round-trip conversions we also implement
serialization.
`manifest::tree::store::Entry` is the structure that is in charge of perfroming
serialization and deserialization. We update the Store trait to interface with
this new object.
Differential Revision: D14178264
fbshipit-source-id: bb12262c181a518ba4111d40c079d6836ec44301
Summary:
The `once_cell` crate is more flexible than `lazy-init`. It has more types,
a richer api, recent updates and more features.
Differential Revision: D14232727
fbshipit-source-id: 14aeb34a96e094069bb8dc3fb5efcf5b5707ce8c
Summary:
When pushing an empty commit, the server receives a pack part with no
data, which ends up not producing any pack files. Some newly added logic tries
to access the pack paths, which then crash.
Let's fix it so we get None for the paths in this situation, and update the only
consumers of those paths to handle the None case.
Reviewed By: quark-zju
Differential Revision: D14237452
fbshipit-source-id: 418bd30179fdb76b9de3bc2c2509079502edfef8
Summary:
Fix lint errors involving unused imports and variables. In some cases we are
relying on the side effect of importing, so tag these with the appropriate
noqa flag.
Reviewed By: ikostia
Differential Revision: D14241398
fbshipit-source-id: b639af47c563f914a54188af48f1f9100442d08f
Summary:
The Rust entry point has an incorrect `sys.executable`. Workaround it with a
hard-coded `python2` for now.
Differential Revision: D14236437
fbshipit-source-id: 97d99d59365c2d5c70bfdeebc66b51f870073ded
Summary:
We need to ensure that memcommit is executed with the hgsql lock if
the `hgsql` extension is enabled.
Reviewed By: DurhamG
Differential Revision: D14177416
fbshipit-source-id: dcabf08003b618579461c608f924fe7f5b796c37
Summary:
The `memcommit` command output will be processed by the calling
process and therefore, let's just output JSON for easy consumption.
Reviewed By: quark-zju
Differential Revision: D14177417
fbshipit-source-id: 541cf73fa2bef20512164b43f1c4224415fba596
Summary:
This commit introduces the `memcommit` command to allow creation of
commits without a working copy.
Reviewed By: quark-zju
Differential Revision: D14177415
fbshipit-source-id: 518d29e2fe8fcc7e74d10ec22ebfcd22e136da06
Summary:
We will be relying on `pushrequest` to create commits to the
repository without a working copy using the `memcommit` command that will be
introduced in D14177415. Therefore, lets introduce a class method for creating
a pushrequest based on memcommit parameters.
Reviewed By: quark-zju
Differential Revision: D14177413
fbshipit-source-id: fe326e1e2908724b81a95fbf13a05163fb435ada
Summary:
Calculating the file conditions will be a common operation for any
class method which creates the pushrequest object as in D14177413. Therefore,
it makes sense to segregate this functionality.
Reviewed By: quark-zju
Differential Revision: D14177414
fbshipit-source-id: d57919098f372a9cbed13f59e3d3c4e3cc7a0b55
Summary:
This is certainly not required while creating new commits using
stackpush. Therefore, let's change the code to make this optional. See
D14177415 for an example of when specifying the date is not required.
Reviewed By: quark-zju
Differential Revision: D14177422
fbshipit-source-id: 6a8c5bcf8a01d79c46bc4fe1b4cca8ec16f7f0c2
Summary:
Change the message about limiting the number of backup heads to only print
when actually performing a backup. Previously it was printed by anything that
used the `notbackedup()` revset predicate, which could cause it to be printed
in `hg log` commands in the middle of normal log template output.
e.g.:
$ hg log -r. --graph -T'{node} {sl_backup}\n'
@ backing up only recent 50 heads
| ffc89f60162956497cd9e8e33798dd1d63ddd1da
~
This diff also changes the behavior to print the message to stderr rather than
stdout (using `ui.warn()` instead of `ui.status()`).
Reviewed By: quark-zju
Differential Revision: D14212701
fbshipit-source-id: ef3636850d8149cb0c1931b84b9a5b45e60f89c7
Summary:
This commit introduces the `memcommit` extension along with the
`debugmemcommit` command. The `debugmemcommit` serializes a commit in a format
that is consumable by the command for creating commit i.e `memcommit`
introduced in D14177415. The `debugmemcommit` is mainly for testing purposes.
Reviewed By: quark-zju
Differential Revision: D14177419
fbshipit-source-id: 3a05a210986402f661d7d08902f28fd53f4bdb2d
Summary:
`push --new-branch` is very rarely used and it does not make much sense with
checkheads removed (D14179861). Remove it everywhere.
There is still [one user](https://fburl.com/t5hmcxrp) of the
`push --new-branch` flag. Do not remove it just yet.
Reviewed By: singhsrb
Differential Revision: D14212180
fbshipit-source-id: 18f80576ab6464fc36b047a8a35b339231ee9d8e
Summary:
Previously one couldn't use `sendunbundlereplay` to replay a bundle that just
deletes a bookmark i.e. sends only pushkey part. The problem was in that
`bundleoperation.gettransaction` method wasn't called and so a few hook
arguments weren't set.
In order to fix it this diff just calls this method before calling pushkey. The
solution is not clean, but I don't see much better alternatives.
Another smaller change that this diff is doing is changing sendunbundlereplay
command to require `--deleted` flag. This is just for convenience.
Reviewed By: quark-zju
Differential Revision: D14185380
fbshipit-source-id: f511dc0b9906520b7877501b37639d89ada6fc45
Summary:
We didn't process parts like `error:abort` and so we might have easily missed
an error. This diff fixes it.
Reviewed By: quark-zju
Differential Revision: D14185378
fbshipit-source-id: e68e365fd939a4bd6a0c2835a513ebc94530aa87
Summary:
This solves an issue vipannalla saw that the heuristics logic behaves incorrectly
when running `hg up -C c4a88583; hg graft 23001ead`. The file `great_persons_on_ex_civilization-inl.h`
would be marked as "unresolved" and removed from the working copy potentially
due to other mergedriver actions, while it should be merged cleanly and do not
appear in mergestate at all.
After debugging, the file was only renamed on one side, and not changed on the
other side. In the heuristics code path, the file was reported as copied and
confused the callsite.
Reviewed By: singhsrb
Differential Revision: D14195031
fbshipit-source-id: 0602fd56b75219f851c0175debfe72c4d49d652d
Summary:
This is probably not the proper fix but we're getting rid of svn too.
Remove tests coupled with named branches. Modified some critical tests (ex.
"push") so they can still pass.
Reviewed By: DurhamG
Differential Revision: D14210968
fbshipit-source-id: 62e02179b0e4745db8f90f718613afad42d7376a
Summary:
In some cases, a user has a badly configured ssh config which leads to
unexpected errors when running hg pull. Collecting the ssh config should help
us catch what is wrong.
Reviewed By: sfilipco
Differential Revision: D14189702
fbshipit-source-id: 73fff933987bcc95f23795c5cb6beee54ae2f141
Summary:
We are working on a `memcommit` extension to provide a command for
making commits without a working copy. This is required for implementing the
ScmWrite Commit API i.e. https://fb.quip.com/u5WJAx6i59Kl. The plan is that
ScmWrite service will use this command to create the commits in the repository.
This commit just introduces the data model for the memcommit.
Reviewed By: DurhamG
Differential Revision: D14177420
fbshipit-source-id: 5c5e63bfecedd71a56d9e0b27e308e1803a4dafe
Summary:
It seems these tests were not updated while fixing the branch cache.
This commits updates the test to address the test failures.
Reviewed By: quark-zju
Differential Revision: D14208936
fbshipit-source-id: 6ec741886a2ef8da0feb294847757d3ae94b36ee
Summary: I think when we moved to process commits stack by stack we didn't change the timeout.
Differential Revision: D14188545
fbshipit-source-id: a01432e6aef29f7e603742f854c323996856fdda
Summary:
Move the strip extension to core. Rename the command to `hg debugstrip` as it
is not intended for use by users. Users should use `hg hide` instead.
Reviewed By: quark-zju
Differential Revision: D14185822
fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
Summary:
When receiving cloud bookmarks, if they point to a hidden/obsolete commit,
don't omit them. The bookmark will make the commit visible again.
Reviewed By: quark-zju
Differential Revision: D14183009
fbshipit-source-id: ddcb8cce6aaa1eefae93490f76c3dffeaffda21c
Summary:
`fetch` is a deprecated extension. It uses non-trivial branch-related logic.
Drop it to unblock further branch related cleanups.
Differential Revision: D14180593
fbshipit-source-id: 8288a7f0ac1ba72cf476cb78f109c71aa11c92c0
Summary:
They're no longer used. Drop them. The `branchcache` is still somehow used,
although it's basically equvilent to `{"default": heads}`.
We can probably clean it up further after detached from subversion.
Reviewed By: singhsrb
Differential Revision: D14180592
fbshipit-source-id: 45230d486f203bf3f55e89ce9eb89e6855e14e54
Summary: It's a no-op already. Drop it.
Reviewed By: singhsrb
Differential Revision: D14180595
fbshipit-source-id: 9f904b818bcf56b9d12405ca9894baa9c786801b
Summary:
All commits belong to `default` branch. Therefore `branch(x)` can be seen as
just `all()`, assuming `x` is a valid name.
This removes the only user of `repo.revbranchcache`.
In a later step, branch related features will be moved to an extension so the
code becomes separate and features are optional.
Reviewed By: sfilipco
Differential Revision: D14180594
fbshipit-source-id: 9dc52743f1b69a1838114c8c0de5fc69383dc41e
Summary:
This hardcodes several perftweaks configs that have been enabled for major FB
repos for months:
[perftweaks]
disablebranchcache = True
disablebranchcache2 = True
disableresolvingbranches = True
disableupdatebranchcacheoncommit = True
Practically, this means the branchmap is now just `{'default': heads}`. (i.e.
there are no named branches other than `default`), and branchcache is removed
(i.e. `.hg/cache` does not exist without clindex or in-repo tags).
This diff only makes easy-to-verify logic changes by assuming the configs and
removing dead code. Things can be further cleaned up. They will be done by
upcoming changes.
Most test changes are due to the fact that `.hg/cache` is no longer created.
Reviewed By: singhsrb
Differential Revision: D14179858
fbshipit-source-id: 479f7427168eb1d9614a973e273a229e50f5620a
Summary:
The tests are about HTTP bundle1 support, which is not an environment we care
about. They will break in a way that is non-trivial to fix with the upcoming
branchmap removal. There is little value keeping them. So let's just remove the
tests.
Reviewed By: sfilipco
Differential Revision: D14179859
fbshipit-source-id: 09392bb2e5c0aebc30e584ed3a6593b0b2a81089
Summary:
The WSGI parameter part gets changed with the upcoming branchmap removal.
We don't have resources to maintain WSGI for now, so let's just remove the
test.
Reviewed By: singhsrb
Differential Revision: D14179860
fbshipit-source-id: b2b82f7658a754caece220fa5f80d15514dd9260
Summary:
The CVS branch support will break with the upcoming branchcache removal.
CVS repos are rare. Let's just remove the code.
Differential Revision: D14179863
fbshipit-source-id: 890ce34958d2efe4f2ef02b1d72cf92f6269378c
Summary:
We had `ui.checkheads=false` set for a long time. Let's remove the feature
entirely and update the tests.
This is necessary before killing the branch cache, as some tests still use
different branches and there would be suddently more "heads" that cause
test issues.
Reviewed By: sfilipco
Differential Revision: D14179861
fbshipit-source-id: 0de76566799a9560b45e823cc5f49cfda9e3dd30
Summary:
The checkheads feature is being removed. See D8148016 for details.
This diff just removes tests with "checkheads" in their names.
Reviewed By: sfilipco
Differential Revision: D14179862
fbshipit-source-id: abd5bb26c0d92276273bef7ea93096ca3fde95dc
Summary: Build openssl using vcpkg. Then zip its build results.
Reviewed By: kulshrax
Differential Revision: D14197306
fbshipit-source-id: 7f019f52fb93118cb7c20c95cf41aedf3a1fbefc
Summary:
The purpose of `FileMetadata` is to be a data container. Using the
`FileMetadata` implies accessing the underlying values. That means that the
underlying values need to be `public`.
Differential Revision: D14178260
fbshipit-source-id: 8b8e5ead23d47962498f991152c2a5fd94ac3c74
Summary: These implementations are going to used in quickcheck tests.
Differential Revision: D14178259
fbshipit-source-id: 0bded67deab3422b4aad53666c14cf195ea1b0d4
Summary:
`as_bytes` is useful for interacting with code that is written in reference
to a `slice` or when attempting to serialize them. It is fine to serialize
these paths using their underlying representation because we request that they
be normalized.
Reviewed By: quark-zju
Differential Revision: D14178263
fbshipit-source-id: 36529e2ae47580ae4014ae279df98b35eac5484a
Summary:
Implementing these traits allows easy use of `RepoPath` and friends in
quickcheck tests.
It is tricky to implement `PathComponentBuf`. I believe that most strings will
end up being a valid `PathComponent` so I think that it is reasonable to loop
until a valid string is found. To note generating Arbitrary Unicode `char`s is
implemented using a loop where random bytes are validated against the `char`
constructor.
Reviewed By: quark-zju
Differential Revision: D14178262
fbshipit-source-id: 759486a2053b851f8259d7cc03eee1cd69893f9f
Summary:
These constant can be useful for parsing byte streams that we expect to contain
`Node`s. These constant should replace all potential hardcoding of values that
intend to represent the byte lengths for `Node`.
Differential Revision: D14178261
fbshipit-source-id: 34471151b5d253504e32a9e8b039608c1d4943fe