[issue2884] regression with mq patches with dashes in their names

tomba bugs at mercurial.selenic.com
Tue Jul 5 20:22:08 CDT 2011


New submission from tomba <1ipsfgq02 at sneakemail.com>:

Explained by example:
A script to prepare a repository:

--------------------------------
hg init

echo l-1 > f
hg add f
hg qnew some-bug-fix

echo l-2 >> f
hg qnew idea-start

echo l-3 >> f
hg qnew idea-improved
--------------------------------

Trying to see the diff of combined changes by all idea-* patches:
This used to work in Mercurial 1.8.4 with parentrevspec extension but gives
an error in 1.9:

$ hg diff -r idea-start^:idea-improved
abort: unknown revision 'idea'!

This is a regression. I carry around tens of patches, all of them with
dashes in their names as word separators.

One could try to work around this by adding a lot of ugly quotes and
backslash escapes:

hg diff -r \'idea-start\'^:\'idea-improved\'

However, even this doesn't work, and throws an exception:

** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.4.3 (#1, Sep  3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat
4.1.2-46)]
** Mercurial Distributed SCM (version 1.9)
** Extensions loaded: extdiff, graphlog, hgk, record, transplant, mq, color,
rpcath, rebase, convert, children, schemes, progress, patience
Traceback (most recent call last):
  File "/home/tomba/mercurial/bin/hg", line 38, in ?
    mercurial.dispatch.run()
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 27, in run
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 64, in dispatch
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 87, in _runcatch
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 675, in _dispatch
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 454, in runcommand
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/extensions.py", line
182, in wrap
  File "home/tomba/mercurial/lib64/python2.4/site-packages/hgext/color.py",
line 367, in colorcmd
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 729, in _runcommand
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 683, in checkargs
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/dispatch.py",
line 672, in <lambda>
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/util.py", line
385, in check
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/extensions.py", line
136, in wrap
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/util.py", line
385, in check
  File "/home/tomba/hg/hg-patience/patience.py", line 66, in diffcmdwrapper
    ret = orig(*args, **kwargs)
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/util.py", line
385, in check
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/extensions.py", line
136, in wrap
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/util.py", line
385, in check
  File "home/tomba/mercurial/lib64/python2.4/site-packages/hgext/mq.py",
line 3218, in mqcommand
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/util.py", line
385, in check
  File "/usr/lib64/python2.4/commands.py", line 2188, in diff
    
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/scmutil.py",
line 486, in revpair
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/scmutil.py",
line 539, in revrange
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/revset.py",
line 1017, in mfunc
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/revset.py",
line 120, in getset
  File
"home/tomba/mercurial/lib64/python2.4/site-packages/mercurial/revset.py",
line 676, in parentspec
TypeError: int() argument must be a string or a number

The exception is a secondary issue. The main issue is that specifying parent
revision with ^ stopped working when using mq patch names with dashes as
word separators.

----------
messages: 16711
nosy: tomba
priority: bug
status: unread
title: regression with mq patches with dashes in their names

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2884>
____________________________________________________


More information about the Mercurial-devel mailing list