On Mo, 28 Aug 2023, Tony Mechelynck wrote:

> Christian, do you have any recommendations for someone who would want
> to continue porting the changes from git to Mercurial if you ever
> decide to close your own Mercurial mirror, or is it not worth the
> trouble unless this new Mercurial mirror is made public (for instance
> by maintaining a git mirror, exporting each patch as a set of diffs,
> and importing that to a Mercurial clone) ? (I used to have a user site
> but my ISP has closed it for no other reason than "if you want to
> continue having a user site after DD/MM/YYYY, get into contact with us
> before that date and an engineer of ours will build it for you". — I
> was perfectly happy with building it slowly but surely by FTP and I
> prefer to mind my own business, thank you.)

For a recommendation you mean what is required to set this up manually? 

It's currently a self-written shell script (attached)¹, that pulls the 
git mirror every 15 minutes and pushes each commit as new change to the 
mercurial repository. It used to work flawlessly (until I recently added 
pushing out mails). I reverted that part for now, let's see how well 
this works in the future. If it keeps running as good as it was in the 
past and doesn't cause any more issues, then it will just keep being 
updated.

There is currently the following line commented out:
,----
|         # echo "$patch" | hg import --bypass -
`----
Perhaps there were some issues with backslashes or other strange stuff, 
that echo interpreted differently and caused those problems, did not 
want to experiment with this to cause more issues for users.


¹) I thought about adding helper scripts as an additional repository 
below the vim organization, so that basically everybody can run this on 
their own and does no longer require a central bridge. Also, it could be 
used for some help scripts (e.g. those famous scripts Bram used to 
verify runtime files updates).

Best,
Christian
-- 
What happened last night can happen again.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/ZOzxU0mxCPXZRB%2B0%40256bit.org.
#!/bin/sh
set -x
set -e
last=$(git log -1 --format=format:%h HEAD)
if [ -n "$1" ]; then
    last="$1"
fi
doit=no
git reset -q --hard HEAD
# unfortunately, -q does not silence "Already up-to-date"
git pull -t -q origin master >/dev/null
hg checkout -C >/dev/null
head=$(git log -1 --no-merges --format=format:%h HEAD)
for rev in $(git log --reverse --format="format:%h" ${last}..${head}); do
    #set -x
    doit=yes
    echo "adding revision $rev"
    # just in case, revert
    hg revert --all
    #if [ -z "$1" ]; then
        # replace:
        #   - commit hashes by links to github
        #   - issue ids to links to github
        title=$(git log -1 --format=format:%s "$rev")

        # Generate a nice patch
        patch=$(git log -1 --binary -p "$rev" | \
            sed -e 's#^commit \([^ ]*\)$#Commit: 
https://github.com/vim/vim/commit/\1#' | \
            sed -e '3,8s-#\([0-9]\+\)-https://github.com/vim/vim/issues/\1-g' | 
\
            sed -e "1i $title\n")

        # Import Patch to Mercurial
        git log -1 --binary -p "$rev" | \
            sed -e 's#^commit \([^ ]*\)$#Commit: 
https://github.com/vim/vim/commit/\1#' | \
            sed -e '3,8s-#\([0-9]\+\)-https://github.com/vim/vim/issues/\1-g' | 
\
            sed -e "1i $title\n" | hg import --bypass -

        # Import Patch to Mercurial
        # echo "$patch" | hg import --bypass -

        # Send mail to Vim-Dev list
        echo "$patch" | mail -s "Commit: $title" -r cbli...@256bit.org 
vim_dev@googlegroups.com

        hg update -C
    #fi
    tag=$(git log -1 --no-merges --format="format:%h %d" -r "$rev" | sed -n 
's/.*(.*\(v[^,)]*\).*/\1/p')
    if [ -n "$tag" ]; then
        rev=$(hg log -r tip --template "{node}")
        hg tag -f -m "Added tag $tag for changeset $rev" -r "$rev" "$tag"
    fi
done
if [ "$doit" = "yes" ]; then
    git fetch
    git checkout -f master
    # hg push --ssh 'ssh -i ~/.ssh/id_rsa_bitbucket'
    hg push --ssh 'ssh -i ~/.ssh/id_rsa_osdn' -f osdn
fi

Raspunde prin e-mail lui