Questions tagged [mercurial-commit]
20 questions
337
votes
12 answers
How to edit incorrect commit message in Mercurial?
I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?

maxyfc
- 11,167
- 7
- 37
- 46
224
votes
8 answers
Mercurial: how to amend the last commit?
I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier commit.
The requirements for this amend-procedure…

mstrap
- 16,808
- 10
- 56
- 86
133
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
- 45,844
- 25
- 100
- 144
57
votes
9 answers
How do you delete a commit in Mercurial?
I want to completely delete a Mercurial commit as if it was never entered in the repository and move back to my prior commit.
Is this possible?

mdp
- 571
- 1
- 4
- 3
8
votes
2 answers
TortoiseHg can't commit--"The system cannot find the file specified"
I just picked up TortoiseHg to use for distributed source control on Windows and installed it on my C drive. Then I created a repository (located in D:\projects).
When I try to commit the changes, it gives me the error
"abort: None: The system…

31eee384
- 2,748
- 2
- 18
- 27
6
votes
3 answers
Let Jenkins build project from a Mercurial commit
Is there a way to specify a hook in the single repository?
Now we have specified the hook in the "/etc/mercurial/hgrc" file, but every time it builds twice, and it builds for each commit in each repository.
So we want to specify a build per…

MemLeak
- 4,456
- 4
- 45
- 84
5
votes
3 answers
How to view complete text of Mercurial commit messages in TortoiseHg Workbench
Is it possible to view the full text of a Mercurial commit message from TortoiseHg Workbench.
Presently, only the description column and the snippet exposed in the Changeset expansion seem to show commit text. And even they only appear to show the…

George
- 2,451
- 27
- 37
3
votes
1 answer
Mercurial commit with subrepositories in subfolders
I have file/directory structure:
main/.hg
main/subrepo/.hg
main/subrepo1/.hg
I have .hgignore file with such content
.hg
Finally, I want to make a commit in 'main' repository that will include all files in it, including all files from main/subrepo…

freento
- 2,939
- 4
- 29
- 53
2
votes
1 answer
How to commit only a part of the changes made to a file?
I want to commit separately different parts of the same file.
I want to commit line 2 first with the message (changeset 1) and the 4th line with the message (changeset 2). How do I do it?
I am using Mercurial Distributed SCM (version…

Vishal
- 25
- 3
2
votes
4 answers
Mercurial commit only tip
In my setup I have a central Hg repo to which I'm pushing my local changes. Say in my local clone I have a series of local commits and then I want to push the changes to the central repo. How can I push only the final state without including all…

kiw
- 21
- 1
2
votes
2 answers
Mercurial commit and merge
With Mercurial I often see a scenario where I need to gradually commit an push, but if another person commits in the middle of this then I get into a problem.
Example: Assume the HG repo has four files a.txt, b.txt, c.txt, d.txt and we have two…

Peter Toft
- 565
- 7
- 19
1
vote
1 answer
Mercurial commit fails: "The system cannot find the file specified", but it is not really specified
I can't commit a single file by Mercurial. Here are different variants of the command:
The variant with --traceback
C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --traceback "--message=Ad
ded a task Xml2Java for creation request/response…

Gangnus
- 24,044
- 16
- 90
- 149
1
vote
1 answer
hg commit amend creating new branches
While trying to use the 'hg commit --amend' feature for change the commit message in repo ...
I have created the new branch named as 'hg_amend' and i have commited some changes and pushed to repo. Again i need to do some changes related to that…

Muthuvel
- 506
- 2
- 6
- 16
0
votes
1 answer
Mercurial Commit Hook with Python main function
I'm trying to create a complex mercurial commit hook in python. I want to also be allowed to pass parameters using OptionParser. Here is the gist of what I have so far:
.hg/hgrc config:
[hooks]
commit = python:/mydir/pythonFile.py:main
# using…

sinemetu1
- 1,726
- 1
- 13
- 24
0
votes
2 answers
Mercurial commit disappeared
We have switched to Mercurial recently. All had been going well until we had two incidents of committed changes going missing. Examining the logs has not made us any wiser.
Below is an example. The files committed at (1) revert to a previous state…

zorro2b
- 2,227
- 4
- 28
- 45