dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

Replacing a file by a directory does not work (data loss) #36

Open fingolfin opened 11 years ago

fingolfin commented 11 years ago

Adding a file x to the hg repository in one commit, then replacing it with a directory x/ containing a file x/a in the next commit does not work correctly -- the resulting clone will present a tree containing no x at all. Here is a shell script to reproduce this:

#!/bin/sh -e
mkdir repo_orig
cd repo_orig
hg init
echo a > a
hg add a
hg commit -m a
hg rm a
mkdir a
echo x > a/x
hg add a/x
hg commit -m x
ls -l
cd ..

git clone gitifyhg::repo_orig repo_clone

cd repo_clone

test ! -d a  && echo "Directory 'a' was not cloned"
test ! -f a/x  && echo "File 'a/x' was not cloned"
felipec commented 10 years ago

FWIW this works correctly in git-remote-hg.