3

I've recently started using mercurial (it's actually my first experience with version control) but having a very hard time wrapping my head around the concept. But thats another issue...

What I needed help with was adding files I have on my computer to a repository. I am currently trying to host my source on bitbucket and have tortoiseHG installed. I use Aptana as my IDE, and use the terminal in Aptana. I have a piece of PHP software written that I want to deploy. I added all the file to be committed via the terminal in Aptana. E.g. hg add index.php ...

After adding all the files I enttered hg commit and then a notepad popped up with all the files that were added to the queue to be committed. After closing out of there the terminal tells me the operation was aborted. This is the exact message I receive:

$ hg commit
abort: empty commit message

I am very new to this and I have no idea what is going on. What am I doing wrong?

Zaki Aziz
  • 3,592
  • 11
  • 43
  • 61

2 Answers2

6

You need to write commit message. After notepad popped out you see something like:

HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: root@localhost
HG: branch 'default'
HG: changed src/messaging.js

You should leave message before lines starting with "HG:". For example:

Mercurial rocks!
HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: root@localhost
HG: branch 'default'
HG: changed src/messaging.js

Another way to commit is to execute:

$ hg commit -m '<message here>'
Nikolay
  • 153
  • 1
  • 12
  • 1
    Thank you very much! Is there a reason as to why there must be a message before every commit? Also I'm assuming it takes a while before these changes show up? I've committed and waited a few minutes but the changes still haven't showed up on bitbucket. – Zaki Aziz Mar 09 '12 at 02:00
  • 1
    As Mercurial is DVCS the commits should be synced with repo. As I understand, you is on Windows, so write in console: $ hg push https://@bitbucket.org/// Don't forget to enter your password :) – Nikolay Mar 09 '12 at 03:03
  • 1
    Commit message is a short description what you've done. I follow Drupal commit message style guide. Read here http://drupal.org/node/52287 – Nikolay Mar 09 '12 at 03:16
  • Some systems (like Subversion) allow you to commit without a commit message — but it's very poor practice. Your commit message should briefly describe the **what** of your changes and then focus on the **why**. The reasoning behind the changes is the important part of a commit message: why did you fix the bug this way? Did you try another way only to find out that this way is better? These are the things that the diff cannot tell you, so be sure to include them in your commit message. – Martin Geisler Mar 09 '12 at 07:53
0

If you have already TortoiseHG, you can get better and faster (I hope) results, if will use Workbench for all Mercurial-related tasks

Another idea is to have and use Aptana-Mercurial integration (Aptana Studio, if it matter)

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110