Description of problem: create a hg repo create a file in it. Clone it to a git repo change the file and add a new one. Pushing back to hg fails Version-Release number of selected component (if applicable): git.x86_64 2.4.3-6.fc22 git-remote-hg.noarch 0.2-5.fc22 mercurial.x86_64 3.3.3-1.fc22 How reproducible: 100% Steps to Reproduce: hg init hg.repo cd hg.repo echo "Test hg <--> git" > readme.txt hg add readme.txt hg commit -m "hg commit" cd .. git clone hg::hg.repo git.repo cd git.repo echo "git change" >> readme.txt echo "Nothing to install" >> install git add install git commit -a -m "git commit" git push hg::../hg.repo Actual results: push fails as below: Traceback (most recent call last): File "/usr/bin/git-remote-hg", line 1318, in <module> sys.exit(main(sys.argv)) File "/usr/bin/git-remote-hg", line 1304, in main do_export(parser) File "/usr/bin/git-remote-hg", line 1101, in do_export parse_reset(parser) File "/usr/bin/git-remote-hg", line 884, in parse_reset parse_commit(parser) File "/usr/bin/git-remote-hg", line 872, in parse_commit node = hghex(repo.commitctx(ctx)) File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 64, in wrapper return orig(repo.unfiltered(), *args, **kwargs) File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1455, in commitctx trp, changed) File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1238, in _filecommit if fparent2 != nullid or flog.cmp(fparent1, text) or meta: File "/usr/lib64/python2.7/site-packages/mercurial/filelog.py", line 80, in cmp if text.startswith('\1\n'): AttributeError: 'bool' object has no attribute 'startswith' error: failed to push some refs to 'hg::../hg.repo' Expected results: Push should succeed Additional info:
Created attachment 1094828 [details] input for git-remote-hg So from my investigation not sure yet if it is bug for git-remote-hg or mercurial itself - it is likelier 2nd option. Inside git-remote-hg is important line 865, where is created object ctx (class memctx in context). Input seems OK and in ctx._data should be stored some string. However there is bool False - that's whole problem. I can't debug creation of object step by step due to troubles/exceptions(? don't remember result now) inside, but you can try "next" sucessfully and check created object. For easier testing added attachment which contains example, what is awaited on stdin of git-remote-hg - otherwise you will need modify script /usr/bin/git-remote-hg to get some usefull information, if you use just git. run git-remote-hg from git repository (see reproducer above) like: $ GIT_DIR=.git git-remote-hg 'hg::../hg.repo' '../hg.repo' My next idea / plans: - check how mercurial creates this object / commits - check upstream for changes (yeah, I haven't checked this yet) I will be glad for help with investigation due to time deficit.
P.S. in attachment missing some empty lines on the EOF, just add it to you file or push enter few times (>= 1)
Add Neal to CC list as mercurial maintainer.
P.P.S - If you go through actual traceback, probably you solved the problem. For complete push directly with git-remote-hg you will need do some another steps, but you can try again just: $ git push hg::../hg.repo to see the result.
Created attachment 1099700 [details] patch Mercurial changed API and context.memfilectx requires new parameter "repo" as first. Thanks Tomas Tomecek for help.
git-remote-hg-0.2-6.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-b59ee5851b
git-remote-hg-0.2-6.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update git-remote-hg' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-b59ee5851b
git-remote-hg-0.2-7.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update git-remote-hg' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-45c6241f40
git-remote-hg-0.2-7.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
git-remote-hg-0.2-6.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.