Closed eigengrau closed 5 years ago
I just tested this and it works as a fix for me.
I just added:
if hasattr(a, 'rev'):
a = a.rev()
b = b.rev()
To the getrange
function to check if there is a rev attribute/function that it can call. I am not 100% sure what was getting passed before or if that is sufficient to guard calling the rev
method.
This solves the problem also for me.
I would check the presence of rev
in both a
and b
.
@matthewfl patch worked for me also
Still doesn't work for me:
$ git clone "hg::https://bitbucket.org/capitalmatch/webdriver-utils" 3rdparty/webdriver-utils
Cloning into '3rdparty/webdriver-utils'...
requesting all changes
adding changesets
adding manifests
adding file changes
added 124 changesets with 207 changes to 37 files (+1 heads)
new changesets a137b649f934:a8b15525a1cc
progress revision 99 'master' (100/122)
WARNING: Branch 'default' has more than one head, consider merging
Traceback (most recent call last):
File "/usr/host/bin/git-remote-hg", line 1348, in <module>
sys.exit(main(sys.argv))
File "/usr/host/bin/git-remote-hg", line 1332, in main
do_import(parser)
File "/usr/host/bin/git-remote-hg", line 737, in do_import
export_tag(repo, tag)
File "/usr/host/bin/git-remote-hg", line 614, in export_tag
export_ref(repo, tag, 'tags', repo[hgref(tag)])
File "/usr/x86_64-pc-linux-gnu/lib/python2.7/site-packages/mercurial/localrepo.py", line 856, in __getitem__
return context.changectx(self, changeid)
File "/usr/x86_64-pc-linux-gnu/lib/python2.7/site-packages/mercurial/context.py", line 439, in __init__
(changeid, type(changeid)))
mercurial.error.ProgrammingError: unsupported changeid 'v0.1.0' of type <type 'str'>
fatal: stream ends early
fast-import: dumping crash report to /home/hasufell/git/CM_app/app/3rdparty/webdriver-utils/.git/fast_import_crash_22867
fatal: error while running fast-import
Even tried forks of this repo, all are broken.
These issues are due to changes in recent Mercurial's internal API. They have also been reported as issues in this fork and are already fixed there (along with many other ones), see also generally #69.
fork worked for me @mnauw, thank you guys very much!!!!
def gitrange(repo, a, b): a = a.rev() b = b.rev() …
This is the correct fix: 00e95fd8df745db297eab035b31af8a518627bb1.
Should be fixed in v0.4.
Still doesn't work for me:
Even tried forks of this repo, all are broken.
Your's a separate issue fixed in c95fba3c184128599f73c45ca6a3c32e0bd7f87e.
Both of those issues should work in v0.4.
With git-remote-hg (HEAD) and mercurial 4.6, git fetch yields:
I haven’t dug deeper, but I suspect mercurial is now encapsulating revisions in
changectx
objects, where it passed hashes before.In my case, it looks like unwrapping the
a
,b
arguments togitrange
resolves this.I’d open a PR, but I suspect you’ll want to guard this for backwards compatibility somehow.