frej / fast-export

A mercurial to git converter using git-fast-import
http://repo.or.cz/w/fast-export.git
808 stars 255 forks source link

Yet another "cannot lock ref", mapping seems not to help #288

Closed raqua closed 2 years ago

raqua commented 2 years ago

I am trying to migrate and I am getting this error:

error: cannot lock ref 'refs/heads/SoapV2_before_switch_to_V3': 'refs/heads/SoapV2_before_switch_to_V3/EII-4236' exists; cannot create 'refs/heads/SoapV2_before_switch_to_V3'

I have read the docs and issues 115 and 117 and understand the problem, however, my mapping file does not seem to resolve this issue as it did for others. Contents of my mapping file:

"SoapV2_before_switch_to_V3/EII-4236"="SoapV2_before_switch_to_V3-EII-4236"
"SoapV2_before_switch_to_V3"="SoapV2_before_switch_to_V3_x"

I am running the the export like this:

~/data/sw/fast-export/hg-fast-export.sh  -r ~/1/20220613\ -\ EII-4706\ -\ Migrate\ exite2\ mercurial\ repository\ to\ gitMigrate\ exite2\ mercurial\ repository\ to\ git/exite2/ -B ~/mapping  --ignore-unnamed-heads

if I add "-n" option, it will just fail like this:

Traceback (most recent call last):
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 728, in <module>
    sys.exit(hg2git(options.repourl,m,options.marksfile,options.mappingfile,
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 581, in hg2git
    c=export_commit(ui,repo,rev,old_marks,max,c,authors,branchesmap,
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 372, in export_commit
    export_file_contents(ctx,man,changed,hgtags,fn_encoding,plugins)
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 238, in export_file_contents
    wr(d)
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 54, in wr
    wr_no_nl(msg)
  File "/mnt/data/sw/fast-export/hg-fast-export.py", line 51, in wr_no_nl
    stdout_buffer.write(msg)
BrokenPipeError: [Errno 32] Broken pipe

What am I doing wrong? Please advise. Thank you.

P.S. I am perfectly happy with just ignoring the offending branch, I don't really need it.

frej commented 2 years ago

I have read the docs and issues 115 and 117 and understand the problem

And you are sure that you're not caught out by the frequent problem described by "My mapping file does not seem to work when I rename the branch git fast-import crashes on!" in the readme?

raqua commented 2 years ago

Yes, that is the issue. I am sorry, I do not know how I missed that. Thank you.