Bug 4190 - Backout can generate a backtrace if commit is a no-op
Summary: Backout can generate a backtrace if commit is a no-op
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 2.9.1
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 13:37 UTC by Matt Mackall
Modified: 2014-07-19 14:17 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Mackall 2014-03-05 13:37 UTC
Backtrace from #4189:

   #!python
    ** Mercurial version (2.7.2).  TortoiseHg version (2.9.2)
    ** Command: --nofork workbench
    ** CWD: C:\Users\Ed\Documents\Visual Studio 2012\Projects\FrEee
    ** Encoding: cp1252
    ** Extensions loaded: hgsubversion, hggit, rebase, mq, attic
    ** Python version: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
    ** Windows version: sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
    ** Processor architecture: x64
    ** Qt-4.8.4 PyQt-4.10.2 QScintilla-2.7.2
    Traceback (most recent call last):
      File "tortoisehg\hgqt\thread.pyo", line 283, in run
      File "tortoisehg\util\hglib.pyo", line 884, in dispatch
      File "mercurial\dispatch.pyo", line 778, in _dispatch
      File "mercurial\dispatch.pyo", line 549, in runcommand
      File "mercurial\dispatch.pyo", line 869, in _runcommand
      File "mercurial\dispatch.pyo", line 840, in checkargs
      File "mercurial\dispatch.pyo", line 775, in <lambda>
      File "mercurial\util.pyo", line 507, in check
      File "mercurial\extensions.pyo", line 143, in wrap
      File "mercurial\util.pyo", line 507, in check
      File "hgext\mq.pyo", line 3533, in mqcommand
      File "mercurial\util.pyo", line 507, in check
      File "mercurial\commands.pyo", line 482, in backout
      File "mercurial\cmdutil.pyo", line 1900, in commitstatus
    TypeError: __int__ returned non-int (type NoneType)

Here, backout gets None from cmdutil.commit and passes it to cmdutil.commitstatus.
Comment 1 HG Bot 2014-04-01 19:00 UTC
Fixed by http://selenic.com/repo/hg/rev/3f83fc5cfe71
Yuya Nishihara <yuya@tcha.org>
backout: correct commit status of no changes made (BC) (issue4190)

If backout generated no changes to commit, it showed wrong status, "changeset
<target> backs out changeset <target>", and raised TypeError with -v option.

This changes the return code to 1, which is the same as "hg commit" and
"hg rebase".

(please test the fix)