mnauw / git-remote-hg

Transparent bidirectional bridge between Git and Mercurial for Git
GNU General Public License v2.0
62 stars 5 forks source link

git-remote-hg can't push backwards #32

Closed novalis closed 4 years ago

novalis commented 5 years ago
#!/bin/bash

set -xeuo pipefail

rm -rf /tmp/g1 /tmp/h1

git init /tmp/g1
hg init /tmp/h1

cd /tmp/g1

touch a
git add a
git commit -am a
FIRST=$(git rev-parse HEAD)

touch b
git add b
git commit -am b
SECOND=$(git rev-parse HEAD)

git push hg::/tmp/h1 $SECOND:refs/heads/master
git push hg::/tmp/h1 $FIRST:refs/heads/master
+ git push hg::/tmp/h1 4a530a3c7284686ff8d62d3f9b63cc9c7bea57f2:refs/heads/master
no changes found
2 local changesets published
To hg::/tmp/h1
 ! [remote rejected] 4a530a3c7284686ff8d62d3f9b63cc9c7bea57f2 -> master (unknown)
error: failed to push some refs to 'hg::/tmp/h1'