Summary:
The postincoming checks prints out advice of the following forms:
* `(run 'hg heads' to see heads)`
* `(run 'hg heads' to see heads, 'hg merge' to merge)`
* `(run 'hg heads .' to see heads, 'hg merge' to merge)`
* `(run 'hg update' to get a working copy)`
This advice is no longer useful, so remove it.
Reviewed By: DurhamG, farnz
Differential Revision: D15317185
fbshipit-source-id: 50ba576406c96715fa058399da53462be9b7a3bf
Summary:
Improve logging of background backup commands by including the command that was
run and the time it was started in the background backup logs.
Reviewed By: mitrandir77
Differential Revision: D15334879
fbshipit-source-id: 932e91a43033c5cb06c79ede7b5224da2e34eb7d
Summary:
When pulling heads from commit cloud during sync, pull them in small groups
of heads from around the same time, to prevent overloading the server when
pulling a large number of heads.
Reviewed By: mitrandir77
Differential Revision: D15317184
fbshipit-source-id: 5e69eb970b18292a4f5d643b25fac80c90c5d537
Summary:
Lift determination of the correct remote path to connect to up to the top-level
command. This prevents the need to pass around the command-line `**opts` in
all of the commit cloud functions.
Differential Revision: D15295811
fbshipit-source-id: 0e14c1643bad96022c7a01126b447b2a6fcabaed
Summary:
Refactor how commit cloud sync works.
Sync is simplified by delegating backup processing to the existing backup code.
This happens first, which means the user's work is backed up earlier, and the
sync processing can assume that all backed up commits are available in the
cloud storage.
Sync no longer attempts to handle the case where cloud storage has changed.
Instead, backup processing should ensure that all local commits are backed up
to the current cloud storage.
If a commit can't be backed up, then treat this as a normal failure to
sync and ignore that commit for this sync attempt. If a commit can't be
downloaded from the server then the sync fails.
Reviewed By: mitrandir77
Differential Revision: D15295499
fbshipit-source-id: d371c5bf0daedbbe42e8c7d4a0c3d1a40c21a36f
Summary:
Move token location into the `token` module.
Move subscription management into the `subscription` module.
Move obsmarker management into the `obsmarkers` module.
Move everything else to a `util` module which can be disambiguated at import time.
Differential Revision: D15282859
fbshipit-source-id: 7f20c449fd79ffc33b069236a05fc73fac0e7d63
Summary:
The name is too long. We can disambiguate with `edenscm.mercurial.commands` at
import time if required.
Differential Revision: D15282860
fbshipit-source-id: e55357a121b583d9fd659f27dd5e2adc8a3d4d2f
Summary:
Merge the functionality of the infinitepushbackup extension (backing up commits
to commit cloud) into the commitcloud extension.
These two extensions are highly coupled, and the commitcloud extension
monkey-patches the infinitepushbackup extension for a lot of its functionality.
There is also a lot of code duplication between the two extensions which we can
remove if they are part of the same extension.
The infinitepushbackup commands (`hg pushbackup`, ...) are moved to subcommands
of the `hg cloud` command, e.g. `hg cloud backup`.
Each feature of the infinitepushbackup extension is moved to a new module
in the commit cloud extension:
The `background` module controls background execution of `hg cloud backup` and
`hg cloud sync`.
The `backupbookmarks` module tracks and updates scratch bookmarks for backups.
This will be deprecated in the future.
The `backupstate` module tracks whether or not a commit has been backed up.
This is now tracked separately from backup bookmarks in a new file:
`.hg/commitcloud/backedupheads.<remote-identifier>`. This also covers hidden
commits, preventing a re-backup of previously backed up commits when they are
unhidden.
Previously the commitcloud extension customized the smartlog annotations: `Backing up`
became `Syncing`, etc. This is now removed for consistency.
Previously the infinitepushbackup extension disabled background backup by
injecting an `infinitepushbackup.disableduntil` config entry into the user's
config. This is now replaced with a state file at `.hg/commitcloud/autobackup`.
Either option can be set to disable auto backup. Commit cloud will wait until
both have expired before starting to run background backups again.
Reviewed By: DurhamG
Differential Revision: D15276939
fbshipit-source-id: 1d28989a157286e47d3dd97ca9c70b27f692dda1
Summary:
Thin lto is much faster to compile, and doesn't make the resulting binaries
that much bigger.
Reviewed By: xavierd
Differential Revision: D15396282
fbshipit-source-id: 3e2bf059756d47218061d7e41f041e445d7f60c8
Summary:
D15381038 made the `pyrevisionstore` crate a strongly-coupled dependency of the
`bindings` crate. For simplicity, just move the code into the bindings crate.
Reviewed By: xavierd
Differential Revision: D15392547
fbshipit-source-id: 3dfa924b33722760ef7829fbb8659ce0262e6671
Summary:
This is a nice-to-have feature requested by nikz. He made an initial version
at D15029612, which changes `MatchResult` to include enough infomation to
explain a rule.
The diff reworked the feature so the runtime CPU and memory overhead stay
minimal if nothing needs to be explained. The change also makes it easier
to display more information - all rules matching a path, to make it easier
to detect and remove duplicated or conflicting rules.
Reviewed By: DurhamG
Differential Revision: D15095576
fbshipit-source-id: 5784aabd50d9b716dceead10bc593f9155228046
Summary:
After D15266191, the bindings crate directly depends on pyrevisionstore, and
since then we have seen really weird compilation errors that magically go away
when some files are touched.
From my observations, here is what I came up with. The pyrevisionstore crate is
both compiled as a dependency of the bindings crate, and as a library to be
used in python. Therefore, its Cargo.toml contains a '[lib]' section, the
presence of this section forces the crate to be compiled into a
"libpyrevisionstore.{rlib,so}", while all the regular crates have a hashed
suffix like "libedenapi-2b9975ec9b865e87.rlib".
None of this would usually matter, but our build system re-uses the build
directory to then compile the pyrevisionstore library. While doing so, it will
re-create the "libpyrevisionstore.{rlib,so}", but not in an identical fashion.
After this, the rest of the build succeeds.
Once a file in the bindings crate is touched, recompiling will only recompile
its file, and not the pyrevisionstore crate, but since
"libpyrevisionstore.{rlib,so}" is different, it now fails to compile...
A previous effort tried to compile each top level target into a separate
directory, but that directly affected some of our tests. Since the underlying
issue is that pyrevisionstore is compiled twice, let's simply not compile it as
a top-level target and simply fold it into the bindings lib. Ideally, we would
want to do the opposite, but let's do that at a later time.
Reviewed By: DurhamG
Differential Revision: D15381038
fbshipit-source-id: 047cfab794371464942f19084ffb9240e836cb40
Summary:
See the previous diff for motivation.
This diff moves the special builtin config to code so we no longer need
"data_path" for the "load_system" API.
Reviewed By: markbt
Differential Revision: D15307750
fbshipit-source-id: 15b729e6585ead5ead05ffd6ffe688387b8e0be9
Summary: When the `--shared` flag is passed to `hg root` i.e. `hg root --shared` - display the shared root of the current directory.
Reviewed By: quark-zju
Differential Revision: D15363157
fbshipit-source-id: 6e6c13f27c624502a83edc1046ae3d4de227b6b8
Summary:
See the previous diff (D15291676) for motivation. Basically, it's hard to keep
static resources work well with 3 different kinds of deployments (buck xar,
Windows zip, and python side-packages).
This diff just precomputes common styles and hardcoded them in Python code.
This should address a user complaint that `-T xml` does not work.
Reviewed By: markbt
Differential Revision: D15307457
fbshipit-source-id: de4edb0b6896b731301715abe612a31b1512b00a
Summary:
The debugrefreshwatchmanclock command opens a transaction which triggers
commitcloud background backup. This is pointless, as it doesn't actually
make any changes that need backing up.
Set ignoreautobackup to prevent the backup.
Reviewed By: mitrandir77
Differential Revision: D15354508
fbshipit-source-id: 1460ed0ac227f5918a6bf3fea6860d7d2f077d0d
Summary:
The `-` graphnode can be confusing as `-` is also used for horizontal graph lines.
There are no good ASCII characters to use for invisible commits, so revert to
just using `x` so that they match obsolete commits.
Reviewed By: quark-zju
Differential Revision: D15293717
fbshipit-source-id: 5d1f327ddd8c3f104a99f494309a79b10ad71401
Summary:
There are multiple reports that the work in the commit message editor gets lost
for various reasons. We have `.hg/last-message.txt` for commit hook failure,
but that one does not take care of all code paths (ex. metaedit).
This diff changes `ui.edit` directly to try to save messages in `.hg/edit-tmp`
for 2 weeks.
Reviewed By: kulshrax
Differential Revision: D15347831
fbshipit-source-id: 9207adf4315d94a4892685a03f323e89d9c4a7f1
Summary: We don't have the .eden/symlinks on Windows right now. Will enable this code when we have them or something equivalent working. This change would help make the hg commands that don't need to talk to Eden work. In the next diff, will teach the Thrift client how to talk to Eden and will start sending status and other requests to it.
Reviewed By: quark-zju
Differential Revision: D15341528
fbshipit-source-id: f0a6fb092f6873002f8db119f07ab884399c9bf6
Summary: Make `hg debugignore` show what gitignore rules match the files.
Reviewed By: quark-zju
Differential Revision: D15029612
fbshipit-source-id: e3621c198b9d6e3823de5587b0b859d2d0e36888
Summary:
For now, when the indexedlog is enabled, mirror all the writes done by memcache
to the indexedlog. This should give us more testing of both code path.
This will be submitted once a new hg_memcache_client build is published.
Reviewed By: quark-zju
Differential Revision: D15247640
fbshipit-source-id: 74e21731486b991dd9dcf2ce323d34e18cdeb0af
Summary:
It's a headache about how to deal with static files (help/, template/, default
config), since we have 3 different ways of packing the Python code: normal
(linux), embedded (Windows), and fbcode xar (linux). The latter two need
workarounds to make `help/` work, and for the "embedded" case, It is currently
broken.
This diff moves user-facing `help/` files to a Python module to remove the need
of special casing it in different ways.
`helptext.py` was created via:
import glob, os
for path in glob.glob('help/*.txt'):
if path.count('.') == 1:
name = path.split('.')[0]
name = os.path.basename(name)
if '-' in name:
name = 'globals()[%r]' % name
print("%s = r'''%s'''\n\n" % (name, open(path, "rb").read()))
os.unlink(path)
The help text about named branches are removed to make `test-check-help.t`
happy.
Reviewed By: mitrandir77
Differential Revision: D15291676
fbshipit-source-id: 2320bd59369ef092d8c06b8539e401799a0467ef
Summary:
Drop the "internals" help text from the UI. This is because the internal docs
are mostly outdated (ex. we're moving to new HTTP protocols and slowly removing
bundle2 formats, we're moving away from revlogs).
This diff just disabled access to them via the `hg help` command, the files are
still accessible in the repo.
Reviewed By: kulshrax
Differential Revision: D15291675
fbshipit-source-id: a6e55e0ed085bb54def3790aaaf1a92a4bfa787f
Summary: Do not try to update accessed bookmarks file if there wasn't pulled bookmarks. Currently it rewrites the file even with an empty list of bookmarks.
Reviewed By: quark-zju
Differential Revision: D15165791
fbshipit-source-id: 8eb3b137332c741324b9da9455e3d0dba31bbeda
Summary: Remotenames are shared between the shared repos. The enabled file should be stored in the same place so the config change would be consistent for all the checkouts.
Reviewed By: quark-zju
Differential Revision: D15165789
fbshipit-source-id: c08af95a6b3e5d391cdf8b3ae8ef9b8e3514dbe4
Summary:
Writes to stderr may be unbuffered. This means when `ui.write_err` is called
with multiple strings, they may end up being separated as different writes.
This causes flakiness in the test, particularly when receiving error messages
from a remote server, as depending on timings output may appear as either:
remote: abort: error message
or
remote: abort:
remote: error message
Write to the error stream in a single operation by joining all the messages together.
Differential Revision: D15316694
fbshipit-source-id: de5edf05e137d88006a0919f02f8b9cf7a17fa42
Summary:
We want to migrate the tests to run using treemanifest. As part of
that, we want to first transition to using treemanifest without actually
changing the hash, so we can check that the tests still work first, then update
the hashes second.
This diff adds the flatcompat mode and enables it by default. A future diff will
start enabling treemanifest for existing tests.
Reviewed By: quark-zju
Differential Revision: D15030252
fbshipit-source-id: 06c82be749282d62f1d9cfb43246695c427f8165
Summary:
The Hyper-based EdenAPI client proved to be problematic in practice due to various difficult to debug issues with Tokio, Hyper, TLS, and h2. We have kept it around for the time being while building out the Curl based client in case we wanted to revert back to a pure Rust solution.
Today, the Curl client works well, and future work on the EdenAPI will involve adding more functionality to it. Given that both the Hyper and Curl clients implement the EdenAPI trait, modifications to the trait involve updating both clients. So far this has been acceptable because the updates have been minor, but we would now like to add substantial new functionality to the trait (namely tree fetching), and adding this functionality to the Hyper client would take nontrivial effort.
Given that we aren't using this client at all, let's just delete it. We can always bring it back from the repo's history if we need it in the future.
Reviewed By: quark-zju
Differential Revision: D15289196
fbshipit-source-id: d9c0c3cfc5087c3e080a9919dd9e627b9657676c
Summary:
For now, only pack-file based stores implement MutableHistoryStore, but once
the trait is implemented for stores that are updated in place, returning a Path
on close will not make much sense.
Reviewed By: kulshrax
Differential Revision: D15285970
fbshipit-source-id: 011db2b60c11c1eebfe11881cfc5ebafa1676704
Summary:
While it makes sense that closing a datapack returns the path, it doesn't
really mean anything for an update in place store. Let's change the API to
return an Option<PathBuf>.
Reviewed By: kulshrax
Differential Revision: D15285969
fbshipit-source-id: 804acd75607e86a0bc875910f6aaa300a5526558
Summary: The edenapi is now independant of the storage type for history data.
Reviewed By: kulshrax
Differential Revision: D15284355
fbshipit-source-id: 72a5db42bb0fb19ee03155b13914202581ab5966
Summary:
The python mutablehistorypack can implement MutableHistoryStore, so let's do
it.
Reviewed By: kulshrax
Differential Revision: D15284357
fbshipit-source-id: e55818e2432573f0fbe4f5b73c592f7f6418785c
Summary:
The type of store where data is stored is now fully abstracted to the python
bindings. For now, edenapi will write to the pending mutabledatapack, but we
can now switch it easily to any other store implementing MutableDeltaStore,
including an IndexedLogDataStore.
Reviewed By: kulshrax
Differential Revision: D15266191
fbshipit-source-id: 638cf90a567ef170e0302376312c4b82e6d6b6da
Summary:
The python mutabledatapack is a delta store, and therefore we can implement the
MutableDeltaStore trait for it.
Reviewed By: kulshrax
Differential Revision: D15266192
fbshipit-source-id: 6cc04e4a5e792d037d17c706a374f6864a2902a9
Summary: Adds tracing for mergedriver and for the individual generators.
Reviewed By: quark-zju
Differential Revision: D15223926
fbshipit-source-id: c0c6e1a6814f59fda3ddd75eee901a60a2335c1b
Summary:
Set the `component` to `"commitcloud"` for commit cloud statuses and
messages, rather than using custom highlight functions.
Reviewed By: quark-zju
Differential Revision: D15201944
fbshipit-source-id: 7635942a5ca029209711a2b89c32cc5fd677d22f
Summary:
Add optional prefix keyword arguments to `ui.write` (and thus `ui.status`,
`ui.warn`, etc.). These prefixes can be used to indicate an error condition,
some notice to the user, or to mark a message as coming from a particular
component. The prefixes are labelled so that they can be colored to stand
out from the surrounding text. The default colors are red for errors, yellow
for notices, and cyan for components.
Add a component parameter to `error.Abort` (and thus any exception that
inherits from it) that can be used by callers to mark which component is
responsible for the exception. When the error is printed, the component is
passed as the component prefix of the error message.
Reviewed By: mitrandir77
Differential Revision: D15201946
fbshipit-source-id: 02e3da40e9563704fa1d7ce81366e6e7f66c7f34
Summary:
While closing the repo, hg_memcache_client is terminated, and later, the
pending packfiles are commited. Unfortunately, the commit phase is also when
the content of the pending packfiles will be sent to memcache, and since the
connection is at this point closed, nothing is sent then.
Reviewed By: quark-zju
Differential Revision: D15247639
fbshipit-source-id: 8719cb8bbc3c9571b9cfe250ba4be2b745e4ba15
Summary:
With the mutablestores, this code was starting to be too messy and hard to
follow. Let's simplify it a bit.
Reviewed By: quark-zju
Differential Revision: D15200748
fbshipit-source-id: 2c0cc5a4ff5057f7a9590fcc602afc2b1cc72dcd
Summary:
The `finally` block relies on this name being in scope. If the exception
happens before this name is initialized, the finally block also throws and we
loose the original root cause exception.
Reviewed By: singhsrb, HarveyHunt
Differential Revision: D15244583
fbshipit-source-id: fd8be11987c3028f775a62cb3ae308b30a9d5e75
Summary:
In a previous diff I did a last minute refactor that apparently broke a
test. I needed to update this line as well to swap the arguments.
Reviewed By: singhsrb
Differential Revision: D15219418
fbshipit-source-id: c66a2cf7bbbec80ebbbd6ca818151de5f0c2d2c5
Summary:
`visibility.add` expects to be given a list of nodes. From reset
we pass a single node which makes the underlying code break it up.
Reviewed By: singhsrb
Differential Revision: D15207234
fbshipit-source-id: 9e0dd0cc8dde0eac69d20816923b39f20963237c