RF Eclectica Wiki

Try to learn something about everything, and everything about something - Thomas Huxley

User Tools

Site Tools


public:computers:mercurial

02 : Computers

Mercurial

Snippets to help remember how to use Mercurial Version Control

Create a Repository

  • Work on files until ready to start version control
  • Create a repository in the directory
    • hg init
  • add the files
    • hg add
  • commit the changes
    • hg commit
    • edit the comments and save them
    • or use hg commit -m “adding initial version of hello.txt” to add comments directly to the commit log
  • This has made the first version of the repository.

Simple workflow

  • Work on files in the repository directory (or copy in files edited and tested elsewhere)
  • Add any new files
    • hg add
  • Commit any changes
    • hg commit -m “comments…..”
  • This keeps the local (master?) repository up to date with all the changes, in case a reversion to a previous version is necessary. All changes are tracked.

Remote copies

  • on another machine you can clone a repository - to work on it or as a backup
  • by ssh
    • hg clone ssh://gm4slv@xgate//path/to/repo
    • this will pull the repo files across and make an exact copy
    • in future you can pull any new changes made on the other (master?) repo by hg pull
    • any changes will be brought over, but the working directory won't be brought up to date until you update it:
      • hg update
      • to make this automatic add to the clone repo's .hg/hgrc:
[hooks]
changegroup = hg update
  • any changes made in the clone repo can he sent back to the master by hg push
    • remember to log into the master machine's repo and use hg update - or add the same lines to its .hg/hgrc
[hooks]
changegroup = hg update
  • any changes made in the master repo can be pushed to the clone(s) using hg push too.
  • the hgrc file holds the paths for push and pull destinations - should be self explanatory.
  • The log of commits hg log looks like:
changeset:   12:f69a03ef230f
tag:         tip
user:        John Pumford-Green <john@wire2waves.co.uk>
date:        Sun Mar 24 22:15:09 2024 +0000
summary:     removed previous test comment

changeset:   11:caeb761265b2
user:        John Pumford-Green <john@wire2waves.co.uk>
date:        Sun Mar 24 21:30:03 2024 +0000
summary:     added a comment to check push back to xgate

changeset:   10:146123c9688c
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Sun Mar 24 21:12:45 2024 +0000
summary:     catch up commit. various tweaks. moved to single xgate script that can

changeset:   9:482ed4c74b93
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Sun Feb 20 18:05:13 2022 +0000
summary:     heartbeat watchdog script added to repository

changeset:   8:8a7f5ff9839c
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Sun Feb 20 18:02:49 2022 +0000
summary:     added watchdog heartbeat

changeset:   7:0b870c3f0bc4
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Mon Dec 14 06:45:06 2020 +0000
summary:     simplex version with monitor command disabled

changeset:   6:a8d3082edc19
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Mon Dec 14 06:44:38 2020 +0000
summary:     update

changeset:   5:0b654aa5948a
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Sun Nov 15 22:04:11 2020 +0000
summary:     removed old commented functions etc.

changeset:   4:00b921d165c6
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Sun Nov 15 21:48:59 2020 +0000
summary:     changes to use dual-band V/UHF access

changeset:   3:bb599b01bd56
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Thu Nov 12 16:21:40 2020 +0000
summary:     ATU Tune returns "... complete"

changeset:   2:c9a9e04c7ad2
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Thu Nov 12 16:08:35 2020 +0000
summary:     ignore pyc files

changeset:   1:d668512ccedd
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Thu Nov 12 16:03:47 2020 +0000
summary:     remove unneeded file

changeset:   0:45cc8998c62b
user:        John Pumford-Green <gm4slv@gmail.com>
date:        Thu Nov 12 15:55:29 2020 +0000
summary:     first commit - current running code for xGate using IC-M710 HF transceiver.

 

John Pumford-Green 24/03/24 22:23

Further Information

public/computers/mercurial.txt · Last modified: 24/03/24 23:00 GMT by 127.0.0.1