260 likes | 271 Views
Learn how to use Mercurial and Tortoise-HG for collaborative development and version control of shared files. Track changes, resolve conflicts, and recover from mistakes.
E N D
What • Mercurial is a revision control system (RCS) • Revision control is the process of managing multiple versions of a piece of information • Tortoise is a set of graphical tools for Mercurial
Why • Enables collaboration of multiple developers on shared files • Tracks changes in projects: who, why, when & what • Identifies and resolves potentially incompatible changes • Enables recovery from mistakes
Definitions • Repository – contains all of the files that “belong to” a project, along with a historical record of the project's files • Clone – a clone of a repository, enables synchronizing with the original repository • Changeset – a record of changes to (potentially) several files
Actions • Commit – records changes in a new changeset • Push –sends changes to another repository • Pull –gets changes from another repository • Update – update the changes that were pulled
How do we use it? • We don’t change the source files in Public • Instead, we have a revision control over shared libraries • Matlabtooboxes • Perl modules • Each one of them is a Repository • Each one of us has Clones of them • We make changes locally and push them only after a code review with Liran
Cloning a repository • Should be done on a location in the server (Z:\) • Right click the directory in which you want to create the repository, then clickTortoiseHG and Clone
Click the Browse button next to Source Path and choose the repository you would like to clone
Overlay icons • Open the folder and you will see overlay icons which reflect the status of the files • Green V – no uncommitted change • Red exclamation mark - uncommitted change • Question mark – state unknown • To update the overlay icons right-click the clone repository and from the TortoiseHG menu choose “Update Icons”
Viewing changes Right click your repository/ a directory or file inside your repository click TortoiseHG and then Visual Diff Choose from the window thefile to compare A Kdiff window will open
Commit • 1st time use: make sure your commit username is correct Right click your repository and choose TortioseHG and then Global Settings
Right click your repository/ a directory or file inside your repository and click HG Commit • 2nd time and up:
Commit process: The commit button Enter commit message here The files that changed Shows the changes in the selected file from the last revision Legend of file statuses
Check that the commit was successful and close the log and commit windows
Synchronizing with original repository Right click your repository and choose TortioseHG and then Synchronize
Outgoing • Displays local changes that’d be pushed Files that changed betweenthe repositories The description is our commit comment
Push • Done after commit and after code review Number of changesets(revisions) that are being pushed and to how many files
Incoming • Displays changes that can be pulled from selected repository Who made the change and when Files that changed betweenthe repositories The description is thecommit comment
Pull • Pulls changes from selected repository Number of changesets(revisions) that are being pulled and to how many files Update the changes in your repository View the modifications
Repository Explorer Used to visualize the revision history of each file in your repository Right click your repository and choose TortioseHG and then HG RepositoryExplorer
Summary of the change (the commitcomment). Bold – the revision currentlyused in the repository The user whocommitted the change How long ago the revision was committed Synchronizingtools Graphic displayof revisions The modified filesin the selectedrevision The changes made in the selected file in the selected revision
For more information • Mercurial book • Tortoise book