Issue #354 invalid

rebuildmeta can fail to process .hgtags

StephenKestle
created an issue

{{{ unknown exception encountered, please report by visiting http://mercurial.selenic.com/wiki/BugTracker Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] Mercurial Distributed SCM (version 2.1) Extensions loaded: hgsubversion, histedit, collapse, rebase, transplant, mq, purge, git, hgk, record Traceback (most recent call last): File "/usr/bin/hg", line 38, in <module> mercurial.dispatch.run() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch return _runcatch(req) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch return _dispatch(req) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 683, in _dispatch cmdpats, cmdoptions) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 465, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 737, in _runcommand return checkargs() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 691, in checkargs return cmdfunc() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 680, in <lambda> d = lambda: util.checksignature(func)(ui, *args, cmdoptions) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 456, in check return func(args, kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap util.checksignature(origfn), *args, kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 456, in check return func(args, kwargs) File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3325, in mqcommand return orig(ui, repo, *args, kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 456, in check return func(*args, kwargs) File "/home/stephenk/hg/hgsubversion/hgsubversion/svncommands.py", line 473, in svn return commandfunc(ui, args=args, repo=repo, opts) File "/home/stephenk/hg/hgsubversion/hgsubversion/svncommands.py", line 38, in rebuildmeta return _buildmeta(ui, repo, args, partial=False) File "/home/stephenk/hg/hgsubversion/hgsubversion/svncommands.py", line 145, in _buildmeta ha, tag = newtag.split(' ', 1) ValueError: need more than 1 value to unpack }}}

{{{hd .hgtags}}} shows that my last character (on linux) is '0a' (line feed). I don't know whether this is because I've cloned from a windows svn+hg clone.

Comments (5)

  1. StephenKestle reporter

    Pull request rejected ;( (for good reason).

    I've done what I can for now... identifying and fixing this issue satisfies my needs; to write test cases I would want to know exactly how this was caused.

    Which will probably happen eventually once I see other people's OS behaviour with new and/or corrupted repos.

  2. Patrick Mézard

    I have absolutely no idea how to reproduce this. I suspect it comes from a bug in .hgtags generation which may have been fixed since then: - Tags generated on hg side have no effect on subversion, do not have converted revision information and are ignored by rebuildmeta. At first I thought I could trick rebuildmeta by creating a tag on the hg side and overwriting it on subversion side but the parent resolution is correct and the first tag file ignored. - Tags brought from subversion are theorically sanitized before being serialized into a .hgtags. There might be bugs here but unless there is a clear report I see no reason to harden the reading code.

    So closing unless someone knows how to reproduce this.

  3. Log in to comment