• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Export Word
    • Attachments
    • Page Information

    Loading...
  1. Dashboard
  2. Skara
  3. Skara
  4. Mercurial

Mercurial

  • Created by Erik Helin, last modified on Sep 03, 2020

Table of Contents

Introduction

The Skara CLI tools are fully backwards compatible with the traditional OpenJDK tools for Mercurial (defpath, jcheck and webrev). That means that if you have the Skara CLI tools installed, then you can also use them for interacting with OpenJDK Mercurial repositories.

Installing

Mercurial

GNU/Linux

CentOS/Oracle Linux/RHEL
$ sudo yum install mercurial
Debian/Ubuntu
$ sudo apt install mercurial
Fedora
$ sudo dnf install mercurial

macOS

Mercurial for macOS is distributed via Homebrew. Start by installing Homebrew, then install Mercurial:

$ brew install mercurial

Windows

Install Mercurial from https://www.mercurial-scm.org/downloads. You can use either the Inno Setup installer or the MSI installer.

Skara CLI Tools

To install the Skara CLI tools for Mercurial, simply clone the Skara repository and enable the Skara Mercurial extension:

$ git clone https://git.openjdk.java.net/skara
$ echo "[extensions]\nskara=$PWD/skara/skara.py" >> $HOME/.hgrc

The Skara tooling will build itself the first time you use any of the Skara commands. To check that everything works run hg skara help.

Updating

To update the Skara CLI tools, just run:

$ hg skara update

Using

hg defpath

$ hg defpath -h
hg defpath

    Examine and manipulate default path settings

options:

 -u --username VALUE  Username for push URL
 -s --secondary VALUE Secondary peer repostiory base URL
 -d --default         Use current default path to compute push path
 -g --gated           Created gated push URL
 -n --dry-run         Do not perform actions, just print output

(some details hidden, use --verbose to show complete help)

hg jcheck

$ hg jcheck -h
hg jcheck

    OpenJDK changeset checker

options:

 -r --rev VALUE       Check the specified revision or range (default:
                      tip)
    --whitelist VALUE Use specified whitelist (default:
                      .jcheck/whitelist.json)
    --blacklist VALUE Use specified blacklist (default:
                      .jcheck/blacklist.json)
    --census VALUE    Use the specified census (default:
                      https://openjdk.java.net/census.xml)
    --local           Run jcheck in "local" mode
    --lax             Check comments, tags and whitespace laxly
 -s --strict          Check everything

(some details hidden, use --verbose to show complete help)

hg skara

$ hg skara -h
hg skara <defpath|help|jcheck|version|webrev|update>

    Invoke, list or update Mercurial commands from project Skara

(some details hidden, use --verbose to show complete help)

hg webrev

$ hg webrev -h
hg webrev

    Builds a set of HTML files suitable for doing a code review of
    source changes via a web page

options:

 -r --rev VALUE      Compare against specified revision
 -o --output VALUE   Output directory
 -u --username VALUE Use that username instead "guessing" one
    --upstream VALUE The URL to the upstream repository
 -t --title VALUE    The title of the webrev
 -c --cr VALUE       Include a link to CR (aka bugid) in the main page
 -b --b              Do not ignore changes in whitespace
 -C --no-comments    Don't show comments
 -N --no-outgoing    Do not compare against remote, use only 'status'

(some details hidden, use --verbose to show complete help)

Note: as can be seen above, webrev is now a Mercurial extension, it is no longer invoked as webrev.ksh.

Importing patches from a Git repository

Mercurial has built-in support for the Git patch format (more recent Mercurial versions have improved support). This means that you can import a patch directly from a Git repository:

$ git -C /path/to/git/repo diff <COMMIT>^! | hg -R /path/to/hg/repo import --no-commit -

The OpenJDK Mercurial and Git repositories use different formats for commit message (see JEP 357 for details). To import a patch from an OpenJDK Git repository to an OpenJDK Mercurial repository and translate the commit message from the format used by OpenJDK Git repositories to the one used by OpenJDK Mercurial repositories, use the git-hg-export tool from the Skara CLI tools:

$ git -C /path/to/git/repo hg-export <COMMIT> | hg -R /path/to/hg/repo import -



Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 168, "requestCorrelationId": "0531b65ae6c2a849"}