Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revsymbol not found #132

Closed
aditya-shah73 opened this issue Jun 20, 2018 · 19 comments · Fixed by samgiagtzoglou/fast-export#1
Closed

revsymbol not found #132

aditya-shah73 opened this issue Jun 20, 2018 · 19 comments · Fixed by samgiagtzoglou/fast-export#1
Labels
invalid The problem is caused by not meeting the documented requirements or badly configured dependencies need-more-info The maintainer waits for a reply from the ticket creator user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export

Comments

@aditya-shah73
Copy link

I keep getting this issue:

Traceback (most recent call last):
File "/Users/adshah/Desktop/fast-export/hg-fast-export.py", line 7, in
from mercurial.scmutil import revsymbol
ImportError: cannot import name revsymbol
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-fast-import statistics:

@ghost
Copy link

ghost commented Jun 22, 2018

Same error on Ubuntu Xenial.

@frej frej added user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export need-more-info The maintainer waits for a reply from the ticket creator labels Jun 22, 2018
@frej
Copy link
Owner

frej commented Jun 22, 2018

[This is a canned reply to issues that contain too little information for effective troubleshooting]

Please have a look at this blog post about writing effective bug reports. For fast-export you should at least:

  • Check that you are using the latest released hg-fast-export.

  • Check that your installed versions of Python and Mercurial meet the minimum requirements as specified in the README.

  • Explain what you are trying to do, how you are doing it and in what environment.

  • If your source repository is publicly available, give the URL.

  • If hg-fast-export gives an error message and a backtrace, include that in the issue.

chris-morgan added a commit to chris-morgan/fast-export that referenced this issue Jun 25, 2018
e200cec broke mercurial<4.6 support,
which was a Bad Thing. Linuxy types particularly are used to being able
to use the mercurial package from their OS package manager, rather than
needing to mess around with installing extra packages from pip (which is
normally a disaster if you’re not a Python programmer and used to
messing around with virtualenvs or similar), and almost none of those
have Mercurial 4.6 yet. (Ubuntu, for example, is on 4.5.3 in 18.04 LTS,
and 3.7.3 in 16.04 LTS. So probably having 4.6 or later is about two and
a half to four years off!)

The differences in Mercurial 4.6 are small enough that restoring support
is not difficult, and it makes it work for everyone, so it’s worth
doing.

Fixes frej#132.
@chris-morgan
Copy link

v180610 broke support for Mercurial < 4.6 due to e200cec, which is going to affect almost everyone in practice because almost no one has Mercurial 4.6 already.

You have three primary options to work around this:

  • Install mercurial 4.6 via pip (if you don’t know what you’re doing with pip, I recommend against this, because global installs are a mess);
  • Downgrade fast-export to v180317;
  • Include my patch at Restore support for mercurial<4.6 #133.

@Orabig
Copy link

Orabig commented Jun 29, 2018

I do confirm that downgrading fast-export works well. Installing additional packages when trying to migrate an old mercurial repository is generally not a good option, given that fast-export will be used in a one-shot process.

So my procedure becomes :

~$ git clone https://github.com/frej/fast-export.git
~$ cd fast-export
~$ git checkout tags/v180317
~$ cd ..
~$ mkdir new_git_repo
~$ cd new_git_repo
~$ git init
~$ ../fast-export/hg-fast-export.sh -r /old_hg_repo/

@chris-morgan
Copy link

Why close this? It’s still a serious issue, affecting almost everyone on Linux that uses Mercurial.

@camuso
Copy link

camuso commented Jul 16, 2018

OK, I downgraded to version v180317, and the problem is gone.

chris-morgan is correct. This bug needs to be fixed.

@nobody93
Copy link

I've just made a clone from master branch as of today 17 July 2018, I still have following error, is it fixed in master branch or should I go to some branch?

fast-export/hg-fast-export.py", line 7, in
from mercurial.scmutil import revsymbol
ImportError: cannot import name revsymbol

@Orabig
Copy link

Orabig commented Jul 18, 2018

It is not fixed yet in the master branch.
As I said above, you should checkout tags/v180317 to have a working version.

@slxiao
Copy link

slxiao commented Jul 18, 2019

Checking out to tags/v180317 works but when command ../fast-export/hg-fast-export.sh is finished, the files in current directory are all deleted, and I have to run git stash to recover the files.

@eirnym
Copy link

eirnym commented Aug 23, 2019

@slxiao it's better to fill new issue to really track it.

@uthadehikaru
Copy link

@slxiao you have to run "git checkout HEAD" and voila, the file comes out

@ooxi
Copy link

ooxi commented Dec 18, 2019

Can this be fixed in master? Otherwise using the git manual's suggested approach is broken on the current Ubuntu LTS (18.04).

@chris-morgan's workaround worked btw.

@alexanpe
Copy link

alexanpe commented Feb 4, 2020

I encountered this problem today. For it not to have been resolved in master in 18 months does seem a little odd.

@frej
Copy link
Owner

frej commented Feb 4, 2020

@alexanpe: See this comment in PR #132 for why there is no support for old Mercurial revisions.

@frej frej added the invalid The problem is caused by not meeting the documented requirements or badly configured dependencies label Feb 4, 2020
@ooxi
Copy link

ooxi commented Feb 6, 2020

@frej So first upgrading the mercurial repository and then executing fast-export should work? How about probing the repository version first and then hinting a need to upgrade to the user?

@zerkms
Copy link

zerkms commented Feb 20, 2020

For those who are as me stuck with not being able to upgrade mercurial - I created a docker image https://hub.docker.com/r/zerkms/hg-fast-export

@pqr
Copy link

pqr commented Feb 21, 2020

For those who are as me stuck with not being able to upgrade mercurial - I created a docker image https://hub.docker.com/r/zerkms/hg-fast-export

Great image, thank you!

But when I first run your container I got an error:

Status: Downloaded newer image for zerkms/hg-fast-export:latest
Error: The option core.ignoreCase is set to true in the git
repository. This will produce empty changesets for renames that just
change the case of the file name.
Use --force to skip this check or change the option with
git config core.ignoreCase false

So I created a Dockerfile with "--force" option:

FROM zerkms/hg-fast-export:latest
ENTRYPOINT ["/app/hg-fast-export.sh", "-r", "/hg", "--force"]

My be it's a good idea to add "--froce" to your docker image too?

@zerkms
Copy link

zerkms commented Feb 22, 2020

@pqr from the source code it looks like force disables some other checks as well. You could just add --force when you docker run the container.

@nogu3ira
Copy link

nogu3ira commented Jul 9, 2020

To fix:

sudo apt-get update
sudo apt-get install python-pip
pip install --upgrade Mercurial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid The problem is caused by not meeting the documented requirements or badly configured dependencies need-more-info The maintainer waits for a reply from the ticket creator user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export
Projects
None yet