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

8242 questions
41
votes
8 answers

Git (or Hg) plugin for dealing with Microsoft Word and/or OpenOffice files

Has anyone come across a Git or Hg plugin for "meaningful" diffs/merging/branching of OpenOffice or Microsoft word files. I know I can 'checkin' .doc files but both Git and Hg treat them as binary blobs. I'd like to be able to do all (or at least…
JudoWill
  • 4,741
  • 2
  • 36
  • 48
41
votes
1 answer

How can I import a mercurial repo (including history) into another mercurial repo as a subdirectory, without using subrepos?

This sounds kind of complex, so let me explain: Project_A has lived for some time within its own Mercurial repository. Project_A is now getting folded into a new super project, Super-Project_B. Super-Project_B also has a mercurial repository. We…
moswald
  • 11,491
  • 7
  • 52
  • 78
41
votes
3 answers

How to resolve "abandoned transaction" when I use "hg push"?

We work with a sourceforge project. When we try to push, then mercurial abort : $ hg push pushing to ssh://@hg.code.sf.net/p/loremipsum/code searching for changes remote: abort: abandoned transaction found - run hg recover! abort: unexpected…
user1810567
  • 1,129
  • 3
  • 14
  • 22
41
votes
5 answers

Examining a changeset in HG

How can I examine a changeset in mercurial without looking up its parent? In mercurial, what's the equivalent of git show HEAD^ Git-show gives the changeset metadata and the diff as well.
notnoop
  • 58,763
  • 21
  • 123
  • 144
40
votes
4 answers

Is there an ignore-on-commit option in mercurial?

Is there any way to ignore changes to some files on a commit with mercurial? I've got a specific situation where we have a default oracle tnsnames.ora file that points to 127.0.0.1, but some developers will modify it to point to other systems, but…
Nick Randell
  • 17,805
  • 18
  • 59
  • 74
40
votes
5 answers

Why does "hg status" show changed files when "hg diff -g" doesn't? (One parent)

I have a repository where: > hg st shows that my working directory has some uncommitted changes, while > hg diff > hg diff -g > hg diff --git display nothing. I read here: 4.10. hg status shows changed files but hg diff doesn't! the…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
40
votes
3 answers

Why 'hg mv' (mercurial) doesn't move a file's history by default?

I know how to do it, I just can't understand why hg mv doesn't move the file's history as well by default. It really seems silly to be obligated me to run hg log --follow before hg mv. This remembers me the times with cvs when you needed to remove…
40
votes
4 answers

How does 'git log --graph' or 'hg graphlog' work?

I know that the history in Git is stored in a data structure called a DAG. I've heard about DFS and know it's somewhat related. I'm curious, how do programs such as git log --graph or hg graphlog draw the history? I always thought it's quite…
40
votes
3 answers

How to rename a directory in Mercurial and continue to track all file changes

I decided to rename some directories in my home/hobby Python package (doc to docs, test to tests, util to utils) because, now that I've thought more about it, I think the new names are more appropriate. My general thinking now is that if containers…
Don O'Donnell
  • 4,538
  • 3
  • 26
  • 27
40
votes
2 answers

What is the advantage of the rebase command in Mercurial?

Compare to standard push/pull, what is the advantages of using the rebase command in Mercurial?
Vincent
  • 2,712
  • 5
  • 24
  • 27
40
votes
2 answers

How can I get the current mercurial changeset revision not the hash

I need to get the current mercurial changeset to return in a very simple webservice, just the incrementing revision number and not the hash. I know I can use hg --cwd C:\repos\MyRepo parent which will return me changeset: 730:9d347e4a8d47 tag: …
Simon Martin
  • 4,203
  • 7
  • 56
  • 93
40
votes
4 answers

hg shelve equivalent of git stash drop

I have the hg shelve (not attic) extension installed, and I want to drop a patch. In git it would be git stash drop. How do I do this using the shelve extension?
undefined
  • 6,208
  • 3
  • 49
  • 59
39
votes
7 answers

Mercurial error *** failed to import extension hggit: No module named hggit

I installed Mercurial on my Mac, and it's wonderful. For me it's easier to grasp than Git so I wanted to use it to manage git-repositories. Therefore I installed hg-git with the following instructions: http://hg-git.github.com/ However, each time…
Stofke
  • 2,928
  • 2
  • 21
  • 28
39
votes
3 answers

How to merge to get rid of head with Mercurial command line, like I can do with TortoiseHg?

My question is this: If I have two heads (branches with changes) in my Mercurial repository, and I'd like to get rid of one of them, but discard all the changes from that branch instead of merging them into the other, and I can't strip out those…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
39
votes
2 answers

Is there a way to not have Bitbucket ask for my password every time when doing remote Mercurial operations?

With all other Mercurial repos that I push to, I can set my username and password in my hgrc (actually, Mercurial.ini since I'm using Windows) for doing operations at a particular domain, and Mercurial won't prompt me for auth info. However, even…
Brian Sullivan
  • 27,513
  • 23
  • 77
  • 91