schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 72 forks source link

Seems git+file:// scheme doesn't work #321

Open etosan opened 7 years ago

etosan commented 7 years ago

I tried several approaches, but I would really like to have personal git repo alongside hg clone of upstream.

Given upstream project is hg, I would like to hg be able to push into my git clone.

So I learned I need this "plugin". I installed hg-git. Did the bookmark thing and defined "pushpoint" by adding default:pushrl= into [paths] in ./.hg/hgrc.

Now what am I supposed to put there for local paths? Unless I specify file:// scheme, hg complains that target is not url. But when I try to do git+file:// (trying to indicate to plugin that this is indeed a "git path") it complains "Repository not found"

marutosi commented 7 years ago

You don't need any prefix. Just path as /example/path .

etosan commented 6 years ago

hmm call me idiot, but it doesn't seem to work for me. Can you please confirm it works on your system?

marutosi commented 6 years ago
$ git init --bare test
Initialized empty Git repository in /tmp/test/test/
$ hg clone --config extensions.git=/somewhere/hg-git/hggit test/ test-hg
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
marutosi commented 6 years ago
$ hg --cwd test-hg/ path
default = /tmp/test/test
marutosi commented 6 years ago
$ hg -R test-hg/ --config extensions.git=/somewhere/hg-git/hggit in
comparing with /tmp/test/test
no changes found
schneflocke commented 6 years ago

Seems I have the same problem; a clone from a server (hg clone git://github.com/schacon/hg-git.git "D:\hggit") works fine, but clones from a local repository fails. I tried many, many variants...

From the different error messages I came to understand that I need to include paths in quotation marks (I run Windows 10, TortoiseHg 4.5, Mercurial 4.5). As @marutosi doesn't use drive letters, I wonder if this is a Windows issue?

The variants

both results in the error below (any relation to issue 317?):

[edit: the solution from stackexchange doesn't work either; also tried to replace all "\" in the path with "/"...]

** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (Version 4.5)
** Extensions loaded: extdiff, largefiles, hggit, strip, mq, tortoisehg.util.hgcommands, tortoisehg.util.partialcommit, tortoisehg.util.pipeui, tortoisehg.util.win32ill, tortoisehg.util.hgdispatch
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (Version 4.5)
** Extensions loaded: extdiff, largefiles, hggit, strip, mq, tortoisehg.util.hgcommands, tortoisehg.util.partialcommit, tortoisehg.util.pipeui, tortoisehg.util.win32ill, tortoisehg.util.hgdispatch
Traceback (most recent call last):
  File "hg", line 61, in <module>
  File "mercurial\dispatch.pyo", line 88, in run
  File "mercurial\dispatch.pyo", line 183, in dispatch
  File "mercurial\dispatch.pyo", line 324, in _runcatch
  File "mercurial\dispatch.pyo", line 332, in _callcatch
  File "mercurial\scmutil.pyo", line 154, in callcatch
  File "mercurial\dispatch.pyo", line 314, in _runcatchfunc
  File "mercurial\dispatch.pyo", line 918, in _dispatch
  File "mercurial\dispatch.pyo", line 673, in runcommand
  File "mercurial\dispatch.pyo", line 926, in _runcommand
  File "mercurial\dispatch.pyo", line 915, in <lambda>
  File "mercurial\util.pyo", line 1195, in check
  File "mercurial\util.pyo", line 1195, in check
  File "hgext\mq.pyo", line 3583, in mqcommand
  File "mercurial\util.pyo", line 1195, in check
  File "mercurial\commands.pyo", line 4763, in serve
  File "mercurial\server.pyo", line 107, in runservice
  File "mercurial\commandserver.pyo", line 339, in run
  File "mercurial\commandserver.pyo", line 292, in serve
  File "mercurial\commandserver.pyo", line 267, in serveone
  File "mercurial\commandserver.pyo", line 251, in runcommand
  File "mercurial\dispatch.pyo", line 183, in dispatch
  File "mercurial\dispatch.pyo", line 324, in _runcatch
  File "mercurial\dispatch.pyo", line 332, in _callcatch
  File "mercurial\scmutil.pyo", line 154, in callcatch
  File "mercurial\dispatch.pyo", line 314, in _runcatchfunc
  File "tortoisehg\util\hgdispatch.pyo", line 23, in _dispatch
  File "mercurial\dispatch.pyo", line 918, in _dispatch
  File "mercurial\dispatch.pyo", line 673, in runcommand
  File "mercurial\dispatch.pyo", line 926, in _runcommand
  File "mercurial\dispatch.pyo", line 915, in <lambda>
  File "mercurial\util.pyo", line 1195, in check
  File "mercurial\util.pyo", line 1195, in check
  File "hgext\largefiles\overrides.pyo", line 874, in overrideclone
  File "mercurial\util.pyo", line 1195, in check
  File "mercurial\commands.pyo", line 1449, in clone
  File "hgext\largefiles\overrides.pyo", line 877, in hgclone
  File "mercurial\hg.pyo", line 661, in clone
  File "hggit\util.pyo", line 56, in inner
  File "hggit\__init__.pyo", line 354, in exchangepull
  File "hggit\git_handler.pyo", line 271, in fetch
  File "hggit\git_handler.pyo", line 1230, in fetch_pack
  File "dulwich\client.pyo", line 727, in fetch_pack
  File "dulwich\client.pyo", line 914, in _connect
  File "dulwich\client.pyo", line 885, in find_git_command
pywintypes.error: (2, 'FindExecutable', 'The System cannot find the file.')
cmdserver: Process aborted unexpectedly with Code 255
dovf commented 6 years ago

This may be fixed by the patch I just sent to the mailing list: https://groups.google.com/forum/#!topic/hg-git/7RHlqTP9HOk

Hope this helps!