# Mercurial Commit

**URL:** https://www.finalbuilder.com/forums/t/mercurial-commit/3446
**Category:** Bugs
**Created:** [August 20, 2012, 12:16pm UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446 "2012-08-20T12:16:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 20, 2012, 12:16pm UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446/1 "2012-08-20T12:16:43Z")

</div>

Hi,   
  
 the action Mercurial Commit fails if there are no local changes. The reason is that HG returns with the exit code “1” but the FinalBuilder expects “0”.   
 IMO, the action should only fail for exit codes \> “1”.   
  
 –   
 Thanks,   
  
 Roman

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [August 21, 2012, 3:12am UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446/2 "2012-08-21T03:12:50Z")

</div>

Mercurial is a bit inconsistent with it’s return codes, it uses the same return code for many different things, for example pretty much all errors return 255… makes it hard to handle spe cific issues. I have seen other things return 1 as well. I’ll take a look at this and get back to you

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 22, 2012, 12:00pm UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446/3 "2012-08-22T12:00:22Z")

</div>

What do you think about the possibility to assign the return code to a variable?

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [August 23, 2012, 7:09am UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446/4 "2012-08-23T07:09:56Z")

</div>

I have added an option to not fail when there are no changes. Also, you can access the returncode in the AfterAction script event, eg. :   
  
 FBVariables.MYVARIABLE = Action.PropertyStore.ReturnCode;   
  
 [http://downloads.finalbuilder.com/downloads/finalbuilder/700/FB700\_1983.exe](http://downloads.finalbuilder.com/downloads/finalbuilder/700/FB700_1983.exe)

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 27, 2012, 8:38am UTC](https://www.finalbuilder.com/forums/t/mercurial-commit/3446/5 "2012-08-27T08:38:02Z")

</div>

Hi Vincent,   
  
 I used the new option not to fail if there are no changes and it does work as expected!   
  
 –   
 Thanks,   
  
 Roman
