An Introduction to Mercurial Version Control Software



Similar documents
An Introduction to Mercurial Version Control Software

Distributed Version Control with Mercurial and git

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Version Control with Git. Kate Hedstrom ARSC, UAF

MATLAB & Git Versioning: The Very Basics

1. History 2. Structure 3. Git Comparison 4. File Storage 5. File Tracking 6. Staging 7. Queues (MQ) 8. Merge Tools 9. Interfaces

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Introduction to the Git Version Control System

Version Control Script

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Introduction to Version Control

Version Control with. Ben Morgan

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

Mercurial. Why version control (Single users)

Version Control with Mercurial and SSH

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

Version control with GIT

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Source Control Systems

Putting It All Together. Vagrant Drush Version Control

Version Control with Subversion

Derived from Chris Cannam's original at, an.

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Version Control with Git. Dylan Nugent

Introduction to Version Control with Git

CS 2112 Lab: Version Control

Using GitHub for Rally Apps (Mac Version)

FEEG Applied Programming 3 - Version Control and Git II

Version control with Subversion

MOOSE-Based Application Development on GitLab

Version Control using Git and Github. Joseph Rivera

Lab Exercise Part II: Git: A distributed version control system

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

Version Control with Git

Using Git for Project Management with µvision

Two Best Practices for Scientific Computing

Data management on HPC platforms

Version Control Systems

Introduction to Subversion

Using Git for Centralized and Distributed Version Control Workflows - Day 3. 1 April, 2016 Presenter: Brian Vanderwende

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

VFP Version Control with Mercurial

Version Control with Subversion

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

Software Engineering Practices for Python

Integrated version control with Fossil SCM

Software Version Control With Mercurial and Tortoise Hg

SVN Starter s Guide Compiled by Pearl Guterman June 2005

Advanced Computing Tools for Applied Research Chapter 4. Version control

Git - Working with Remote Repositories

Introduction to Version Control with Git

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Working Copy 1.4 users manual

Zenoss Resource Manager ZenUp Installation and Administration

C Programming Review & Productivity Tools

Version Uncontrolled! : How to Manage Your Version Control

Global TAC Secure FTP Site Customer User Guide

Zero-Touch Drupal Deployment

Static webpages with Pelican

Module 11 Setting up Customization Environment

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Using SVN to Manage Source RTL

Git Fusion Guide August 2015 Update

Zenoss Core ZenUp Installation and Administration

Managing Source Code With Subversion

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

Intro to Docker and Containers

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Version Control! Scenarios, Working with Git!

Zenoss Core ZenUp Installation and Administration

Using Subversion in Computer Science

Managing your Red Hat Enterprise Linux guests with RHN Satellite

FTP Service Reference

Xcode Source Management Guide. (Legacy)

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer GIT

Zenoss Core ZenUp Installation and Administration

OpenDAP configuration course

A Git Development Environment

Git. A Distributed Version Control System. Carlos García Campos carlosgc@gsyc.es

CSCB07 Software Design Version Control

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

IBM WebSphere Application Server Version 7.0

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Managing Software Projects Like a Boss with Subversion and Trac

Building a Continuous Integration Pipeline with Docker

How to Backup XenServer VM with VirtualIQ

Copyright 2010 Evolphin Software. All rights reserved. Zoom Version Control. Essentials: Working With Versioning

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

ECE 4750 Computer Architecture, Fall 2015 Tutorial 2: Git Distributed Version Control System

Configuring the BBj Jetty Web Server (rev10.02) for OSAS

Transcription:

An Introduction to Mercurial Version Control Software LANS Weekly Seminar October 17, 2006 Satish Balay balay@mcs.anl.gov

Outline Why use version control? Simple example of revisioning Mercurial introduction - Local usage - Remote usage - Normal user workflow - Organizing repositories [clones] Mercurial at MCS [Demo]

What do we use Version Control for? Keep track of changes to files Enable multiple users editing files simultaneously Go back and check old changes: * what was the change * when was the change made * who made the change * why was the change made Manage branches [release versions vs dev]

Simple Example of Revisioning File Changes main.c File Version 0 1 2 3 Delta

Simple Example Cont. main.c 0 1 2 3 makefile main.c 0 1 Repository Version -1 0 1 2 3 Changeset

Some Definitions Delta: a single change [to a file] Changeset: a collection of deltas [perhaps to multiple files] that are collectively tracked. Repository: collection of files we intend to keep track of. This includes the revision history Version [or Source] Control Tool: Enables us to keep track of all the changes [to files] in a repository

Mercurial Distributed version control tool. http://www.selenic.com/mercurial OpenSource [GPL] Active mailing list : mercurial@selenic.com Written in python Works on linux, windows, and other machines Reasonably efficient [handles 9000+ changesets in PETSc]

Usage: Creating a Repository mkdir project cd project hg init Initializes the directory 'project' as a mercurial repo. All 'hg' commands are invoked inside the repository All commands are in the form 'hg command'. For example : hg help Stores metadata in the subdirectory project/.hg

Usage: Adding/Modifying Files cd project touch main.c hg add main.c hg commit emacs main.c [edits to file] hg commit [alternative: hg ct ] 'add' indicates the file is now part of the repository. 'commit' creates a changeset for the current changes. [prompts the user to enter comments]

Repository Data vs Working Files Repository data is the revision history and graph of all the changes. Its stored in project/.hg directory Working files are the reset of the files in project. User edits the working files. hg tip [show the tip revision of the repository graph] hg parent [show the parent revision of the working dir] Note: Working dir files can correspond to any revision of the repository. So one has to be careful about this point [and not assume the parent is always the tip revision] hg update REV [update working copy to REV version]

Illustration of Changes repository working files metadata changeset repository hg commit repository file changes

Checking Status/History hg status [list the current modified, unknown files] hg diff [list the diff of the changed files in patch form] hg log [list the revision history of all changes] hg view [extension: GUI tool to check changeset graph] hg ct [extension: GUI tool to commit changes] Note: So far we have delt with local opeations on the repository

Distributed Model Peer to Peer: all copies of repositories are equivalent. Information flows between repositories as changesets. Each operation is between two repositories. hg clone /home/balay/old-repo new-repo cd new-repo [Local reposiory to invoke cmds] hg pull [repo] [get remote changesets and apply locally] hg push [repo] [apply local changes to the remote repo] Notes: Every repository has complete revision history [metadata] One can switch roles of old-repo & new-repo Remote operations between repositories [as oposed to local operations]

hg help pull /home/balay/petsc-dev URLs [documentation of urls] ssh://petsc@harley.mcs.anl.gov//home/petsc/petsc-dev http://hg.mcs.anl.gov/petsc/petsc-dev [readonly] http-old://www.mcs.anl.gov/~petsc/project [readonly] https:// [read/write support in newer versions] Note: 'hg clone' stores the URL for remote repository [in.hg/hgrc] so, when push,pull are invoked, url is not required. [versions 0.9.1 and newer]

Organizing Repositories [clones] Any to Any Methods of communicating changes clone/push/pull [changesets] import/export [email patch] bundle/unbundle [email changesets] Shared Common The relations are not hardcoded

Syncing Two Repositories with Changesets to Remote Repository repository-local working files metadata Remote repo has extra changesets repository-remote repository-local hg pull repository-remote repository-local hg update repository-remote

Syncing Two Repositories with Changesets to Local Repository repository-remote working files metadata Local repo has extra changesets repository-local repository-remote hg push repository-local Updating Working copy of remote is not necessary.

Syncing Two Repositories with Changesets to both Repositories repository-local A working metadata files Both repos have extra changesets repository-remote B RevisionGraph Change Initial A repository-local A B hg pull repository-remote B Initial A B repository-local A B hg merge repository-remote B repository-local A+B A B hg commit repository-remote B Initial A B A+B repository-local A+B A B hg push repository-remote A+B A B A: local repo changeset B: remote repo changeset A+B: merge changeset

Normal User Work Flow <make changes to working files> hg commit [commit local changes] hg pull [check & obtain remote changes] hg merge [auto merge if not use external merge tool for eg: kdiff3] hg commit [commit the merge changeset] hg push [push local changesets + merge changesets to the remote repository]

Handling Uncomitted Edits? Uncomited chages present with local changesets Uncomited changes present with push/pull Uncomited changes present during update/merge More things need to be kept track off [uncommited changes, commits, commits in the remote repository, merges etc..] This is best avoided...

Multiple Users: Communicating Changesets using a Shared Repository Shared repository petsc-dev read only, via http read/write via ssh external-user balay-clone User CloneRepos bsmith-clone knepley-clone temp-clone-1 temp-clone-2

Managing Patches to Release Versions Shared Repos petsc-dev petsc-release 2. Pull/Merge/Push to shared release repo 4. Pull/Merge/Push to shared dev repo 1. Apply fix User CloneRepos dev-clone release-clone 3. Pull/merge [from dev-clone]

Browsing changes hg view hg log hg annotate filename [REV] hg update [REV] hg serv [starts a web server] Use a web browser to browse changes

Mercurial at MCS MCS Linux boxes has mercurial 0.9 installed /mcs/mercurial/project can be used for hosting repositories for web acces http://hg.mcs.anl.gov/project is the web url. For eg: some of the repositories of the PETSc project are at http://hg.mcs.anl.gov/petsc