Comments (9)
I want migrate from mercurial to git, and this tool works very well indeed,
except all the commit messages(which were wrote in Chinese) became unreadable.
What encoding have you used for the Chinese commit messages?
I tried to reproduce your problem by creating a dummy repository where I
created commit messages containing letters (Γ₯Àâ) which encodes
differently in utf-8 and latin-1 (using hg --encoding). The resulting
logs displays correctly in an utf-8 terminal both before and after
conversion to git. Unless you can give me an exact recipe to reproduce
the problem I don't think it is a fast-export problem.
To salvage the situation I would try to play with the
i18n.commitEncoding or i18n.logOutputEncoding (check 'git config
--help') to see if I could trick git into converting your messages on
the fly. Otherwise have a look at 'git filter-branch' by which you could
massage the messages using iconv after the initial conversion.
from fast-export.
No feedback from reporter for half a year, closing...
from fast-export.
I have the same issue.
Commit messages in my mercurial repo stored in cp1251 (default charset encoding for Russian) and it's impossible correct import it to git.
So, I make some little changes in hg2git.py:
def get_changeset(ui,repo,revision,authors={}):
node=repo.lookup(revision)
(manifest,user,(time,timezone),files,desc,extra)=repo.changelog.read(node)
# +++ Do convert local encoding to UTF8
user = user.decode('cp1251').encode('utf8')
desc = desc.decode('cp1251').encode('utf8')
# +++ End encoding convertions
tz="%+03d%02d" % (-timezone / 3600, ((-timezone % 3600) / 60))
branch=get_branch(extra.get('branch','master'))
return (node,manifest,fixup_user(user,authors),(time,tz),files,desc,branch,extra)
I think you need add some option to set correct source encoding for all text fields that you read from changelog.
from fast-export.
I think you need add some option to set correct source encoding for all
text fields that you read from changelog.
Patches welcome :)
from fast-export.
So, maybe you should reopen this issue?
from fast-export.
So, maybe you should reopen this issue?
Could you provide a recipe for creating a repo which exhibits this
issue (or point to a public hg repo)?
from fast-export.
https://bitbucket.org/sas_team/sas.planet.src
from fast-export.
My pull request: #39
from fast-export.
Fixed by e87c9cb, closing issue.
from fast-export.
Related Issues (20)
- export project with submodules does not contain a valid uri HOT 1
- .hgsub is still available after conversion HOT 1
- .hgignore is not replaced by .gitignore HOT 1
- Reduce repository size HOT 1
- Not all modules are defined in mapping file. HOT 2
- Commit messages are decoded as cp1252 with parameter -e utf8 HOT 1
- Yet another "cannot lock ref", mapping seems not to help HOT 2
- no difference between empty and no plugin option HOT 4
- Branch mapping not working with quotation mark HOT 6
- fast-export only converts default branch HOT 3
- Support for Python 3.12 (e.g. replace `imp` usage for Python 3 users)
- hg-fast-export.py fails due to missing hg2git module HOT 3
- Cannot execute fast export due to missing module importlib.machinery HOT 6
- Renaming files ignores file deletions HOT 1
- Importing mercurial repository fails with syntax error HOT 1
- Error -5 while decompressing data HOT 2
- Archives doesn't contain sharness folder HOT 2
- Running content filter fails, maybe because of an empty commit HOT 2
- git checkout HEAD ERROR HOT 4
- Add tag filtering in plugins HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-export.