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

fast-export does not follow last stored state #258

Closed koldat closed 3 years ago

koldat commented 3 years ago

We are doing incremental synchronization between our mercurial and git repositories. I was moving this job to different server today and it stopped working. It was always going from start. At the end I found this problem:

  min=int(state_cache.get('tip',0)) # Here it is always 0
  max=_max
  if _max<0 or max>tip:
    max=tip

It turned out that state_cache is actually having byte strings which does not match 'tip'

{b'repo': b'../hgrepository/', b'tip': b'18544'}

After I changed it to this it works again:

  min=int(state_cache.get(b'tip',0)) # Notice that b

I am not sure why the behavior changed (maybe python version), but I think it should be searched as byte string as load_cache it creating byte strings.