Questions tagged [mercurial]

Mercurial is a fast, open-source DVCS (Distributed Version Control System).

Mercurial is a distributed version control system, . It is dedicated to speed and efficiency with a sane user interface. The main part of the code is written in , with a small part in . The project is open-source, distributed under the GPL.

External Links ==============

Please report bugs to the bug tracker instead of posting them here on Stack Overflow. Otherwise the Mercurial team may not see them, and you will become frustrated from the lack of response.

Internal Links ==============

This is a compilation of information on using Mercurial for beginners for practical use.

Beginner - a programmer who has touched source control without understanding it very well.

Practical - covering situations that the majority of users often encounter - creating a repository, branching, merging, pulling/pushing from/to a remote repository, etc.

Notes:

  • Explain how to get something done rather than how something is implemented.
  • Deal with one question per answer.
  • Answer clearly and as concisely as possible.
  • Edit/extend an existing answer rather than create a new answer on the same topic.
  • Please provide a link to the Mercurial wiki or the HG Book for people who want to learn more.

Questions =========

Installation/Setup

Working with the code

Tagging, branching, releases, baselines

Other

8137 questions
140
votes
9 answers

Converting Mercurial folder to a Git repository

I don't have a huge experience with Mercurial, I'm mostly a Git guy. I would love to mirror a specific Mercurial folder/file in a git Repository. What I'm actually trying to do is to export the history of a file from a Mercurial repository to Git…
Simone Carletti
  • 164,184
  • 42
  • 341
  • 356
139
votes
15 answers

What are the relative strengths and weaknesses of Git, Mercurial, and Bazaar?

What do folks here see as the relative strengths and weaknesses of Git, Mercurial, and Bazaar? In considering each of them with one another and against version control systems like SVN and Perforce, what issues should be considered? In planning a…
Jordan Dea-Mattson
  • 5,695
  • 5
  • 35
  • 52
139
votes
8 answers

Git serve: I would like it that simple

I want to know how to simply publish over http = much like Mercurial's hg serve! On the Windows/work box do this: git serve and then on the Linux box SIMPLY go: git clone http://project project finished.
Setori
  • 9,286
  • 11
  • 38
  • 45
132
votes
4 answers

Is it possible to reopen a closed branch in Mercurial?

I understand that it is possible to close a named branch in Mercurial, so that it will not appear in the hg branches list: hg commit --close-branch -m 'close badbranch, this approach never worked' Is it possible to later re-open the branch if need…
Lóránt Pintér
  • 9,044
  • 13
  • 42
  • 50
132
votes
4 answers

How to abandon a hg merge?

I'm new to collaborating with Mercurial. My situation: Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo. I've committed substantive…
Grumdrig
  • 14,990
  • 11
  • 53
  • 68
130
votes
6 answers

Named Branches vs Multiple Repositories

We're currently using subversion on a relatively large codebase. Each release gets its own branch, and fixes are performed against the trunk and migrated into release branches using svnmerge.py I believe the time has come to move on to better source…
James Emerton
  • 3,839
  • 2
  • 22
  • 30
129
votes
9 answers

Mercurial undo last commit

How can I undo my last accidentally commited (not pushed) change in Mercurial? If possible, a way to do so with TortoiseHg would be prefered. Update In my concrete case I commited a changeset (not pushed). Then I pulled and updated from the server.…
Martin Buberl
  • 42,048
  • 25
  • 96
  • 139
129
votes
1 answer

How can I switch to a tag/branch in hg?

I followed the documentation in https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial and downloaded FF source with: hg clone http://hg.mozilla.org/mozilla-central/ src How can I switch to the FF3.6 'branch' or 'tag'? The…
n179911
  • 17,581
  • 40
  • 105
  • 153
127
votes
8 answers

Print Current Mercurial Revision Hash?

Is there a better way extract the current revision hash in Mercurial than hg log -l1|grep changeset|cut -d: -f3 ? Part of my webapp deployment script "tags" the uploaded app tarball with its unique revision hash.
rentzsch
  • 3,410
  • 4
  • 25
  • 37
126
votes
13 answers

rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C

Rsync includes a nifty option --cvs-exclude to “ignore files in the same way CVS does”, but CVS has been obsolete for years. Is there any way to make it also exclude files which would be ignored by modern version control systems (Git, Mercurial,…
Jesse Glick
  • 22,072
  • 9
  • 77
  • 100
124
votes
3 answers

Changing Mercurial "Default" Parent URL

Let's say I have a Mercurial repository and I'm pulling from a default parent URL (the source I cloned it from). Now I want to change the default parent URL (hostname change, or it was copied to another machine, etc.). Is there a way to do this, or…
Adam Ernst
  • 45,666
  • 17
  • 55
  • 71
124
votes
4 answers

Mercurial move changes to a new branch

I have a number of changes that I committed to my local repository, but have not yet been pushed. Since on a feature is taking longer than expected, I want to swap these changes onto a named branch before I push. How can I do this?
Casebash
  • 100,511
  • 79
  • 236
  • 337
123
votes
3 answers

Mercurial (hg) commit only certain files

I'm trying to commit only certain files with Mercurial. Because of of hg having auto-add whenever I try to commit a change it wants to commit all files. But I don't want that because certain files are not "ready" yet. There is hg commit -I…
user287689
122
votes
5 answers

How much space can your BitBucket account have?

I created a BitBucket account today, and I love the fact that they allow you to have unlimited public/private repositories. However, I didn't find the size limit of your account? Does anyone know where to find it? Github offered 300mb if I remember…
Geo
  • 85,654
  • 109
  • 315
  • 497
121
votes
2 answers

Generating a list of which files changed between hg versions

I want to generate a list of which files changed between two revisions in a given directory in Mercurial. In particular, I am not interested in what changed, but which files changed in that directory. E.g., supposing that between then and otherthen,…
Paul Nathan
  • 37,919
  • 28
  • 110
  • 204