comparison tests/test-convert-git @ 5335:88e931f74e8b

convert_git: avoid returning two entries for the same file in getchanges This could happen in merge changesets if the merged file was different from both parents.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 24 Sep 2007 19:00:11 -0300
parents 5c2ca6d6ab21
children 9f35d0bcf00e
comparison
equal deleted inserted replaced
5334:448eb46d4d84 5335:88e931f74e8b
3 "$TESTDIR/hghave" git || exit 80 3 "$TESTDIR/hghave" git || exit 80
4 4
5 echo "[extensions]" >> $HGRCPATH 5 echo "[extensions]" >> $HGRCPATH
6 echo "convert=" >> $HGRCPATH 6 echo "convert=" >> $HGRCPATH
7 7
8 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
9 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
10 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
11 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
12 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
13 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
14
15 count=10
16 commit()
17 {
18 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
19 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
20 git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
21 count=`expr $count + 1`
22 }
23
8 mkdir git-repo 24 mkdir git-repo
9 cd git-repo 25 cd git-repo
10 git init-db >/dev/null 2>/dev/null 26 git init-db >/dev/null 2>/dev/null
11 echo a > a 27 echo a > a
12 git add a 28 git add a
13 git commit -m t1 >/dev/null 2>/dev/null || echo "git commit error" 29 commit -m t1
30
14 echo b >> a 31 echo b >> a
15 git commit -a -m t2 >/dev/null || echo "git commit error" 32 commit -a -m t2.1
33
34 git checkout -b other HEAD^ >/dev/null 2>/dev/null
35 echo c > a
36 echo a >> a
37 commit -a -m t2.2
38
39 git checkout master >/dev/null 2>/dev/null
40 git pull --no-commit . other > /dev/null 2>/dev/null
41 commit -m 'Merge branch other'
16 cd .. 42 cd ..
17 43
18 hg convert git-repo 44 hg convert --datesort git-repo
19 45
46 hg -R git-repo-hg tip -v