Pages

vendredi 24 septembre 2021

Quick Start

 Clone a project and create a patch

$ hg clone https://selenic.com/repo/hello
$ cd hello
$ (edit files)
$ hg add (new files)
$ hg commit -m 'My changes'
$ hg export tip > patch.diff

Create a project and commit

$ hg init (project-directory)
$ cd (project-directory)
$ (add some files)
$ hg add
$ hg commit -m 'Initial commit'

Part 1: Using Mercurial

Aside from the practical Quick Start above, there are only a few commands you need to start working.

Even if you stick to these basics, Mercurial is quite powerful. And they are very easy to use, once you see the model behind them: Each repository has the whole history, and history is not necessarily linear (part 2 explains that model in a bit more detail). All that history is stored in the ".hg" directory inside the top-level folder of your project.

A quick overview of the basic commands:

  • hg init: create a new repository
  • hg commit: save your changes in the current repository
  • hg log: see all changes in your repository
  • hg pull: get all changes from another repository into the current one
  • hg push: get all changes from your repository into another one
  • hg serve: create an instant-webserver. People can see the history there and pull from it
  • hg merge: join different lines of history

If you want to see a nice graph of the history, just do hg serve in your repository and then direct your browser to

    http://127.0.0.1:8000

This also helps getting a feeling for what the commands do.

(you can also do a lot of finegrained stuff by using different command options. Just call "hg help <command>" to see them).

One step you'll likely want to do is setting your username in your Mercurial config file.

For this you can configure a proper name and email address in ~/.hgrc (or on a Windows system in %USERPROFILE%Mercurial.ini) by adding lines such as the following:

[ui]
username = John Doe <john@example.com>

I you want more than this quick overview, please have a look at our longer practical guide.

Part 2: Understanding Mercurial in 6 steps

Now we'll look at some of the basic concepts of Mercurial to get a better understanding of its internals:

  1. Like in Subversion, history consists of a number of commits. They're called changesets in Mercurial.

  2. Subversion requires a strict linear ordering of the commits and gives nice linear revision numbers to them. So revision N has only one child revision, N+1. This is simple, but it requires a central server to make sure that everybody agrees on the revision numbers.

  3. Mercurial generalizes this by letting each changeset have multiple children. If I work alone and make commits I'll make 
    by making three commits.

    The commit C3 with no children is a "head". It is also the newest changeset in the repository -- called "tip". If I shared C1 with you and you started your work from that, your commits will build a repository like this: 
    Here C3' is a head in your repository and I don't know anything about C2' and C3' yet.

  4. If I pull from you, or you push to me, the two repositories are compared. By default, all missing changesets are transferred. This is all there is to push/pull: compare two graphs of changesets and transfer the missing ones.

    After a pull from you my repository will look like this: 
    Here C1 has two child changesets, and the repository has two heads since the development has diverged.

    The changeset C3' will be the new tip since it is the newest changeset in the repository. Note that tip is always a head, but a head need not be the tip.

  5. Having two heads suggest that someone should merge them -- otherwise the changes from one will never be combined with the changed made in the other head.

    When merging with 'hg merge' the task is to figure out the canonical way to combine the changesets. If the changes do not overlap this is usually trivial, otherwise you have to do a three-way merge. The merge must be committed and this creates a changeset which explains to the world how you think the two heads should be combined: 
    Note that the merge changeset M has two parents.

    If you do not merge C3 and C3' and try to push, you get the 'new remote head' message and push aborts. It aborts since it is a little "impolite" to leave the job of merging to someone else -- he who created the two heads by pulling in some code should also normally do the merging.

  6. It helped my understanding a lot to think in terms of the changeset graph. Just remember that:

    • "hg commit" adds a new node. The parent changesets of the new node is given by "hg parents"

    • "hg push" and "hg pull" transfer nodes in the graph between two repositories.

    • "hg update" updates the working copy to reflect a given node in the history graph. This also changes the parent changeset of the next commit, see "hg parents".

And if you want to quickly look up something, you can use one of the Mercurial cheatsheets.

lundi 20 septembre 2021

Mercurial source control management

 





Mercurial source control management

Mercurial is a free, distributed source control management tool. It offers you the power to efficiently handle projects of any size while using an intuitive interface. It is easy to use and hard to break, making it ideal for anyone working with versioned files.

Distributed architecture

Traditional version control systems such as Subversion are typical client-server architectures with a central server to store the revisions of a project. In contrast, Mercurial is truly distributed, giving each developer a local copy of the entire development history. This way it works independent of network access or a central server. Committing, branching and merging are fast and cheap.

Fast

Mercurial's implementation and data structures are designed to be fast. You can generate diffs between revisions, or jump back in time within seconds. Therefore Mercurial is perfectly suitable for large projects such as nginx (hg) or NetBeans (hg).

Platform independent

Mercurial was written with platform independence in mind. Therefore most of Mercurial is written in Python, with a small part in portable C for performance reasons. As a result, binary releases are available on all major platforms.

Extensible

The functionality of Mercurial can be increased with extensions, either by activating the official ones which are shipped with Mercurial or downloading some from the wiki or by writing your own. Extensions are written in Python and can change the workings of the basic commands, add new commands and access all the core functions of Mercurial.

Easy to use

Mercurial sports a consistent command set in which most subversion users feel right at home. Potentially dangerous actions are available via extensions you need to enable, so the basic interface is easy to use, easy to learn and hard to break. The Quick Start should get you going in a just few minutes.

Open Source

Mercurial is free software licensed under the terms of the GNU General Public License Version 2 or any later version.

Similar projects

Mercurial is used for version control of files. Similar projects include Git and Bazaar. Version control systems without a distributed architecture include Subversion and CVS.

The Website

The website is a project of the Mercurial community. The source is licensed under GPLv2 or later. Feel free to send us patches.

Mercurial downloads

 

best regards
your SCM-Manager Support Team  
 Downloads" tab. Password is: kt2qK3qV5PX4

Mercurial 5.9.1 Inno Setup installer - x64 Windows (Python 2) - does not require admin rightsdownload
Mercurial 5.9.1 Inno Setup installer - x64 Windows (Python 3) - does not require admin rightsdownload
Mercurial 5.9.1 Inno Setup installer - x86 Windows (Python 2) - does not require admin rightsdownload
Mercurial 5.9.1 Inno Setup installer - x86 Windows (Python 3) - does not require admin rightsdownload
Mercurial 5.9.1 MSI installer - x64 Windows (Python 2) - requires admin rightsdownload
Mercurial 5.9.1 MSI installer - x64 Windows (Python 3) - requires admin rightsdownload
Mercurial 5.9.1 MSI installer - x86 Windows (Python 2) - requires admin rightsdownload
Mercurial 5.9.1 MSI installer - x86 Windows (Python 3) - requires admin rightsdownload
Mercurial 5.9.1 source releasedownload
TortoiseHg 5.9.1 DMG - macOS 10.9.5+download
TortoiseHg 5.9.1 MSI installer - x64 Windowsdownload
TortoiseHg 5.9.1 MSI installer - x86 Windowsdownload
TortoiseHg 5.9.1 Source Release


Mercurial 5.9 for macOS 10.14+download

[more versions]

Development Repositories
Main
The main development repository of the Mercurial maintainer Matt Mackall can be found at https://www.mercurial-scm.org/repo/hg.
Committers
The development repository of the Mercurial core contributors can be found at https://www.mercurial-scm.org/repo/hg-committed/.

See Developer Repositories on the wiki for a full list.

Requirements
Python
Mercurial uses Python (version 2.7). Most ready-to-run Mercurial distributions include Python or use the Python that comes with your operating system.
Older Releases
Python versions
For more information about version support, see Supported Python Versions on the wiki.
Python 2.6
Mercurial 4.2.3 is the last release to support Python 2.6. Use this if you need to run Mercurial on old platforms and you cannot update your Python installation.
Python 2.5
Mercurial 3.4.2 is the last release to support Python 2.5. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Python 2.4
Mercurial 3.4.2 is the last release to support Python 2.4. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Python 2.3
Mercurial 1.2.1 is the last release to support Python 2.3. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Older source releases
All previous source releases are available to download.


Get started

Mercurial is written in Python with platform independence in mind. As a result, Mercurial is available on Microsoft WindowsGNU/LinuxMac OS XSolaris 11 Express and others. You can either download a binary package for the system of your choice or build it from sources.

Windows users are likely to enjoy the TortoiseHg GUI the most. It integrates Mercurial directly into your explorer.

Packages for common Linux, BSD and Solaris distributions can be installed from the system specific repositories:

(Ubuntu: If you need a more recent version than what is available through apt-get, you can try the PPA.)

# Debian/Ubuntu
$ apt-get install mercurial

# Fedora
$ dnf install mercurial

# Gentoo
$ emerge mercurial

# Mac OS (homebrew)
$ brew install mercurial

# FreeBSD
$ cd /usr/ports/devel/mercurial
$ make install

# Solaris 11 Express
$ pkg install SUNWmercurial
 


download




mercredi 28 octobre 2015

downloads and mercurial version 3.7.1 windows App








Mercurial downloads

Application Android    Application iOS

  Code secret du client Web   :           WHh8u_SaJXpwUPrXipBSPIjl





Mercurial 3.7.1 for MacOS X 10.10download
Mercurial 3.7.1 for Python 2.7 on Windows x64 (source install)download
Mercurial 3.7.1 for Python 2.7 on Windows x86 (source install)download
Mercurial 3.7.1 Inno Setup installer - x64 Windows - does not require admin rightsdownload
Mercurial 3.7.1 Inno Setup installer - x86 Windows - does not require admin rightsdownload
Mercurial 3.7.1 MSI installer - x64 Windows - requires admin rightsdownload
Mercurial 3.7.1 MSI installer - x86 Windows - requires admin rightsdownload
TortoiseHg (including Mercurial) 3.7.1 - x64 Windowsdownload
TortoiseHg (including Mercurial) 3.7.1 - x86 Windowsdownload

[more versions]

Development Repositories
Main
The main development repository of the Mercurial maintainer Matt Mackall can be found at https://selenic.com/hg.
Crew
The development repository of the Mercurial Crew can be found at http://hg.intevation.org/mercurial/crew.
Requirements
Python
Mercurial uses Python (versions 2.6 through 2.7). Most ready-to-run Mercurial distributions include Python or use the Python that comes with your operating system. When building from source you should confirm that an appropriate Python version is available.
Older Releases
Python versions
For more information about version support, see Supported Python Versions on the wiki.
Python 2.5
Mercurial 3.4.2 is the last release to support Python 2.5. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Python 2.4
Mercurial 3.4.2 is the last release to support Python 2.4. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Python 2.3
Mercurial 1.2.1 is the last release to support Python 2.3. Use this if you need to run Mercurial on very old platforms and you cannot update your Python installation.
Older source releases
All previous source releases are available to download.
 

mercredi 2 septembre 2015

With Mercurial you can use a multitude of different workflows


Learning Mercurial in Workflows
With Mercurial you can use a multitude of different workflows. This page shows some of them, including their use cases. It is intended to make it easy for beginners of version tracking to get going instantly and learn completely incrementally. It doesn't explain the concepts used, because there are already many other great resources doing that.
Alternatives to this guide and further reading:
Tutorial - a more exhaustive tutorial. Mercurial: The Definitive Guide - a very detailed description of Mercurial including behind the scenes, an indepth article on the design of Mercurial. Understanding Mercurial - the concepts behind Mercurial. Note:
This guide doesn't require any prior knowledge of version control systems (though subversion users will likely feel at home quite quickly). Basic command line abilities are helpful, because we'll use the command line client. Basic workflows We go from simple to more complex workflows. Those further down build on previous workflows.
Log keeping
Use Case The first workflow is also the easiest one: You want to use Mercurial to be able to look back when you did which changes.
This workflow only requires an installed Mercurial and write access to some file storage (you almost definitely have that :) ). It shows the basic techniques for more complex workflows.
prepare Mercurial As a first step, you should teach your Mercurial name. So you open the file ~ / .hgrc (or Mercurial.ini in your home directory for Windows) with a text editor and add the ui section (user interaction) with your user name: if You are systems that project members checked or validated changes in the source code, or by using command-line tools to upload files to the project of the "Downloads" tab. Password is: kt2qK3qV5PX4


http://git-scm.com/downloads
http://mercurial.selenic.com/downloads

With the dawn of DVCS many different systems emerged and their number is increasing. Since the beginning two major solutions fight for the throne of the "best" DVCS: Mercurial and Git. While both do their job very well there is an almost religious debate which one is THE best. This article tries to give an objective view on both version control systems and hence helps to decide which one is the best for your project to come.

Git

git logo
Git was developed by Linus Torvalds to replace BitKeeper, a proprietary SCM-System used for the linux kernel development. After the free use of the product was called off and no free system on the market met his needs, Torvalds began his own development. His intention was to create a system as powerful as BitKeeper.
Git was designed to be flexible, robust and above all: fast. Originally designed to be a basic version control system Git grew quickly and became a full fledged revision control system with a unique design approach. The most important properties of Git are:
  • efficiency in large projects. Git scales very well with projects of growing complexity and is faster than most other systems.
  • fast merging and branching. Both operations perform very fast and the lightweight branch concept emphasizes the non-linear development idea behind Git. A fairly unique option in Git is the "octopus merge". It allows to merge more than two revisions of one file in one single step while maintaining integrity.
  • distributed. Every developer holds a local copy of the development history and changes are copied as branches between the histories. There is no difference between local and remote branches during a merge.
  • toolkit-structure. Git is basically a set of separate programs written in C and a set of scrips to wrap their functions. Those plugable parts are easy to switch or expand.
  • object packing. Git stores all new files separately and compresses older files into "packfiles" for efficient storage. To maintain the efficient structure, Git also does a periodic repacking which can be a very resource-consuming operation. Therefore it is best scheduled at the end of a workday.
  • garbage collector. If the user leaves loose ends in the history, for example by backing out changes, an automated garbage collector will clean up the repository to prevent pollution of the history.
Git is highly flexible and if you want to realize your own "revision workflow" Git could be your choice. It allows you to review the history of an older revision and change the commit history itself. But where is light there is shadow, Git is by no means flawless:
  • Git reveals lots of it's inner options to the user, which could be overwhelming or deterrent.
  • Documentation! There is almost none. If you learn Git from scratch prepare for long searches in Google and co. To get going it is in general more advisable to learn Git from experienced colleagues than dig around the web all by yourself.  Downloads" tab. Password is: kt2qK3qV5PX4   http://git-scm.com/downloads  

Mercurial

Mercurial Logo
Although Git and Mercurial originated from the free version of BitKeeper in 2005 as a replacement in linux kernel development, Mercurial puts a strong emphasis on simple usage. However both pursue similar goals: high performance, scalability, decentralized structure and robust version control. Even though Git became the successor of BitKeeper for Linux, Mercurial developed into one of the most common DVCS's.
While Git uses the tool-kit approach to stay flexible and adaptable, Mercurial is one single monolithic binary that for simplicity sake omits certain options, e.g. editing previous commits. In the view of merging, committing and tagging both systems work equally, but Mercurial is slightly slower. Since Mercurial encapsulates it's functionality very good, it is fairly easy to learn the basic options in less than one day.

So, who wins?

First of all it is not easy to compare Git and Mercurial, because both share the same underlying idea of distributed code management. Git is fully configurable and can be adapted for different workflows. It is a long and hard way to master this system. Mercurial is easy to learn, but it lacks in flexibility compared to Git. To sum up, there is not the perfect choice for all situations.
For larger projects with many contributors and high dynamics Git is most likely worth the effort. If you are looking for a fast and lean way to start distributed version control, Mercurial might be the better choice. With some experience in Subversion, Mercurial shouldn't be a problem.
All in all, a Git-user will most likely not sacrifice the liberty of designing a personal workflow for the sake of simplicity in Mercurial. And vice versa a user of Mercurial might value simplicity more than the variety of configurations in Git. When comparing Mercurial to Git, Mercurial is often said to be easier to use but less configurable. At a first glance this might be true. But using the advanced configuration methods of the command line, you can configure Mercurial in the same depth as Git. You just need to know how to do it.
Generally, we recommend to select the best system for each project based on the project requirements more than personal preferences. There are many clients available for both Mercurial and Git to fit everybodies' preferences.
Using SCM-Manager enables you to manage Git and Mercurial projects in one interface with no additional effort. Therefore you are free to choose the best fitting system for every situation.
Finally one advice: Evaluate your work and choose the best tools to do it, keep flexible and open for new possibilities and stop arguing about the tools and get to write some code!

best regards
your SCM-Manager Support Team  
 Downloads" tab. Password is: kt2qK3qV5PX4
http://mercurial.selenic.com/downloads