Bug 4513 - 'hg add' aborts in repo with non-Hg subrepos
Summary: 'hg add' aborts in repo with non-Hg subrepos
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.3-rc
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-27 03:17 UTC by Vladimir
Modified: 2015-01-29 01:13 UTC (History)
3 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 Vladimir 2015-01-27 03:17 UTC
Trying to add files aborts with TypeError.

11:15:07 etc/❯ hg st -u
? xresources/tmuxcolors-dark.conf
? xresources/tmuxcolors-light.conf

11:15:45 etc/❯ LANGUAGE=C hg add .
adding xresources/tmuxcolors-dark.conf
adding xresources/tmuxcolors-light.conf
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.8 (default, Oct 20 2014, 15:05:29) [GCC 4.9.1]
** Mercurial Distributed SCM (version 3.3-rc+39-0c4419faacbc)
** Extensions loaded:
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 71, in dispatch
    ret = _runcatch(req)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 860, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 621, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 951, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 922, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 857, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 711, in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 202, in add
    rejected = cmdutil.add(ui, repo, m, "", False, **opts)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/cmdutil.py", line 2010, in add
    bad.extend(sub.add(ui, submatch, prefix, True, **opts))
TypeError: add() got an unexpected keyword argument 'exclude'
Comment 1 Vladimir 2015-01-27 03:19 UTC
On hg version 3.2.4 everything works as expected.
Comment 2 Vladimir 2015-01-27 03:31 UTC
'hg bisect` points on this revision: http://selenic.com/repo/hg/rev/9994f45ba714.
Comment 3 Vladimir 2015-01-27 03:41 UTC
It seems that only repos with subrepos are affected.
Comment 4 Augie Fackler 2015-01-27 09:58 UTC
Is xresources a subrepo directory in this case?
Comment 5 Augie Fackler 2015-01-27 10:02 UTC
Note that I can't figure out a reproduction for this. Can you give us some clearer steps? Do you have an alias set for 'hg add' or something that's adding some extra parameters?
Comment 6 Vladimir 2015-01-27 11:22 UTC
(In reply to comment #4)
No, it's not. This repo has Git subrepo. Also I've tried repo with Subversion subrepos. I haven't tried Hg subrepos.
Comment 7 Matt Harbison 2015-01-27 11:26 UTC
(In reply to comment #6)

OK, that makes sense.  It looks like I forgot to change the signature on the base class, and only hgsubrepo implements its own add method.  I'll fix it tonight if nobody beats me to it.
Comment 8 Augie Fackler 2015-01-27 11:26 UTC
Yup, got it with a git subrepo. Confirmed.
Comment 9 Vladimir 2015-01-27 11:51 UTC
(In reply to comment #5)
I have only these aliases in my .hgrc:

-------
[alias]
slog = log --template '{rev}:{node|short} {author} {date|shortdate} {desc|firstline} ({branch}) [{bookmarks}]\n'
show = log --patch --verbose --rev
-------

Not sure about 'clearer steps'. I updated Hg to tip version (make clean && make all && sudo make install) and continued to use it as usual. Until I tried to add files to the repo. I removed all Hg related files in /usr/local/lib/python2.7, reinstalled Hg and turned off all extensions, but it didn't help.

Before I turned off all extensions, Hg pointed on hgsubversion as a source of error. Hgsubversion installed in my user .local folder.

Tomorrow I'll try to reproduce the bug with new repo with hgsubversion removed from PYTHONPATH.
Comment 10 HG Bot 2015-01-28 15:15 UTC
Fixed by http://selenic.com/repo/hg/rev/8f02682ff3b0
Matt Harbison <matt_harbison@yahoo.com>
subrepo: don't abort in add when non-hg subrepos are present (issue4513)

This change should have been part of 9994f45ba714.

(please test the fix)
Comment 11 Vladimir 2015-01-29 01:13 UTC
Works for me now. Thanks.