6 Commits
Author SHA1 Message Date
Michel e1cc68a3b0 Update readme to reflect the latest changes 2023-11-04 18:28:37 +01:00
Michel 5997f047cf Added recomendations for VSCode 2023-11-04 18:28:27 +01:00
Michel e9b7f03ef9 Added .gitignore 2023-11-04 18:28:14 +01:00
Michel 8a7e5ade7c Solved possible owner issues and did style format 2023-11-04 18:28:01 +01:00
Michel 26a3e30f64 Added compose file 2023-11-04 18:27:43 +01:00
Michel 17a6f37825 Update to bookworm and overall style formatted 2023-11-04 18:20:02 +01:00
6 changed files with 48 additions and 30 deletions
+3
View File
@@ -0,0 +1,3 @@
project/
result/
.env
+5
View File
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-docker"
]
}
+8 -9
View File
@@ -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"]
+12 -14
View File
@@ -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
+11
View File
@@ -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
+9 -7
View File
@@ -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