1. Endian Firewall

1.1. Proxy access policies

Policy Source Destination Authgroup/-user When Useragent

unfiltered access

34:17:EB:B4:CA:8C

bitbucket.org

not required

Always

ANY

2. Linux

2.1. Installation

sudo apt-get -t jessie-backports install mercurial      # Debian 8
sudo apt-get install mercurial                          # Debian 9

2.2. Configuration

Use two configuration files, because Mercurial reads only *.rc files from the /etc/mercurial/hgrc.d folder and Vim only uses syntax highlighting (see /usr/share/vim/vim74/filetype.vim) for *.hgrc and *hgrc files.

Contents of the /etc/mercurial/hgrc.d/hg.rc file.

%include /etc/mercurial/hgrc.d/hgrc

Contents of the /etc/mercurial/hgrc.d/hgrc file.

# User settings.
[ui]
username = SMRU IT <smru-it@shoklo-unit.com>
ssh = ssh -C

[extensions]
hgext.extdiff =

# Diff settings.
[extdiff]
cmd.diff-w = diff
cmd.diff-iw = diff
opts.diff-w = -B -E -N -b -w -r
opts.diff-iw = -B -E -N -b -w -r -i

[hostsecurity]
minimumprotocol = tls1.2
;hg.insecurehost.com:minimumprotocol = tls1.0
;hg.example.com:minimumprotocol = tls1.2

;# HTTPS settings.
;[web]
;cacerts = /etc/ssl/certs/ca-certificates.crt

2.3. Hg-Git plugin for Mercurial

The Hg-Git plugin for Mercurial adds the ability to push and pull to/from a Git server repository. This means you can collaborate on Git based projects from Mercurial, or use a Git server as a collaboration point for a team with developers using both Git and Mercurial.

sudo apt-get install mercurial-git

Add the following lines to the [extensions] section in the ~/.hgrc file.

hgext.bookmarks =
git =
hg clone git://github.com/delta-software-labs/Documentation.git

2.4. Usage

mkdir -p ~/bitbucket/hg/smru
cd ~/bitbucket/hg/smru
hg clone https://smru-it@bitbucket.org/smru/anc-app
hg clone -r 127 http://smru-it@bitbucket.org/smru/anc-app anc-app.r127
hg clone https://smru-it@bitbucket.org/smru/neo-com
hg clone https://smru-it@bitbucket.org/smru/public
mkdir -p ~/bitbucket/hg/<username>
cd ~/bitbucket/hg/<username>
hg clone https://<username>@bitbucket.org/<username>/public
hg clone https://smru_ro@bitbucket.org/smru/anc-app

2.5. Configuration of bitbucket

  • Browse to https://bitbucket.org.

  • Select Log in.

  • Log in as smru.

  • Select smru > Account.

  • Select the SSH keys tab.

  • Copy and paste the contents of the ~delta/.ssh/id_rsa.pub public key file into the text input box.

  • Click Add key.

2.6. Useful commands

hg init main                    # Create/init a repository
hg add                          # Add file to repository
hg commit                       # Commit changes
hg commit --amend
hg status                       # Show status of repository
hg log                          # Show logs
hg clone main main2
hg grep                         # Search historic mercurial file content
hg heads
hg merge

hg diff-w <file>                # Show differences in <file> since last commit
hg diff
hg diff <file>
hg commit [smru-anc-application]        # Commit (Enter change/commit message). :wq
hg log | head
hg pull
hg push
hg push https://smru-it@bitbucket.org/smru/public
hg push https://smru-it@bitbucket.org/smru/windows
hg revert <file>

hg cat -r <revision> <file>

2.7. Move folder to another repository

Move the command-prompt-tools folder from the public repository to the windows repository.

  • Create new windows repository at bitbucket.org.

cd ~/bitbucket/hg/smru
hg clone http://smru-it@bitbucket.org/smru/windows
  • Add the following line to the [extensions] section of the /etc/mercurial/hgrc.d/hgrc file.

hgext.convert =
  • Log out.

  • Log in.

  • Contents of the /tmp/filemap file.

include command-prompt-tools
rename command-prompt-tools delta-windows-tools
cd
hg convert --filemap /tmp/filemap ~/bitbucket/hg/smru/public ~/bitbucket/hg/smru/windows
cp ~/bitbucket/hg/smru/public/.hgignore ~/bitbucket/hg/smru/windows
cd ~/bitbucket/hg/smru/windows
hg update
# dir delta-windows-tools
# hg status
cd ~/bitbucket/hg/smru/public
hg remove command-prompt-tools
# hg status
# hg commit

3. macOS

3.1. Installation

  • Log in as smru.

  • Download the latest release from mercurial.berkwood.com.

  • Start Finder.

  • Double-click the "Mercurial-2.2.3-py2.7-macosx10.7.zip" file.

  • Double-click the "mercurial-2.2.3+20120707-py2.7-macosx10.7.mpkg" file.

  • Click Continue.

  • Click Continue.

  • Select English.

  • Click Continue.

  • Click Agree.

  • Click Install.

  • Wait.

  • Click Close.

  • Close Finder.

3.2. Configuration

cd
openssl req -new -x509 -extensions v3_ca -keyout /dev/null -out dummycert.pem -days 3650
# Type the level 3 password for the PEM pass phrase and press Enter.
# Type the level 3 password for the PEM pass phrase and press Enter.
# press Enter 7 times to accept the default values.
sudo cp dummycert.pem /etc/hg-dummy-cert.pem

Contents of the ~/.hgrc file.

# User settings.
[ui]
username = SMRU IT <smru-it@shoklo-unit.com>
ssh = ssh -C

# Proxy settings.
[http_proxy]
host = http://localhost:5865
user = ancproxy
passwd = ********

# Diff settings.
[extensions]
hgext.extdiff =

[extdiff]
cmd.diff-w = diff
cmd.diff-iw = diff
opts.diff-w = -B -E -N -b -w -r
opts.diff-iw = -B -E -N -b -w -r -i

# HTTPS settings.
[web]
cacerts = /etc/hg-dummy-cert.pem
chmod 600 ~/.hgrc
vdir ~/.hgrc

mkdir -p ~/mercurial/<username>
mkdir -p ~/mercurial/smru
cd ~/mercurial/<username>
hg clone https://<username>@bitbucket.org/<username>/public
cd ~/mercurial/smru
hg clone https://smru-it@bitbucket.org/smru/anc-app
hg clone https://smru-it@bitbucket.org/smru/neo-com
hg clone https://smru-it@bitbucket.org/smru/public

4. Windows

4.1. Installation

  • Run the mercurial-4.0.1-x86.msi file with administrative privileges.

  • Click Next.

  • Check I accept the terms in the License Agreement.

  • Click Next.

    C:\Program Files\Mercurial
  • Click Next.

  • Click Install.

  • Click Finish.

4.2. Configuration

  • Contents of the %UserProfile%\Mercurial.ini file.

    ;[ui]
    ;username = Douwe Kiestra <douwe@shoklo-unit.com>
    ;username = SMRU IT <smru-it@shoklo-unit.com>
    ;verbose = True
    
    # User settings.
    [ui]
    username = Douwe Kiestra <douwe@shoklo-unit.com>
    ssh = ssh -C
    
    # Proxy settings.
    [http_proxy]
    host = http://10.10.1.170:8080
    ;user = <username>
    ;passwd = <password>
    
    # Diff settings.
    [extensions]
    hgext.extdiff =
    
    [extdiff]
    cmd.diff-w = diff
    cmd.diff-iw = diff
    opts.diff-w = -B -E -N -b -w -r
    opts.diff-iw = -B -E -N -b -w -r -i
  • Restart the computer to update the PATH system environment variable.

  • Enter the following commands at a Command Line.

    mkdir D:\Bitbucket\Hg\SMRU
    cd D:\Bitbucket\Hg\SMRU
    hg clone https://smru-it@bitbucket.org/smru/windows