mirror of
https://github.com/lroche/hg2git.git
synced 2026-07-27 19:55:48 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1cc68a3b0 | ||
|
|
5997f047cf | ||
|
|
e9b7f03ef9 | ||
|
|
8a7e5ade7c | ||
|
|
26a3e30f64 | ||
|
|
17a6f37825 |
@@ -0,0 +1,3 @@
|
||||
project/
|
||||
result/
|
||||
.env
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-azuretools.vscode-docker"
|
||||
]
|
||||
}
|
||||
+8
-9
@@ -1,17 +1,16 @@
|
||||
FROM buildpack-deps:jessie
|
||||
FROM buildpack-deps:bookworm
|
||||
|
||||
MAINTAINER Lionel Roche
|
||||
RUN mkdir -p work
|
||||
|
||||
WORKDIR work
|
||||
WORKDIR /work
|
||||
|
||||
# Install fastexport tool:
|
||||
RUN mkdir -p /usr/local/src && \
|
||||
cd /usr/local/src && \
|
||||
git clone https://github.com/frej/fast-export.git
|
||||
|
||||
#Install fastexport tool:
|
||||
RUN mkdir -p /usr/local/src \
|
||||
&& cd /usr/local/src \
|
||||
&& git clone https://github.com/frej/fast-export.git
|
||||
|
||||
RUN cd /work
|
||||
COPY hg2git.sh .
|
||||
RUN chmod +x hg2git.sh
|
||||
|
||||
ENTRYPOINT ["/work/hg2git.sh"]
|
||||
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
# Summary
|
||||
The purpose of hg2git is to convert a Mercurial repository to a Git repository.
|
||||
# hg2git
|
||||
|
||||
Created by [Lionel Roche](https://github.com/lroche/hg2git) and updated by [Michel Bats](https://gitea.batssoft.nl/Michel/docker-hg2git) as there was no support for [repository format](https://wiki.mercurial-scm.org/MissingRequirement) sparse-revlog in the latest version published on [DockerHub](https://hub.docker.com/r/lroche/hg2git).
|
||||
|
||||
The purpose of hg2git is to convert a Mercurial repository to a Git repository.
|
||||
All mechanism of conversion is based on [fast-export](https://github.com/frej/fast-export.git) tool.
|
||||
|
||||
## Launch conversion
|
||||
|
||||
# Launch conversion
|
||||
```sh
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
docker run -it -v ~/anyproject-hg:/work/projectname -v ~/project-result-git:/work/result lroche/hg2git projectname
|
||||
The compose file uses two bind mount volumes, one for hg source, other for git target result.
|
||||
|
||||
or if you don't want to specifiy projectname:
|
||||
Create the folder **project** and **result**. Use the project folder for your Mercurial repository, the converted git repository will be in the result folder.
|
||||
|
||||
docker run -it -v ~/anyproject-hg:/work/project -v ~/project-result-git:/work/result lroche/hg2git
|
||||
|
||||
|
||||
the run uses two bound volumes, one for hg source, other for git target result.
|
||||
the name of project has no matter but it will be the same between /work/projectname and the argument of the command (here projectname)
|
||||
|
||||
# How to retrieve git conversion ?
|
||||
## How to retrieve git conversion ?
|
||||
|
||||
The result of git conversion can be found behind the /work/result volume
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
# hg2git
|
||||
hg2git:
|
||||
container_name: ${HG2GIT_CONTAINER_NAME:-hg2git}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: ${RESTART:-no}
|
||||
volumes:
|
||||
- ./project:/work/project
|
||||
- ./result:/work/result
|
||||
@@ -1,16 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_NAME=$1
|
||||
if [ "$PROJECT_NAME" == "" ]
|
||||
then
|
||||
PROJECT_NAME="project"
|
||||
if [ "$PROJECT_NAME" == "" ]; then
|
||||
PROJECT_NAME="project"
|
||||
fi
|
||||
|
||||
cd /work/result
|
||||
mkdir -p $PROJECT_NAME-git
|
||||
cd $PROJECT_NAME-git
|
||||
git init
|
||||
#avoid having unexpected issue:
|
||||
# Avoid having unexpected issues.
|
||||
git config core.ignoreCase false
|
||||
|
||||
/usr/local/src/fast-export/hg-fast-export.sh -r /work/$PROJECT_NAME
|
||||
@@ -18,6 +17,9 @@ git config core.ignoreCase false
|
||||
if [ "$?" -ne "0" ]; then
|
||||
exit 1
|
||||
else
|
||||
git checkout HEAD
|
||||
bash
|
||||
fi
|
||||
git checkout HEAD
|
||||
bash
|
||||
fi
|
||||
|
||||
# Circumvent any owner issues.
|
||||
chmod -R --reference=/work/$PROJECT_NAME /work/result/$PROJECT_NAME-git
|
||||
|
||||
Reference in New Issue
Block a user