view tests/test-convert-git @ 5440:f9b0e4f023c4

findcopies: fix rename bug We've fiddled with this line several times, and an old bug has reappeared from it. Let's take a peek at the history. The original "or" (rev 3674, in 0.9.2 and 0.9.3): http://www.selenic.com/hg/rev/9103dab96093 Then I changed it to an "and" to fix a bug (rev 4304): http://www.selenic.com/hg/rev/4787e2b0dd03 Then for reasons now lost in the mists of time, I dropped half (rev 4399): http://www.selenic.com/hg/rev/93652499bed3 Then we added back the "or" (rev 4416, in 0.9.4): http://www.selenic.com/hg/rev/bb1800a7d7e1 So it seems it ought to be "and".
author Matt Mackall <mpm@selenic.com>
date Mon, 08 Oct 2007 18:47:22 -0500
parents 8ab7de07f40e
children a5a7f7fd5554
line wrap: on
line source

#!/bin/sh

"$TESTDIR/hghave" git || exit 80

echo "[extensions]" >> $HGRCPATH
echo "convert=" >> $HGRCPATH

GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE

count=10
commit()
{
    GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
    GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
    git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
    count=`expr $count + 1`
}

mkdir git-repo
cd git-repo
git init-db >/dev/null 2>/dev/null
echo a > a
mkdir d
echo b > d/b
git add a d
commit -a -m t1

# Remove the directory, then try to replace it with a file
# (issue 754)
git rm -f d/b
commit -m t2
echo d > d
git add d
commit -m t3

echo b >> a
commit -a -m t4.1

git checkout -b other HEAD^ >/dev/null 2>/dev/null
echo c > a
echo a >> a
commit -a -m t4.2

git checkout master >/dev/null 2>/dev/null
git pull --no-commit . other > /dev/null 2>/dev/null
commit -m 'Merge branch other'
cd ..

hg convert --datesort git-repo

hg -R git-repo-hg tip -v