Bug 5526 - Error trying to convert cpp-netlib git repo
Summary: Error trying to convert cpp-netlib git repo
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: convert (show other bugs)
Version: 4.0.2
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
: 5921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-06 00:44 UTC by Arun Chandrasekaran
Modified: 2018-07-16 20:15 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 Arun Chandrasekaran 2017-04-06 00:44 UTC
05-04-2017 21:30:43 arun-desk-r7 ~/code/personal/cpp$ git clone https://github.com/carun/cpp-netlib
05-04-2017 21:30:43 arun-desk-r7 ~/code/personal/cpp$ hg convert cpp-netlib cpp-netlib.hg
<1200+ commits>
756 Initial migration from Boost.Test to googletest
755 Merge pull request #576 from deanberris/0.12-devel-gtest-migration
754 Merged deanberris:0.12-devel-deprecations-and-refactorings and fixed conflicts in message_test.cpp
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
** Mercurial Distributed SCM (version 4.0.2)
** Extensions loaded: extdiff, hgk, gpg, evolve, color, graphlog, churn, purge, strip, mq, rebase, pager, convert, histedit, shelve, transplant, blackbox
Traceback (most recent call last):
  File "/usr/bin/hg", line 45, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 60, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 126, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 216, in _runcatch
    return callcatch(ui, _runcatchfunc)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 225, in callcatch
    return func()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 205, in _runcatchfunc
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 901, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 650, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 220, in closure
    return func(*(args + a), **kw)
  File "/usr/lib64/python2.7/site-packages/hgext/pager.py", line 160, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 220, in closure
    return func(*(args + a), **kw)
  File "/usr/lib64/python2.7/site-packages/hgext/color.py", line 521, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 909, in _runcommand
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 898, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 1037, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/hgext/convert/__init__.py", line 391, in convert
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
  File "/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.py", line 611, in convert
    c.convert(sortmode)
  File "/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.py", line 522, in convert
    self.copy(c)
  File "/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.py", line 490, in copy
    source, self.map, full, cleanp2)
  File "/usr/lib64/python2.7/site-packages/hgext/convert/hg.py", line 340, in putcommit
    node = nodemod.hex(self.repo.commitctx(ctx))
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 105, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1728, in commitctx
    trp, changed)
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1495, in _filecommit
    if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
  File "/usr/lib64/python2.7/site-packages/mercurial/filelog.py", line 91, in cmp
    samehashes = not super(filelog, self).cmp(node, t)
  File "/usr/lib64/python2.7/site-packages/mercurial/revlog.py", line 1006, in cmp
    p1, p2 = self.parents(node)
  File "/usr/lib64/python2.7/site-packages/mercurial/revlog.py", line 389, in parents
    d = i[self.rev(node)]
  File "/usr/lib64/python2.7/site-packages/mercurial/revlog.py", line 362, in rev
    return self._nodecache[node]
ValueError: 20-byte hash required
Comment 1 Arun Chandrasekaran 2017-04-06 00:52 UTC
Rerunning convert with 4.1.2 results in less verbose error message.

05-04-2017 21:47:14 arun-desk-r7 ~/code/personal/cpp$ hg convert cpp-netlib cpp-netlib.hg
<1200+ commits>
756 Initial migration from Boost.Test to googletest
755 Merge pull request #576 from deanberris/0.12-devel-gtest-migration
754 Merged deanberris:0.12-devel-deprecations-and-refactorings and fixed conflicts in message_test.cpp
abort: data/.hgsubstate.i@303030303030: no node!
05-04-2017 21:48:04 arun-desk-r7 ~/code/personal/cpp
$
Comment 2 Yuya Nishihara 2017-04-07 10:53 UTC
> abort: data/.hgsubstate.i@303030303030: no node!

It appears node.modifiednodeid is somehow exposed.
Comment 3 Bugzilla 2017-09-05 00:00 UTC
Bug was inactive for 150 days, archiving
Comment 4 Bugzilla 2018-02-13 00:00 UTC
Bug was inactive for 150 days, archiving
Comment 5 Yuya Nishihara 2018-06-19 07:47 UTC
*** Bug 5921 has been marked as a duplicate of this bug. ***
Comment 6 Benoit FOULETIER 2018-06-19 10:29 UTC
Maybe that helps: since I submitted bug #5921, I tried running the same repro with --verbose --debug --traceback, and got a traceback.
The commits that convert ok look like this:

1 commit from default
source: 1dc71476c7c90c30d38742af9aa5199d63c728b7
committing files:
.hgsubstate
committing manifest
committing changelog
updating the branch cache


... and the last one fails with this:

0 Merge with main-branch
source: 620bbff616a21607e8a9327c97be373e6aeabba0
resolving manifests
 branchmerge: True, force: True, partial: False
 ancestor: 5d371302b03f, local: 1dc71476c7c9, remote: 26b558f201dc
committing files:
.hgsubstate
run hg sink post-conversion action
run hg source post-conversion action
Traceback (most recent call last):
  File "mercurial\scmutil.pyo", line 160, in callcatch
  File "mercurial\dispatch.pyo", line 341, in _runcatchfunc
  File "mercurial\dispatch.pyo", line 971, in _dispatch
  File "mercurial\dispatch.pyo", line 727, in runcommand
  File "mercurial\dispatch.pyo", line 979, in _runcommand
  File "mercurial\dispatch.pyo", line 968, in <lambda>
  File "mercurial\util.pyo", line 1553, in check
  File "hgext\convert\__init__.pyo", line 442, in convert
  File "hgext\convert\convcmd.pyo", line 616, in convert
  File "hgext\convert\convcmd.pyo", line 525, in convert
  File "hgext\convert\convcmd.pyo", line 493, in copy
  File "hgext\convert\hg.pyo", line 341, in putcommit
  File "hgext\largefiles\reposetup.pyo", line 265, in commitctx
  File "hgext\eol.pyo", line 419, in commitctx
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "mercurial\localrepo.pyo", line 2052, in commitctx
  File "mercurial\localrepo.pyo", line 1859, in _filecommit
  File "mercurial\filelog.pyo", line 63, in commonancestorsheads
  File "mercurial\revlog.pyo", line 1380, in commonancestorsheads
  File "mercurial\revlog.pyo", line 812, in rev
WdirUnsupported
abort: working directory revision cannot be specified
Comment 7 Yuya Nishihara 2018-06-19 11:23 UTC
Thanks, I've sent a fix to the list.

https://patchwork.mercurial-scm.org/patch/32332/
Comment 8 Benoit FOULETIER 2018-06-19 17:02 UTC
(In reply to Yuya Nishihara from comment #7)
Awesome! How can I try this patch? Will it be in the next nightly, or can I apply it locally or something?
Comment 9 Yuya Nishihara 2018-06-20 07:32 UTC
"hg patch $PATCHFILE" or "patch -p1 < $PATCHFILE" should work.

If there's no problem, the fix will be included in the next stable release.
Comment 10 Benoit FOULETIER 2018-06-21 03:08 UTC
(In reply to Yuya Nishihara from comment #9)
Awesome, that worked, thank you so much!
I was able to successfully convert the whole 26K commits (I do see some divergence between the original and the converted, but that's another issue), now I can start stripping :).
Comment 11 HG Bot 2018-06-24 10:20 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/1322ae04d3d7
Yuya Nishihara <yuya@tcha.org>
merge: do not fill manifest of committed revision with pseudo node (issue5526)

Since a75d24539aba "convert: fix convert dropping p2 contents during filemap
merge", wctx is not always a committablectx because the convert extension
passes in repo[n] as wctx. If wctx is a committed changeset, its manifest
dict shouldn't be mutated reflecting to the working directory.

(please test the fix)
Comment 12 Bugzilla 2018-07-02 00:00 UTC
Bug was set to TESTING for 7 days, resolving