test-convert-bzr-directories.t
197 lines
| 4.3 KiB
| text/troff
|
Tads3Lexer
/ tests / test-convert-bzr-directories.t
|
r26066 | #require bzr | ||
|
r12514 | |||
$ . "$TESTDIR/bzr-definitions" | ||||
|
r44813 | Work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944379 | ||
$ mkdir -p "${HOME}/.config/breezy" | ||||
|
r12514 | empty directory | ||
$ mkdir test-empty | ||||
$ cd test-empty | ||||
|
r48168 | $ brz init -q source | ||
|
r12514 | $ cd source | ||
$ echo content > a | ||||
|
r48168 | $ brz add -q a | ||
$ brz commit -q -m 'Initial add' | ||||
|
r12514 | $ mkdir empty | ||
|
r48168 | $ brz add -q empty | ||
$ brz commit -q -m 'Empty directory added' | ||||
|
r12514 | $ echo content > empty/something | ||
|
r48168 | $ brz add -q empty/something | ||
$ brz commit -q -m 'Added file into directory' | ||||
|
r12514 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
2 Initial add | ||||
1 Empty directory added | ||||
0 Added file into directory | ||||
$ manifest source-hg 1 | ||||
% manifest of 1 | ||||
644 a | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
644 a | ||||
644 empty/something | ||||
$ cd .. | ||||
directory renames | ||||
$ mkdir test-dir-rename | ||||
$ cd test-dir-rename | ||||
|
r48168 | $ brz init -q source | ||
|
r12514 | $ cd source | ||
$ mkdir tpyo | ||||
$ echo content > tpyo/something | ||||
|
r48168 | $ brz add -q tpyo | ||
$ brz commit -q -m 'Added directory' | ||||
$ brz mv tpyo typo | ||||
|
r12514 | tpyo => typo | ||
|
r48168 | $ brz commit -q -m 'Oops, typo' | ||
|
r12514 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Added directory | ||||
0 Oops, typo | ||||
$ manifest source-hg 0 | ||||
% manifest of 0 | ||||
644 tpyo/something | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
644 typo/something | ||||
$ cd .. | ||||
nested directory renames | ||||
$ mkdir test-nested-dir-rename | ||||
$ cd test-nested-dir-rename | ||||
|
r48168 | $ brz init -q source | ||
|
r12514 | $ cd source | ||
$ mkdir -p firstlevel/secondlevel/thirdlevel | ||||
$ echo content > firstlevel/secondlevel/file | ||||
$ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff | ||||
|
r48168 | $ brz add -q firstlevel | ||
$ brz commit -q -m 'Added nested directories' | ||||
$ brz mv firstlevel/secondlevel secondlevel | ||||
|
r12514 | firstlevel/secondlevel => secondlevel | ||
|
r48168 | $ brz commit -q -m 'Moved secondlevel one level up' | ||
|
r12514 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Added nested directories | ||||
0 Moved secondlevel one level up | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
644 secondlevel/file | ||||
644 secondlevel/thirdlevel/stuff | ||||
$ cd .. | ||||
directory remove | ||||
$ mkdir test-dir-remove | ||||
$ cd test-dir-remove | ||||
|
r48168 | $ brz init -q source | ||
|
r12514 | $ cd source | ||
$ mkdir src | ||||
$ echo content > src/sourcecode | ||||
|
r48168 | $ brz add -q src | ||
$ brz commit -q -m 'Added directory' | ||||
$ brz rm -q src | ||||
$ brz commit -q -m 'Removed directory' | ||||
|
r12514 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Added directory | ||||
0 Removed directory | ||||
$ manifest source-hg 0 | ||||
% manifest of 0 | ||||
644 src/sourcecode | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
$ cd .. | ||||
directory replace | ||||
$ mkdir test-dir-replace | ||||
$ cd test-dir-replace | ||||
|
r48168 | $ brz init -q source | ||
|
r12514 | $ cd source | ||
$ mkdir first second | ||||
$ echo content > first/file | ||||
$ echo morecontent > first/dummy | ||||
$ echo othercontent > second/something | ||||
|
r48168 | $ brz add -q first second | ||
$ brz commit -q -m 'Initial layout' | ||||
$ brz mv first/file second/file | ||||
|
r12514 | first/file => second/file | ||
|
r48168 | $ brz mv first third | ||
|
r12514 | first => third | ||
|
r48168 | $ brz commit -q -m 'Some conflicting moves' | ||
|
r12514 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Initial layout | ||||
0 Some conflicting moves | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
644 second/file | ||||
644 second/something | ||||
644 third/dummy | ||||
$ cd .. | ||||
|
r15461 | |||
divergent nested renames (issue3089) | ||||
$ mkdir test-divergent-renames | ||||
$ cd test-divergent-renames | ||||
|
r48168 | $ brz init -q source | ||
|
r15461 | $ cd source | ||
$ mkdir -p a/c | ||||
$ echo a > a/fa | ||||
$ echo c > a/c/fc | ||||
|
r48168 | $ brz add -q a | ||
$ brz commit -q -m 'Initial layout' | ||||
$ brz mv a b | ||||
|
r15461 | a => b | ||
$ mkdir a | ||||
|
r48168 | $ brz add a | ||
|
r15487 | add(ed|ing) a (re) | ||
|
r48168 | $ brz mv b/c a/c | ||
|
r15461 | b/c => a/c | ||
|
r48168 | $ brz status | ||
|
r15461 | added: | ||
a/ | ||||
renamed: | ||||
|
r15487 | a/? => b/? (re) | ||
a/c/? => a/c/? (re) | ||||
|
r48168 | $ brz commit -q -m 'Divergent renames' | ||
|
r15461 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Initial layout | ||||
0 Divergent renames | ||||
$ hg -R source-hg st -C --change 1 | ||||
A b/fa | ||||
a/fa | ||||
R a/fa | ||||
$ hg -R source-hg manifest -r 1 | ||||
a/c/fc | ||||
b/fa | ||||
$ cd .. | ||||