gitifyhg icon indicating copy to clipboard operation
gitifyhg copied to clipboard

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

Open fingolfin opened this issue 12 years ago • 1 comments

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"

fingolfin avatar Feb 04 '13 13:02 fingolfin

FWIW this works correctly in git-remote-hg.

felipec avatar May 01 '14 00:05 felipec