WackoWiki: Screenshots: Working with clients for Mercurial

https://wackowiki.org/doc     Version: 19.01.2020 12:08

First install Mercurial and TortoiseHg.

1. Initialize Repository

1.1. Command Line

With hg init you create a new repository.

$ cd /project 
$ hg init

1.2. TortoiseHg Workbench

Your new repository will be added to the Registry of your TortoiseHg workbench.

1. Step:
Open TortoiseHg: File > New Repository
TortoiseHg Create New (local) Repository

2. Step:
Provide destination path to your project and create project repository.

Commit Dialog: Toolbars, Repository Registry, graph pane, file list pane with four columns,

2. Add files

2.1. Command Line

Mercurial does not work with files unless you tell it to manage them. To do that use the add command.
With hg add you add tracking of existing files to your new repository.

$ hg add

2.2. TortoiseHg Workbench

To add files, select them in explorer. To select all files use [Ctrl]+A.
Then right click and select + Add in the context menu.

Commit dialog:

3. Initial Commit

3.1. Command Line

With hg commit you create a new changeset.

$ hg commit -m "inital commit to new repository"

3.2. TortoiseHg Workbench

Now you need to check in all files. Use the checkbox up top ( #### filter text #### ) to select all files.
By clicking the commit button in the explorer, you will be asked to enter a commit message.

Commit Dialog:

4. Clone given branch

4.1. Command Line

With hg clone, you easily make an identical (local) copy of a repository.

$ cd /project (e.g. /home/user/WackoWiki/wacko-dev)
$ hg clone https://bitbucket.org/wackowiki/wackowiki-dev ./WackoWiki/wacko-dev

4.2. TortoiseHg Workbench

TortoiseHg: File > Clone Repository

TortoiseHg clone repository Step 1

2. Step
Source: https://bitbucket.org/wackowiki/wackowiki-dev (latest Development Version of WackoWiki)
Destination: ./WackoWiki/wacko-dev (local WackoWiki project folder)

TortoiseHg clone repository Step 2

You should now have a local project directory ( /home/username/WackoWiki/wacko-dev ).
Further Reading: Mercurial: The Definitive Guide – Working with a repository[link1]

TortoiseHg clone repository Step 4

5. Configuration

Create a Mercurial Configuration file

6. Pull and update

With hg pull you will easily download just the latest code changes.

1. Step:
Check for changes
TortoiseHg pull changes Sync Toolbar Check Changes

TortoiseHg pull changes Step 1

2. Step:
Pull changes
TortoiseHg pull changes Sync Toolbar Pull Changes

TortoiseHg pull changes Step 2

3. Step:
Update local repository
TortoiseHg pull changes Edit Toolbar update local repository

TortoiseHg pull changes Step 3

TortoiseHg pull changes Step 4

7. Committing changes

With hg commit making changes to your local repository is easy.

1. Step
Make your edits.

2. Step
(Re)Open TortoiseHg or refresh current repository. Commit your changes.
TortoiseHg commit to repository

8. Commit and Push

Check repository settings.
TortoiseHg syncronize repositories

Or find and edit your Mercurial.ini on Windows, /.hgrc on Unix, or .hg/hgrc inside a repo. /Org/Tools/Repository/Doc/HowTos#h1474-5

Use two clones. Work in clone "main", push and merge in clone "sync", and pull back into clone "main".
Shared Repository Model

9. Links

10. ToDo