mnauw / git-remote-hg

Transparent bidirectional bridge between Git and Mercurial for Git
GNU General Public License v2.0
62 stars 5 forks source link

"git push" fails with "ValueError: string too long" #12

Closed alexbarton closed 6 years ago

alexbarton commented 6 years ago
searching for changes
no changes found
Traceback (most recent call last):
  File "/usr/local/bin/git-remote-hg", line 1785, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/git-remote-hg", line 1770, in main
    do_push(parser)
  File "/usr/local/bin/git-remote-hg", line 1548, in do_push
    do_push_refspec(parser, line.lstrip('push '), localrevs)
  File "/usr/local/bin/git-remote-hg", line 1475, in do_push_refspec
    ok = do_push_hg(nparser)
  File "/usr/local/bin/git-remote-hg", line 1278, in do_push_hg
    parse_commit(parser)
  File "/usr/local/bin/git-remote-hg", line 1023, in parse_commit
    node = hghex(repo.commitctx(ctx))
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 142, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 1950, in commitctx
    trp, changed)
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 1702, in _filecommit
    flog = self.file(fname)
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 1022, in file
    return filelog.filelog(self.svfs, f)
  File "/usr/local/lib/python2.7/site-packages/mercurial/filelog.py", line 45, in __init__
    "/".join(("data", path + ".i")))
  File "/usr/local/lib/python2.7/site-packages/mercurial/revlog.py", line 624, in __init__
    f = self.opener(self.indexfile)
  File "/usr/local/lib/python2.7/site-packages/mercurial/store.py", line 492, in __call__
    return self.vfs(self.encode(path), mode, *args, **kw)
ValueError: string too long

Mercurial 4.5, Git 2.14.3, on macOS 10.13.3.

alexbarton commented 6 years ago

This seems to be an incompativility with Mercurial 4.5: downgarding it back to 4.4.2 "solves" the issue (at least for me).

You can do this with the following commands when using Homebrew on macOS:

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
brew remove mercurial
git checkout 8fbbe1f571ac014dfe00e589930b6ec6f7ffd7d8 Formula/mercurial.rb
brew install mercurial
brew pin mercurial
git reset --hard

(Homebrew commit 8fbbe1f571ac014dfe00e589930b6ec6f7ffd7d8 is the "bottle" of Mercurial 4.4.2.)

mnauw commented 6 years ago

Yeah, something changed in the internals there, still figuring out what and where exactly to get this going again ...

alexbarton commented 6 years ago

Wow that's a quick fix @mnauw! I can confirm that this solves my issue – thanks a lot!