Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.
This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.
Reviewed By: ikostia
Differential Revision: D15030253
fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
Summary:
This is a requirement to enable Phabricator migration to a globalrev
based repository. The release engineering team has also expressed interest in a
faster way to lookup the commits using globalrev.
I am just using indexed log for now to enable faster lookup. We might not need
to backfill the indexed log since we mostly care for the newer commits. But if
we do need to, we can do it later.
Reviewed By: quark-zju
Differential Revision: D14687707
fbshipit-source-id: fe02e9a72b9edb57cfd49a294642014c7204c058
Summary:
We need a configuration option for specifying the starting revision
beyond which we will consider the global revisions associated with the commit
valid for the following reasons:
- It lets us have the flexibility to support `globalrevs` from a commit of our
choice.
- We need this configuration to decide when we should fallback to looking at
the `svnrev` instead of the `globalrev`.
Reviewed By: quark-zju
Differential Revision: D12888966
fbshipit-source-id: 46d6314886ed5074edb537ba340d5606ec354619
Summary:
RocksDB and InnoDB are highly compatibile. There is no need to test RocksDB
engine for every hgsql related tests. Only use rocksdb for 2 of the tests.
Reviewed By: phillco
Differential Revision: D10055068
fbshipit-source-id: f9b7ef546fe7d457b0390e49014ebbe56d3c12c1
Summary:
The next patch will change pushrebase code path so it does not have to go
through pushrebase._commit. Change globalrevs to wrap the lower-level
repo.commitctx to make sure commits have global revs assigned. Pushrebase
and hgsubversion wrappers are removed accordingly.
This also affects "hg commit" running in the server-side repo. Therefore
the test is changed to keep the change minimal.
It's also incorrect to reset the next revision counter at `repo.invalidate`.
It should only be reset at transaction abort. The original concern was
to get an up-to-date view of the revision number. Doing it in `repo.invalidate`
is risky. Enforce hgsql lock when reading the number to make it safer.
As we're here, change the transaction code so it does not wrap `_abort`
unnecessarily for nested transactions.
Reviewed By: singhsrb
Differential Revision: D10023541
fbshipit-source-id: 82d4b57dc2eafa8bc3cdf553e891db6e8c5ff741
Summary:
This commit adds a way to run the `globalrevs` extension only in read
only mode. This is useful in cases where repository `x` pulls from repository
`y`, both the repositories have `globalrevs` and `hgsql` enabled, we only
want to embed `globalrevs` in the commits for repository `y`, and we want to be
able to read the `globalrevs` in repository `x`.
Reviewed By: phillco, quark-zju
Differential Revision: D9978146
fbshipit-source-id: b9530e8e9cfadc28e2cd30e51649cee9e6e144bf
Summary:
In the current implementation, the `globalrevs` extension complains if
the `hgsql` extension is enabled but bypassed. This creates issues in cases
where the `hgsql` extension is bypassed intentionally as in D5012225. This
commit changes the logic in `globalrevs` extension to not wrap any extensions
if the `hgsql` extension is bypassed intentionally instead of raising an
exception.
Reviewed By: quark-zju
Differential Revision: D9883231
fbshipit-source-id: c57eaad4f661b69752a6457e6ecdd43f377285c1
Summary:
We need to look up commits in the repository based on the strictly
increasing global revision numbers. This commit adds the following way of doing
so:
- `m<number>`: `hg log -r m<number>` would match the commit having `number` as
the strictly increasing global revision number.
Reviewed By: quark-zju
Differential Revision: D9764819
fbshipit-source-id: b9d3a80852c7acebd0c939a4d4f43c3c9a6cb0ab
Summary:
We need to look up commits in the repository based on the strictly
increasing global revision numbers. This commit adds two ways of doing so:
- `globalrev(number)` revset: `hg log -r 'globalrev(number)'` would match the
commit having `number` as the strictly increasing global revision number.
- `m<number>` stringset: `hg log -r m<number>` would also match the commit
having `number` as the strictly increasing global revision number.
Reviewed By: quark-zju
Differential Revision: D9756146
fbshipit-source-id: db9ecf8f8244634d71957ddb645dfda675cab662
Summary:
We can have situations where using the repository name from the
`hgsql.reponame` configuration as key for `globalrevs` data in the database can
lead to issues. As an example, for some repo `x`, we usually have a
`x-from-svn` Mercurial repository which gets the commits from svn and then
repository `x` pulls that data from `x-from-svn`. In such a setup, the
`hgsql.reponame` is usually set to `x-from-svn` for the corresponding
repository and similarly for the repository `x`. For the purpose of getting rid
of the backing Subversion repository, we will need to use the `globalrevs`
extension in the `x-from-svn` repository and it makes sense for us to have the
repository name as `x` from the beginning instead of `x-from-svn` from a
`globalrevs` perspective.
This commit just allows specifying a custom repository name to help with
aforementioned situation.
Reviewed By: quark-zju
Differential Revision: D9372695
fbshipit-source-id: 080e08a4a3ab3a4ba7a213e5177e40deb5dd5d88
Summary:
As an intermediate step in conversion of the `WWW` repository to being
an Mercurial only repository, we will be modifying the `hgsubversion` extension
to start supporting `globalrev` in the commits pulled from the source
Subversion repository.
The `globalrevs` extension needs to allow for creation of commit through means
other than pushrebase for this process to succeed. Therefore, let's introduce a
configuration option for this purpose.
Reviewed By: quark-zju
Differential Revision: D8925894
fbshipit-source-id: ecb253828c0801c1c39f57ccaf2e11992a924e63
Summary: See the commit content itself for the details on the testing.
Reviewed By: quark-zju
Differential Revision: D8695360
fbshipit-source-id: c7d4bb85a1c5ec3648a00e171b3ad592066d5daf
Summary:
This commits just adds some tests for the `globalrevs` extension. See
the commit content itself for the details on the testing.
Reviewed By: DurhamG
Differential Revision: D8364382
fbshipit-source-id: f32b9fedd70f5f8ad40a034ce0d28867f9d1bdb4