Generate mercurial based webrevs from current git based jdk repo?
Erik Helin
erik.helin at oracle.com
Wed Mar 11 16:20:07 UTC 2020
On 3/6/20 3:24 PM, Jaikiran Pai wrote:
> I'm looking for inputs on whether the current state of git repos at [1]
> can be used as a source for contributing to upstream mercurial backed
> jdk repos. More specifically is the following workflow supported (and if
> it is, what are the tools to use):
>
> - Clone the github.com openjdk/jdk repo
>
> - Pick any issue or enhancement to contribute to and create a local
> feature/bug-fix branch for it
>
> - Work on the fix, commit it to that local git branch
>
> - Use some (variation of webrev) tool which will then generate a
> mercurial based patch comparing the local (git branch) against the
> latest upstream jdk repo's master branch (either git or mercurial).
> Upload this webrev to cr.openjdk.java.net for reviews.
>
> So far I've been only using mercurial repos and just creating commits
> locally on top of the "default" branch and then using the webrev tool to
> generate the webrevs. I would like to move to the git based repos if the
> above workflow is supported through some tooling.
Yep, it is :)
If you want to use Git and the read-only jdk mirror on GitHub [0] then
you need install the Skara CLI tools [1] to get the Git ports of webrev,
defpath and jcheck (you can ignore the instructions about personal
access tokens since you will only be using git-webrev, git-jcheck and
git-defpath).
Once you have installed the Skara CLI tools your workflow would look
like the following to create a webrev and send it out for review:
$ git clone https://github.com/openjdk/jdk jdk.git
$ cd jdk.git
$ git checkout -b JDK-8142314 # create a local branch for the issue
$ # hack, hack
$ git commit -m '8142314: A bugfix'
$ git webrev
$ # upload webrev to cr.openjdk.java.net
If you want to learn more about Git then we strongly recommend the
online version of the "Pro Git" book [3].
You can then send out the resulting webrev for review. Once you have
gotten reviews and are ready to push your change, then you need to use
Mercurial and a Mercurial repository to do the final push:
$ hg clone https://hg.openjdk.java.net/jdk/jdk jdk.hg
$ cd jdk.hg
$ hg apply --no-commit <URL-to-patch-in-approved-webrev>
$ hg commit # add "Reviewed-by: " etc.
$ hg push
> Of course, if/when the
> mercurial repos are moved to the git repos, we won't need the part where
> the webrev generates a mercurial patch/webrev from the git repo, so this
> is kind of stop-gap arrangement I am looking for.
Correct, but it is also a nice way to teach yourself Git and get used to
the Git commands.
Thanks,
Erik
[0]: https://github.com/openjdk/jdk
[1]: https://wiki.openjdk.java.net/display/SKARA/CLI+Tools
[3]: https://git-scm.com/book/en/v2
>
> [1] https://github.com/openjdk/jdk
>
> -Jaikiran
>
>
More information about the skara-dev
mailing list