Commit Graph

8 Commits

Author SHA1 Message Date
Saurabh Singh
b0e2154df6 globalrevs: add revsets to look up based on global revision numbers
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
2018-09-11 15:22:26 -07:00
Saurabh Singh
dd05a83d7f globalrevs: use absolute imports
Summary:
This is just a refactor to use absolute imports instead of relative
imports.

Reviewed By: quark-zju

Differential Revision: D9728876

fbshipit-source-id: 88853a7015965bc4e20ea4c6d9cab30864435eaf
2018-09-07 16:56:38 -07:00
Saurabh Singh
743490c386 globalrevs: allow specifying custom repository name for globalrevs
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
2018-08-16 16:21:25 -07:00
Saurabh Singh
c5a2f465ca globalrevs: support global revs for commits created using hgsubversion
Summary:
This commit enables embedding global revisions in commits created via
the `hgsubversion` extension.

Reviewed By: quark-zju

Differential Revision: D8925897

fbshipit-source-id: 17f320dd7b6ca560acb78ba8e5ee26a8a3a6b045
2018-07-23 18:53:16 -07:00
Saurabh Singh
6abe49da8c globalrevs: allow making commits without using pushrebase
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
2018-07-23 12:58:58 -07:00
Saurabh Singh
b8c1e8b8eb globalrevs: use configitem for configuration defaults.
Summary:
This commit just uses the `configitem` to specify the default for the
configurations items relating to `globalrevs` extension.

Reviewed By: quark-zju

Differential Revision: D8925901

fbshipit-source-id: 6d4cf10a2e623b94d3a94eeb1f411d784374a4d5
2018-07-23 12:58:57 -07:00
Saurabh Singh
b5146cfbfe globalrevs: only wrap pushrebase commit logic if repository is on server
Summary:
Rather than having a comment which specifies that this code path won't
be hit on the client, it's probably better to only execute the new code if the
repository is on the server.

Reviewed By: quark-zju

Differential Revision: D8925902

fbshipit-source-id: 9404ad9e33f95f580d04d5aa3d40225ecc1dc7b4
2018-07-23 12:58:56 -07:00
Saurabh Singh
1f24212cb0 globalrevs: introduce extension for strictly increasing revision numbers
Summary:
With the `globalrevs` extension enabled, Mercurial starts adding a
strictly increasing revision number to each commit which is accessible through
the `globalrev` template.

Reviewed By: DurhamG

Differential Revision: D8364387

fbshipit-source-id: 84bd43f56b9cb1c775cffb875501dd64d10ffa42
2018-06-28 08:19:22 -07:00