The purpose of this tutorial is to help you learn Mercurial source code control. Normally I would give demonstrations; however, the below tutorial does a better job that I would.
Prerequisites
Install mercurial:
sudo apt-get install -y mercurial
If you have not done so, you need to create an .hgrc file in your home directory. This tells mercurial who you are and what you can do. Here is an example:
[ui]
username = Your Name <your@email.com>
[extensions]
purge =
hgext.mq =
The purge feature helps you remove files that should not be added.
hgext.mq feature helps you create patches.
Migrate from Mercurial to Git
Use Ubuntu 20.04 to ensure you have the minimum version of the needed tools (including mercurial).
Workflow Tutorial - Note: this page is based around Git (not Mercurial); however, it does a great job of illustrating both simple and complicated distributed source code control concepts that apply to both Mercurial and Git. I frequently use the GitFlow Workflow on larger projects.
https://www.youtube.com/watch?v=pqZeMQVJUQE
This topic is especially relevant to those who development for a specific production system. The iDempiere core development team/process does not following this methodology.
2014-07-03 AM Source Code Control - Database Versioning - Mercurial - Patch - Upgrade (environment primer)
This video is important to help you understand the relationships between the iDempiere development team, product versions, your developer, your test environment and your production environment.
Script to install iDempiere
-D includes the development environment
0:02:00 Diagram of installation
0:04:00 Two local repositories - idempiere and myexperiment
0:22:15 relationship between idempiere binaries and the code repository - updating the code to match the database
0:24:45 hg pull - getting the latest changes
0:26:00 hg log - seeing past commits and revisions
0:27:30 hg update after hg pull (hg update --clean)
0::30:00 creating your .hgrc config file
0:33:00 non-command line tools for working with mercurial (tortoise, eclipse, etc...)
0:34:45 TANGENT - the bigger picture and how your development environment fits with jenkins, production, test, your developer,e tc...
0:43:00 using chuboe_idempiere_upgrade.sh to upgrade my idempiere binaries and my DB to use the most recent build so that the DB matches my dev environment.
NOTE (0:48:15): I forgot to give Carlos Ruiz credit for writing the actual script that compares the scripts with the db scripts. I am very sorry Carlos!!
0:53:00 script to create version control for your /opt/idempiere-server folder into a version controlled repository so that you can unwind any changes (accidental or purposeful).
0:58:45 great mercurial tutorial
0:59:00 creating, merging branches
0:59:30 creating a mercurial patch
1:00:00 applying or importing patches generated by someone else - deepak's iDempiere 1770 feature patch for better ASI (serial lot) control
1:05:30 hg revert -all to undo modifications to tracked files
1:05:45 hg purge to remove newly created files
The patch updates the source code
The patch also potentially includes sql scripts - use the upgrades script to apply the sql scripts.