mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
- export LC_ALL=en_US.UTF-8
-
+ LC_ALL=en_US.UTF-8
+ export LC_ALL
(
bzr init bzrrepo &&
cd bzrrepo &&
- echo test >> "áéÃóú" &&
- bzr add "áéÃóú" &&
- echo test >> "îøâ\88«â\88\86" &&
- bzr add "îøâ\88«â\88\86" &&
- bzr commit -m utf-8 &&
- echo test >> "áéÃóú" &&
- bzr commit -m utf-8 &&
- bzr rm "îøâ\88«â\88\86" &&
- bzr mv "áéÃóú" "Ã¥Ã\9fâ\88\82" &&
- bzr commit -m utf-8
+ echo test >> "ærø" &&
+ bzr add "ærø" &&
+ echo test >> "ø~?" &&
+ bzr add "ø~?" &&
+ bzr commit -m add-utf-8 &&
+ echo test >> "ærø" &&
+ bzr commit -m test-utf-8 &&
+ bzr rm "ø~?" &&
+ bzr mv "ærø" "ø~?" &&
+ bzr commit -m bzr-mv-utf-8
) &&
(
git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo &&
- git ls-files > ../actual
+ git -c core.quotepath=false ls-files > ../actual
) &&
-
- echo "\"\\303\\245\\303\\237\\342\\210\\202\"" > expected &&
+ echo "ø~?" > expected &&
test_cmp expected actual
'
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
- export LC_ALL=en_US.UTF-8
+ LC_ALL=en_US.UTF-8
+ export LC_ALL
(
bzr init bzrrepo &&
git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo &&
- echo test >> "áéÃóú" &&
- git add "áéÃóú" &&
+ echo test >> "ærø" &&
+ git add "ærø" &&
git commit -m utf-8 &&
git push
) &&
(cd bzrrepo && bzr ls > ../actual) &&
- echo -e "content\náéíóú" > expected &&
+ printf "content\nærø\n" > expected &&
+ test_cmp expected actual
+'
+
+test_expect_success 'pushing a merge' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ bzr init bzrrepo &&
+ cd bzrrepo &&
+ echo one > content &&
+ bzr add content &&
+ bzr commit -m one
+ ) &&
+
+ git clone "bzr::$PWD/bzrrepo" gitrepo &&
+
+ (
+ cd bzrrepo &&
+ echo two > content &&
+ bzr commit -m two
+ ) &&
+
+ (
+ cd gitrepo &&
+ echo three > content &&
+ git commit -a -m three &&
+ git fetch &&
+ git merge origin/master || true &&
+ echo three > content &&
+ git commit -a --no-edit &&
+ git push
+ ) &&
+
+ echo three > expected &&
+ cat bzrrepo/content > actual &&
+ test_cmp expected actual
+'
+
+cat > expected <<EOF
+origin/HEAD
+origin/branch
+origin/trunk
+EOF
+
+test_expect_success 'proper bzr repo' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ bzr init-repo bzrrepo &&
+
+ bzr init bzrrepo/trunk &&
+ (
+ cd bzrrepo/trunk &&
+ echo one >> content &&
+ bzr add content &&
+ bzr commit -m one
+ ) &&
+
+ bzr branch bzrrepo/trunk bzrrepo/branch &&
+ (
+ cd bzrrepo/branch &&
+ echo two >> content &&
+ bzr commit -m one
+ ) &&
+
+ git clone "bzr::$PWD/bzrrepo" gitrepo &&
+ (
+ cd gitrepo &&
+ git for-each-ref --format "%(refname:short)" refs/remotes/origin > ../actual
+ ) &&
+
+ test_cmp ../expected actual
+'
+
+test_expect_success 'strip' '
+ # Do not imitate this style; always chdir inside a subshell instead
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ bzr init bzrrepo &&
+ cd bzrrepo &&
+
+ echo one >> content &&
+ bzr add content &&
+ bzr commit -m one &&
+
+ echo two >> content &&
+ bzr commit -m two
+ ) &&
+
+ git clone "bzr::$PWD/bzrrepo" gitrepo &&
+
+ (
+ cd bzrrepo &&
+ bzr uncommit --force &&
+
+ echo three >> content &&
+ bzr commit -m three &&
+
+ echo four >> content &&
+ bzr commit -m four &&
+ bzr log --line | sed -e "s/^[0-9][0-9]*: //" > ../expected
+ ) &&
+
+ (cd gitrepo &&
+ git fetch &&
+ git log --format="%an %ad %s" --date=short origin/master > ../actual) &&
+
test_cmp expected actual
'