-
Katsunori FUJIWARA authored
Converting from CVS to Mercurial assumes that CVS log messages in "cvs rlog" output are encoded in UTF-8 (or basic Latin-1). But cvs itself is usually unaware of encoding of log messages, in practice. Therefore, if there are commits, of which log message is encoded in other than UTF-8, log message of corresponded revisions in the converted repository will be broken. To avoid such broken log messages, this patch transcodes CVS log messages by encoding specified via "convert.cvsps.logencoding" configuration. This patch accepts multiple encoding for convenience, because "multiple encoding mixed in a repository" easily occurs. For example, UTF-8 (recent POSIX), cp932 (Windows), and EUC-JP (legacy POSIX) are well known encoding for Japanese.
Katsunori FUJIWARA authoredConverting from CVS to Mercurial assumes that CVS log messages in "cvs rlog" output are encoded in UTF-8 (or basic Latin-1). But cvs itself is usually unaware of encoding of log messages, in practice. Therefore, if there are commits, of which log message is encoded in other than UTF-8, log message of corresponded revisions in the converted repository will be broken. To avoid such broken log messages, this patch transcodes CVS log messages by encoding specified via "convert.cvsps.logencoding" configuration. This patch accepts multiple encoding for convenience, because "multiple encoding mixed in a repository" easily occurs. For example, UTF-8 (recent POSIX), cp932 (Windows), and EUC-JP (legacy POSIX) are well known encoding for Japanese.
test-convert.t 23.76 KiB
$ cat >> $HGRCPATH <<EOF
> [extensions]
> convert=
> [convert]
> hg.saverev=False
> EOF
$ hg help convert
hg convert [OPTION]... SOURCE [DEST [REVMAP]]
convert a foreign SCM repository to a Mercurial one.
Accepted source formats [identifiers]:
- Mercurial [hg]
- CVS [cvs]
- Darcs [darcs]
- git [git]
- Subversion [svn]
- Monotone [mtn]
- GNU Arch [gnuarch]
- Bazaar [bzr]
- Perforce [p4]
Accepted destination formats [identifiers]:
- Mercurial [hg]
- Subversion [svn] (history on branches is not preserved)
If no revision is given, all revisions will be converted. Otherwise,
convert will only import up to the named revision (given in a format
understood by the source).
If no destination directory name is specified, it defaults to the basename
of the source with "-hg" appended. If the destination repository doesn't
exist, it will be created.
By default, all sources except Mercurial will use --branchsort. Mercurial
uses --sourcesort to preserve original revision numbers order. Sort modes
have the following effects:
--branchsort convert from parent to child revision when possible, which
means branches are usually converted one after the other.
It generates more compact repositories.
--datesort sort revisions by date. Converted repositories have good-
looking changelogs but are often an order of magnitude
larger than the same ones generated by --branchsort.
--sourcesort try to preserve source revisions order, only supported by
Mercurial sources.
--closesort try to move closed revisions as close as possible to parent
branches, only supported by Mercurial sources.
If "REVMAP" isn't given, it will be put in a default location
("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that
maps each source commit ID to the destination ID for that revision, like
so:
<source ID> <destination ID>
If the file doesn't exist, it's automatically created. It's updated on
each commit copied, so 'hg convert' can be interrupted and can be run
repeatedly to copy new commits.
The authormap is a simple text file that maps each source commit author to
a destination commit author. It is handy for source SCMs that use unix
logins to identify authors (e.g.: CVS). One line per author mapping and
the line format is:
source author = destination author
Empty lines and lines starting with a "#" are ignored.