Summary:
The phases command had some naive code that looped over every revision
in the repository. Twice. This was really slow on huge repos, so let's get rid
of the need for it.
I originally attempted to optimize it by only looking at commits greater than
the ones being passed in, but this is incorrect since changing a commit to
public may affect it's ancestors. Instead of trying to optimize it further,
let's just drop the output text entirely.
Reviewed By: quark-zju
Differential Revision: D15465942
fbshipit-source-id: ba63a1096a515032fe13a8699807fe69c73c80ed
Summary:
Previously we sorted the trees topologically before inserting them. On
a revlog-backed server, this may mean that trees are written in a different
order from the actual commits. hgsql-backed servers rely on the data being
written in linkrev order so they can be replayed in linkrev order on other
machines, so this broke hgsql replication.
Let's instead sort by linkrev, which will be both topological and satisfy
hgsql's requirements.
Reviewed By: quark-zju
Differential Revision: D15437953
fbshipit-source-id: d4aaaa03b392a6cb6cf1be478aed2583ecb757c5
Summary:
hgsql relies on all revisions being inserted in linkrev order.
Treemanifest was sorting topologically instead of by linkrev, which resulted in
possible corruption in hgsql backed servers. Let's add a test showing this.
Reviewed By: quark-zju
Differential Revision: D15437952
fbshipit-source-id: 642708d7bf76a0d0843a13f8c23b99108f05444a
Summary:
We had this disabled in a config we ship in rpms, but if we want the
tests to work in treeonly mode we want this disabled in all tree cases.
Reviewed By: xavierd
Differential Revision: D15296199
fbshipit-source-id: 0f9751583eefa10c275bd499bb5998adfbe644a4
Summary:
With treemanifest we no longer have manifest rev numbers, so let's drop
them from the templates. This let's us convert a few more tests to treeonly.
In theory automation may parse this, but I kinda doubt anyone parses the
manifest node from this.
Reviewed By: xavierd
Differential Revision: D15296141
fbshipit-source-id: a4d2194bd9604867cd9958509bcd2e6513a72494
Summary:
The test-hgsubversion-externals.py test contained string literals with significant trailing whitespace that was stripped by an editor in D15392154.
Restore the significant whitespace, and switch from multi-line string literals to a single string literal per line, to make the newlines and whitespace more obvious.
Reviewed By: krallin
Differential Revision: D15448869
fbshipit-source-id: 68444d2a31b71ab9f99927c95174a0d49e26bb06
Summary:
When syncing, if a locally-available bookmark is synced to a new commit that
has been omitted, remove the local bookmark to ensure that the next cloud sync
doesn't move the bookmark back to where it used to be.
Reviewed By: mitrandir77
Differential Revision: D15414172
fbshipit-source-id: 71aaa2d89f734e4c575c24da2c0ef6b59ca4deaa
Summary:
Add a test that shows moving a synced bookmark onto a commit which will be
omitted elsewhere causes the bookmark to be moved back.
Reviewed By: mitrandir77
Differential Revision: D15414173
fbshipit-source-id: 92dc42d1c5560fa2f5bc618d5335e21ac14d9e7d
Summary:
This hook fires for every commit that is introduced in a pull. When
doing pulls with hundreds of thousands of commits, this introduces a noticable
delay. We don't use this hook anywhere, and it's not particularly scalable, so
let's delete it.
Reviewed By: singhsrb
Differential Revision: D15424697
fbshipit-source-id: 98d76bca703e625adf5be8f6234436befd260fc4
Summary:
Let's move hgsubversion to absolute_import, just to be consistent with the rest
of Mercurial codebase.
Reviewed By: markbt
Differential Revision: D15392154
fbshipit-source-id: e4c32939aff0616790828da508f3feea158669e1
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:
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:
If the user has a bookmark pointing at an obsolete commit, and then moves that
bookmark away from that commit, commit cloud can't tell whether the commit
should really be obsolete or not. Previously the bookmark was the only thing
keeping the commit visible, but commit cloud doesn't know that.
I can't think of a way to fix this with obsmarkers. It works with separate
mutation and visibility (T34204947).
Reviewed By: quark-zju
Differential Revision: D15097845
fbshipit-source-id: 5926553b4878b28823a6ce47d29c0346cba04e5e
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:
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: 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 `-` 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:
Clean up things:
- Build scripts. They are probably broke. We have different build scripts.
- hgk. Probably broken.
- docker. We won't maintain hgweb as-is.
- Utilities from fb-hgext. They are no longer used.
Reviewed By: kulshrax
Differential Revision: D15327228
fbshipit-source-id: 3568f20ddce6b364a46d306d95279b7faaef9f82
Summary: Make `hg debugignore` show what gitignore rules match the files.
Reviewed By: quark-zju
Differential Revision: D15029612
fbshipit-source-id: e3621c198b9d6e3823de5587b0b859d2d0e36888
Summary: As a follow-up of D15338757, remove the scripts around building doc/.
Reviewed By: singhsrb
Differential Revision: D15340829
fbshipit-source-id: bc121947696aaecd574edf3d9b9b3e874037bcda
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:
I guess this was missed as part of D15291618 which intended to remove
the i18n related tests.
Differential Revision: D15301699
fbshipit-source-id: e0364e37695c60ec05f2d533903f136706661a1f
Summary:
We want to migrate the tests to run using treemanifest. As part of
that, we need remotefilelog reponame and cachepath to always be set. So let's
set that for all tests now.
Differential Revision: D15030250
fbshipit-source-id: 4147997ceebb1294deb322bdbef77b6caab18c44
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 direct motivation is the recent `ui` prefix change made `abort:`
untranslated.
The i18n translations are unmaintained. As we move more logic to Rust, things
would be worse.
I18n tests does not seem to provide much value. Therefore just remove them.
Reviewed By: kulshrax
Differential Revision: D15291618
fbshipit-source-id: 1a244ae32dc8e2f099aba46cbd45553bbb477b2c
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:
D15188668 added the `--batch` option to the `metaedit` command along
with updating the tests. Unfortunately, the test is broken on OSX. This commit
fixes the test to be compatible with OSX.
Differential Revision: D15273960
fbshipit-source-id: 57a67b9d7ab2b471ee205db4fdfc7f3e6e2e553b
Summary: Update the tests to expect the new output added by D15173846.
Reviewed By: quark-zju
Differential Revision: D15212315
fbshipit-source-id: 82bb3b4e67a28eb8905d35fcaa8251947163f521
Summary: Update the test code to return a 3-tuple as required after D15173846.
Reviewed By: singhsrb
Differential Revision: D15212317
fbshipit-source-id: 5c5ecaae858a3eaab23f624c11f0dda3ac74a870
Summary:
I wanted this feature in multiple cases. For example, I have renamed
`segdag::SegDag` to `segment::Dag`, and want to edit commit message for
`D15055347::D15055347`, a 9-diff stack. Editing them one by one is
painful.
Reviewed By: singhsrb
Differential Revision: D15188668
fbshipit-source-id: c7cc11aca0a5e16992b5246a74346a35bec00770
Summary:
This introduces `repo.sqlreporeadonlystate()`, which works similarly to `repo.sqlisreporeadonly()`, but also gets the reason why the read only state is the way it is.
The underlying goal is to use this in a repo hook to report the lock state.
I retained the `sqlisreporeadonly` function so that we don't need to synchronize deployment of this code and the underlying hook.
Reviewed By: quark-zju
Differential Revision: D15165946
fbshipit-source-id: 0a62147167fa826b575178dd261990a956b5f317
Summary:
Add support for the `unamend` command. It should use the mutation predecessors
if mutation is enabled, and update the visibility of the commits.
Reviewed By: quark-zju
Differential Revision: D15146976
fbshipit-source-id: e9ee4d26f45ba9e5c3c05a7bca80c8ac326adb9c
Summary:
We have an existing method which can capture the desired functionality
without dropping all the data in the `revision_references` table. This
primarily solves these problems:
- Reuse of code.
Reviewed By: farnz
Differential Revision: D15107057
fbshipit-source-id: 5f9970ffd13536808c1b201481b6d2015fbe8295
Summary: Added logging of a number of the currently tracked accessed remote bookmarks.
Reviewed By: mitrandir77
Differential Revision: D15080683
fbshipit-source-id: c03c417afcd24683998689365c893d9e16f265f8
Summary:
Track remote names that are used as destination for hg update.
Resolving name in the repo happens actually twice: as validation during parsing and tokenization of the given specs and actual resolving. This is still fine to update file with used bookmarks twice, because the update/pull operations are much heavy, and updating the file won't make things much slower. Implementing kind-of-cache for used remote names so we could update the file once, isn't worth it, as the feature will be temporarily enabled and won't be needed after the selective pull rollout.
Reviewed By: markbt
Differential Revision: D15048105
fbshipit-source-id: 5b03443a6ab349e3bd88613d21e7b1efdc1ff6cf
Summary:
Tracking remote bookmarks that was pulled with
```
hg pull -B <remote name>
```
All these remotenames, if they exist, will be stored in `.hg/selectivepullusedbookmarks` file.
It will allow us to estimate how much memory do we need to keep remote names in sync state in Commit Cloud and automatically mark collected remote bookmarks as "interesting" when the selective pull will be enabled.
Reviewed By: markbt
Differential Revision: D14912903
fbshipit-source-id: 3001869175553327c0840e2cfb829724dfd82893