Every repository with this icon (
Every repository with this icon (
| Description: | mercurial to git bridge, pushed to directly from the hg-git plugin in Hg edit |
-
I just tried importing the eigen2 repository, http://bitbucket.org/eigen/eigen2/, and encountered a problem at the hg gpush stage,
This is with mercurial 1.2.1, python 2.6. Please let me know if you need any more details to reproduce. This plugin looks great and I hope to be able to use it. I know that eigen was tough to convert as it is derived from an import fromt the KDE SVN repo.
Comments
-
For large hg repositories, memory consumption of hg gexport can get excessive.
Comments
-
i'm working with a large repo (170mb in my .hg dir) with a lot of history and binary data. pushing a simple one line text change to my remote git repo takes almost 25 minutes. is the plugin is re-uploading the entire repo? is there anything i can do to prep my repo in hg to speed this up? is this problem related to the "thin pack" todo item? if so, i'm curious what the technical hurdle was that prevented thin packing from being implemented in the first place.
Comments
-
Cool plugin. I got it working for a GitHub repository, but when I tried cloning one from Heroku I got the following error. Heroku says I'm fetching an invalid path.
When I use git to clone the repository with the same Git URL it works. Anyone get this working? I know this usage is probably kind of non-standard. ;)
hg gclone git@heroku.com:repository-name.git fetching from : origin importing Hg objects into Git Invalid path. Syntax is: git@heroku.com:<app>.git where <app> is your app's name ** unknown exception encountered, details follow ** report bug details to http://www.selenic.com/mercurial/bts ** or mercurial@selenic.com ** Mercurial Distributed SCM (version 1.2.1) ** Extensions loaded: churn, fetch, bookmarks, hg-git, hgk Traceback (most recent call last): File "/opt/local/bin/hg", line 27, in <module> mercurial.dispatch.run() File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 16, in run sys.exit(dispatch(sys.argv[1:])) File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 25, in dispatch return _runcatch(u, args) File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 41, in _runcatch return _dispatch(ui, args) File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 372, in _dispatch return runcommand(lui, repo, cmd, fullargs, ui, options, d) File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 247, in runcommand ret = _runcommand(ui, options, cmd, d) File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 417, in _runcommand return checkargs() File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 377, in checkargs return cmdfunc() File "/opt/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 371, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/opt/local/lib/python2.5/site-packages/mercurial/util.py", line 718, in check return func(*args, **kwargs) File "/Users/look/hg-git/__init__.py", line 42, in gclone git.fetch('origin') File "/Users/look/hg-git/git_handler.py", line 105, in fetch refs = self.fetch_pack(remote_name) File "/Users/look/hg-git/git_handler.py", line 557, in fetch_pack refs = client.fetch_pack(path, determine_wants, graphwalker, f.write, sys.stdout.write) File "/Users/look/hg-git/dulwich/client.py", line 344, in fetch_pack progress) File "/Users/look/hg-git/dulwich/client.py", line 166, in fetch_pack (refs, server_capabilities) = self.read_refs() File "/Users/look/hg-git/dulwich/client.py", line 112, in read_refs for pkt in self.proto.read_pkt_seq(): File "/Users/look/hg-git/dulwich/protocol.py", line 77, in read_pkt_seq pkt = self.read_pkt_line() File "/Users/look/hg-git/dulwich/protocol.py", line 64, in read_pkt_line raise HangupException() hgext_hgext_hg-git.dulwich.errors.HangupExceptionComments
abderrahim
Mon Jun 29 14:59:05 -0700 2009
| link
try git+ssh://git@heroku.com/repository-name.git
This alone won't work, because hg-git adds a leading slash to the repo name, and Heroku doesn't like that. One of these days, I'll make the path-parsing function generic enough to understand both Github-style and Heroku-style paths. In the meantime, since I only have to push to Heroku once every few weeks, I just qpush and qpop this patch in my hg-git repo for that one special case:
diff --git a/git_handler.py b/git_handler.py --- a/git_handler.py +++ b/git_handler.py @@ -838,6 +838,6 @@ host = 'git@' + host else: host, path = uri[len(handler):].split("/", 1) - return transport(host), '/' + path + return transport(host), path # if its not git or git+ssh, try a local url.. return SubprocessGitClient(), uri -
I created a git repository which contains a branch with no ancestor (because it is, say, a documentation branch).
When I hg clone this repo the result is flattened -- hg branch reports just the default branch being around. (Which is the bug in and of itself).
I created a GitHub project all set to go, with information on how I created the branch without an ancestor (in case I did something dumb here) in the README. The repo is http://github.com/rwilcox/RPWTMP/tree/master
To Reproduce:
$ hg clone git://github.com/rwilcox/RPWTMP.git
$ hg branches # notice how there is just a default branch
$ hg log # notice that the log entries for the no_parent branch are mixed up here too.
Notes:
So I do see that hg-git has tagged the last commit on the origin/no_parent, but this is different than a named branch in HG.You can kind of pull apart the branches with this command:
$ hg update -r 0 -C
where 1 is the latest revision number on the no_parent branch, and -C is there because if you don't add it hg says: abort: crosses branches (use 'hg merge' or 'hg update -C')
$ hg branch no_parent
$ hg commit -m "make no_parent branch"
$ hg log -b no_parent # you should only see commits on the no_parent branch now
But an hg log -b no_parent will just show you the "make no_parent" branch, and hg log -b default will show you the 2 commits that were in no_parent from git.
Maybe this is by design (because you could do an hg clone to of this tag to get at the branch), but it does seem buggy to me (who uses git daily but wants to use hg more and more).
But I do hope this helps,
_Ryan WilcoxComments
abderrahim
Mon Jun 29 15:16:04 -0700 2009
| link
Yes,this is by design. Scott wants that this plugin can be used for collaboration between hg and git users, so it doesn't convert git branches to hg branches (because they are handled differently). So git branches are converted to hg bookmarks. type 'hg bookmarks' to see all the git branches. (if you have bookmarks enabled)
Even if we didn't have this constraint, converting git branches to hg branches would stop at the latest merge since we cannot determine which parent of the merge was on which branch. (this isn't a problem in your scenario)
I'm however planning to try implementing something like this some time, to see how well it goes. -
abort: data/xpinstall/wizard/unix/src2/.LIBSREQD.list.i@a0e0e8d8eeb7: no match found!
1 comment Created 3 months ago by wagerlabsIn the Mozilla Central (Firefox) hg repository, with mercurial 1.3
hg gremote add origin git@github.com:wagerlabs/mozilla-central.git
hg gpush
fetching from : origin
importing Hg objects into Git
at: 0/31754
converting revision 0
converting revision 1
abort: data/xpinstall/wizard/unix/src2/.LIBSREQD.list.i@a0e0e8d8eeb7: no match found!
Comments
Original repo at http://hg.mozilla.org/mozilla-central/
-
KeyError(hexsha) when cloning git://github.com/iwillig/fixcity.git
6 comments Created 3 months ago by slinkpI have installed the plugin snapshot
schacon-hg-git-58dfc84ba193946730524845bb12f76b8ed87375.zip.
It works for cloning some things, eg. I successfully cloned git://github.com/schacon/hg-git.gitBut if I attempt to clone git://github.com/iwillig/fixcity.git I get this exception:
$ hg clone git://github.com/iwillig/fixcity.git fetching from : origin importing Hg objects into Git Counting objects: 2013, done. Compressing objects: 100% (1544/1544), done. Total 2013 (delta 744), reused 1638 (delta 438) importing Git objects into Hg at: 0/21 ** unknown exception encountered, details follow ** report bug details to http://www.selenic.com/mercurial/bts ** or mercurial@selenic.com ** Mercurial Distributed SCM (version 1.1.2) ** Extensions loaded: color, bookmarks, hg-git Traceback (most recent call last): File "/usr/bin/hg", line 20, in <module> mercurial.dispatch.run() File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 20, in run sys.exit(dispatch(sys.argv[1:])) File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 29, in dispatch return _runcatch(u, args) File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 45, in _runcatch return _dispatch(ui, args) File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 367, in _dispatch ret = _runcommand(ui, options, cmd, d) File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 416, in _runcommand return checkargs() File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 376, in checkargs return cmdfunc() File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line 361, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/var/lib/python-support/python2.6/mercurial/util.py", line 715, in check return func(*args, **kwargs) File "/var/lib/python-support/python2.6/mercurial/commands.py", line 595, in clone update=not opts.get('noupdate')) File "/var/lib/python-support/python2.6/mercurial/hg.py", line 120, in clone src_repo = repository(ui, source) File "/var/lib/python-support/python2.6/mercurial/hg.py", line 61, in repository repo = _lookup(path).instance(ui, path, create) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/gitrepo.py", line 17, in __init__ git.fetch('origin') File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/git_handler.py", line 107, in fetch self.import_git_objects(remote_name, refs) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/git_handler.py", line 644, in import_git_objects self.import_git_commit(commit) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/git_handler.py", line 720, in import_git_commit files = self.git.get_files_changed(commit) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/repo.py", line 469, in get_files_changed all_changes.extend(filenames(otree, ptree, '')) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/repo.py", line 446, in filenames prefix + bname + '/')) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/repo.py", line 443, in filenames ctree = self.get_object(csha) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/repo.py", line 321, in get_object obj = self.object_store[sha] File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/object_store.py", line 81, in __getitem__ type, uncomp = self.get_raw(sha) File "/home/pw/Downloads/Apps/hg-git-plugin/hg-git/dulwich/object_store.py", line 210, in get_raw raise KeyError(hexsha) KeyError: '69d9bee15b622fcd92b84ca352daf654f4f5fcd9'Comments
I just tried again with hg-git tip cloned from http://bitbucket.org/Scotty/hg-git/as of revision 177:88fdcb23294e
... same problem.I should have mentioned some version info:
hg 1.1.2
python 2.6.2
ubuntu 9.04
I'm also seeing this on my local install with Dulwich 0.4.0 and hg 1.3.
durin42, did you use some tool to import your git repository from a foreign scm? I've done some checking, and it looks like the problem is from dulwich not supporting empty commits...
I have no idea - this isn't my repository. I'll file an issue with dulwich about empty commits. Thanks.
-
pushing fails when origin is relative to home folder
0 comments Created 3 months ago by jtietemaWhen adding my origin like this:
hg gremote add origin git@someserver:voidwalkers/netbeans-objective-j.gitI get this stacktrace:
fatal: '/voidwalkers/netbeans-objective-j.git': unable to chdir or not a gitarchive ** unknown exception encountered, details follow ** report bug details to http://mercurial.selenic.com/bts/ ** or mercurial@selenic.com ** Mercurial Distributed SCM (version 1.3.1) ** Extensions loaded: cutehg, fetch, color, bookmarks, hg-git Traceback (most recent call last): File "/usr/bin/hg", line 27, in mercurial.dispatch.run() File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run sys.exit(dispatch(sys.argv[1:])) File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 27, in dispatch return _runcatch(u, args) File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 43, in _runcatch return _dispatch(ui, args) File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 449, in _dispatch return runcommand(lui, repo, cmd, fullargs, ui, options, d) File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 317, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 501, in _runcommand return checkargs() File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 454, in checkargs return cmdfunc() File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 448, in d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 402, in check return func(*args, **kwargs) File "/home/jeroen/.hg/extensions/hg-git/__init__.py", line 50, in gpush git.push(remote_name) File "/home/jeroen/.hg/extensions/hg-git/git_handler.py", line 119, in push self.fetch(remote_name) # get and convert objects if they already exist File "/home/jeroen/.hg/extensions/hg-git/git_handler.py", line 105, in fetch refs = self.fetch_pack(remote_name) File "/home/jeroen/.hg/extensions/hg-git/git_handler.py", line 557, in fetch_pack refs = client.fetch_pack(path, determine_wants, graphwalker, f.write, sys.stdout.write) File "/home/jeroen/.hg/extensions/hg-git/dulwich/client.py", line 344, in fetch_pack progress) File "/home/jeroen/.hg/extensions/hg-git/dulwich/client.py", line 166, in fetch_pack (refs, server_capabilities) = self.read_refs() File "/home/jeroen/.hg/extensions/hg-git/dulwich/client.py", line 112, in read_refs for pkt in self.proto.read_pkt_seq(): File "/home/jeroen/.hg/extensions/hg-git/dulwich/protocol.py", line 77, in read_pkt_seq pkt = self.read_pkt_line() File "/home/jeroen/.hg/extensions/hg-git/dulwich/protocol.py", line 64, in read_pkt_line raise HangupException() hgext_hgext_hg-git.dulwich.errors.HangupException
When I enter the full path:
hg gremote add origin git@someserver:/home/git/voidwalkers/netbeans-objective-j.gitEverything works as expected. I'm trying to push to a bare git repository.(dunno if it matters;-)
Keep up the good work!
Comments
-
For various reasons, I use a git repository where I have to specify the --upload-pack type arguments.
Is supporting git options on the roadmap, or is there any general interest in such an enhancement?
--Hal
Comments
-
DESIGN.txtsill refers to thegclonecommand, which is gone now.Comments
-
Error cloning rails project from github
0 comments Created about 1 month ago by rockhymas -
try:except:finally: format not compatible with python 2.4
0 comments Created 16 days ago by mgannIn git_handler.py:
try: return client.fetch_pack(path, determine_wants, graphwalker, f.write, self.ui.status) except HangupException: raise hgutil.Abort("the remote end hung up unexpectedly") finally: commit()To be compatible with python 2.4, it should be nested, as such:
try: try: return client.fetch_pack(path, determine_wants, graphwalker, f.write, self.ui.status) except HangupException: raise hgutil.Abort("the remote end hung up unexpectedly") finally: commit()Comments
-
hg clone git://github.com/jchris/sofa.git gets incomplete revision history
2 comments Created 10 days ago by scoutenhg clone git://github.com/jchris/sofa.git does not work.
The cloned repo in hg has a revision history that ends in February 2009. The history as shown on github has changes as recent as October 2009. Further, the last several changes (January + February 2009) that are shown in hg do not seem to exist in the git change history.
Comments
abderrahim
Thu Nov 26 08:19:43 -0800 2009
| link
Maybe you just didn't dig enough?
The repository in question has half a dozen branches, it may be that an old branch is the tipmost (which needs to be fixed, but isn't high priority).Try "hg up -C master && hg log -f", if you see the log you think you should get, you may want to clone just the master branch (pass -r master to hg clone, or if you want it to be saved in hgrc append #master to url)
Ah, so it is. The October revisions are lost somewhere around changeset #160 in the hg clone. Doesn't inspire a lot of confidence. I went ahead and downloaded the same repo via git later and found that it didn't suit my needs, so this is probably the end of my use of hg-git for now.












I spotted the typo - I used the remote git@github.com/cryos/eigen2.git rather than git@github.com:cryos/eigen2.git. I will let you decide whether you would like to add futher error checking to this function or not (would probably be nice). Seems to have worked really well and the conversion/push went well.
There is a typo in the instructions too, I think you mean hg gpush, rather than hg push in your instructions.
please show your .hg/git-config.
btw, this hg->git conversion would be lossy (you will not get the same nodeids after backward git->hg conversion) since hg-git doesn't export unknown extras (this repo has convert_revision extra as a result of svn conversion).
See my comment above - it was a typo in the github remote. Other than the extras that are not converted, would pushing and pulling between git and hg repos still be possible?
I believe yes, unless you are going to gexport full git repo to hg (in other words, you need to have original hg repo as a base to gimport new git commits).
We have just noticed another issue - the 2.0 branch is missing. I thought branches should be supported.
i will look into the missing branch deal - named branches should be there.
Can you reverify if this is still happening?
It is tough to check, so much has changed in the plugin. I just pulled the latest hg-git, and tried,
hg push git+ssh://git@github.com/cryos/eigen2.git
I got abort: refs/tags/before-hg-migration changed on the server, please pull and merge before pushing. So I set up a new test repo. Tried the push again. It seemed to work OK, but still no 2.0 branch. Reading through the docs I am not even sure if it is supposed to now.
I tried the bookmarking thing mentioned,
hg bookmark -r 2.0 2.0-branch
That worked, but failed if I gave it the same name as the branch. I.e. 2.0. So this is far from ideal, but it is tough to tell if the docs are that up to date. It seems like the some of them still refer to gpush which seems to have been removed.
If you let me know what commands to run in sequence to import a hg repo, push the master and all branches to git and have them show up I will happily try it. It seems like I need a --all, or something like that. The tags still make it, but the branches are very important for quite a few projects where a stable branch is maintained.
It would be great to hear any thoughts you might have on this issue - or pointers to documentation. I would like to use this support more seriously for people who prefer to use Hg but allow us to host the repository using Git. Branches seem to be the missing piece of the puzzle as far as I can see.
1- named branches are supported in the sense that they aren't lost in the conversion, but they aren't treated as git branches in the conversion (only bookmarks are). This shouldn't be very difficult to fix though.
2- the refs/tags/* changed on the server is probably because it changed in hg-git (it's not yet stable, and you seem to have migrated from a very old revision).
3- about using hg but host the repo in git, there should be a consensus about using either named branches or bookmarks (using bookmarks is preferred since they emulate the git branching model)