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 71 forks source link

Problems after hg strip #247

Closed pinard closed 10 years ago

pinard commented 11 years ago

Hello there! :-)

I'm merely exploring Mercurial to access GitHub, also intending to later convert most of my local Git repositories. On a toy GitHub repository, I have four commits numbered 0 to 3, with a Mercurial local clone through hg-git. After "hg strip 1", all commits are locally gone except for the initial one. Trying "hg push" and "hg push -f" both yield:

pushing to git+ssh://git@github.com/pinard/try-github.git creating and sending data ["git-receive-pack '/pinard/try-github.git'"] abandon : unknown revision '932dcd079d4e8c00bdd9e9e5ddcfdf25773ac139' !

Then, wanting to see if "pull" will recover the stripped commits, I tried "hg pull", and got the following traceback:

pulling from git+ssh://git@github.com/pinard/try-github.git ["git-upload-pack '/pinard/try-github.git'"] * unknown exception encountered, please report by visiting * http://mercurial.selenic.com/wiki/BugTracker * Python 2.7.3 (default, Apr 20 2012, 22:44:07) [GCC 4.6.3] * Mercurial version 2.0.2, système de gestion de sources distribué * Extensions chargées : churn, color, convert, fetch, purge, graphlog, git, gpg, hgk, mq, transplant Traceback (most recent call last): File "/usr/bin/hg", line 38, in mercurial.dispatch.run() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run sys.exit(dispatch(request(sys.argv[1:]))) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch return _runcatch(req) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch return _dispatch(req) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch cmdpats, cmdoptions) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap return wrapper(origfn, _args, kwargs) File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 373, in colorcmd return orig(ui, opts, cmd, cmdfunc) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand return checkargs() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs return cmdfunc() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in d = lambda: util.checksignature(func)(ui, _args, _cmdoptions) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check return func(_args, _kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap util.checksignature(origfn), _args, _kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check return func(_args, _kwargs) File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3229, in mqcommand return orig(ui, repo, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check return func(_args, _kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 4247, in pull modheads = repo.pull(other, heads=revs, force=opts.get('force')) File "/usr/lib/python2.7/dist-packages/hgext/git/hgrepo.py", line 14, in pull return git.fetch(remote.path, heads) File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 154, in fetch self.import_git_objects(remote_name, refs) File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 531, in import_git_objects if name in self.repo._tagtypes: AttributeError: 'mqrepo' object has no attribute '_tagtypes'

François

P.S. Who also want to thank whoever is behind these Git-Mercurial communication facilities. It worked rather nicely, so far in my few tries!

Stelzi79 commented 10 years ago

a hg gclear should do the trick

pinard commented 10 years ago

Well, even if "hg gclear" would do the trick (I did not try, as I stopped using Mercurial for most of my works), "hg pull" should give some clear diagnostic or suggestion. A traceback is never the proper way for a tool to help the end user. You may consider the issue closed, but you'll agree that the problem has not been addressed nor repaired.

durin42 commented 10 years ago

https://twitter.com/durin42/status/411914653820674049

On Dec 14, 2013, at 12:54 PM, François Pinard notifications@github.com wrote:

Well, even if "hg gclear" would do the trick (I did not try, as I stopped using Mercurial for most of my works), "hg pull" should give some clear diagnostic or suggestion. A traceback is never the proper way for a tool to help the end user. You may consider the issue closed, but you'll agree that the problem has not been addressed nor repaired.


Reply to this email directly or view it on GitHub: https://github.com/schacon/hg-git/issues/247#issuecomment-30581961