##// END OF EJS Templates
convert-bazaar: use breezy package instead of old bzr one...
convert-bazaar: use breezy package instead of old bzr one Breezy is the most recent of the two, and works on Python 3 while being compatible with the (old) Bazaar file format. This patch contains a variety of unicode <-> bytes changes, API breakage fixing, restoring failing imports and changing the executable from `bzr` to `brz`. I recommend using the debian packages for `brz` and `python3-breezy` (3.1+), because the pip package seems to be haunted by radioactive dragons. Differential Revision: https://phab.mercurial-scm.org/D10513

File last commit:

r48168:26127236 default
r48168:26127236 default
Show More
test-convert-bzr-directories.t
197 lines | 4.3 KiB | text/troff | Tads3Lexer
/ tests / test-convert-bzr-directories.t
Gregory Szorc
tests: move '#require bzr' into .t files...
r26066 #require bzr
Matt Mackall
tests: unify test-convert-bzr-directories
r12514
$ . "$TESTDIR/bzr-definitions"
Martin von Zweigbergk
tests: add workaround for bzr bug...
r44813 Work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944379
$ mkdir -p "${HOME}/.config/breezy"
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 empty directory
$ mkdir test-empty
$ cd test-empty
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ cd source
$ echo content > a
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q a
$ brz commit -q -m 'Initial add'
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ mkdir empty
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q empty
$ brz commit -q -m 'Empty directory added'
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ echo content > empty/something
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q empty/something
$ brz commit -q -m 'Added file into directory'
Matt Mackall
tests: unify test-convert-bzr-directories
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
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ cd source
$ mkdir tpyo
$ echo content > tpyo/something
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q tpyo
$ brz commit -q -m 'Added directory'
$ brz mv tpyo typo
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 tpyo => typo
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz commit -q -m 'Oops, typo'
Matt Mackall
tests: unify test-convert-bzr-directories
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
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ cd source
$ mkdir -p firstlevel/secondlevel/thirdlevel
$ echo content > firstlevel/secondlevel/file
$ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q firstlevel
$ brz commit -q -m 'Added nested directories'
$ brz mv firstlevel/secondlevel secondlevel
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 firstlevel/secondlevel => secondlevel
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz commit -q -m 'Moved secondlevel one level up'
Matt Mackall
tests: unify test-convert-bzr-directories
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
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ cd source
$ mkdir src
$ echo content > src/sourcecode
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q src
$ brz commit -q -m 'Added directory'
$ brz rm -q src
$ brz commit -q -m 'Removed directory'
Matt Mackall
tests: unify test-convert-bzr-directories
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
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 $ cd source
$ mkdir first second
$ echo content > first/file
$ echo morecontent > first/dummy
$ echo othercontent > second/something
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q first second
$ brz commit -q -m 'Initial layout'
$ brz mv first/file second/file
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 first/file => second/file
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz mv first third
Matt Mackall
tests: unify test-convert-bzr-directories
r12514 first => third
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz commit -q -m 'Some conflicting moves'
Matt Mackall
tests: unify test-convert-bzr-directories
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 ..
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
r15461
divergent nested renames (issue3089)
$ mkdir test-divergent-renames
$ cd test-divergent-renames
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz init -q source
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
r15461 $ cd source
$ mkdir -p a/c
$ echo a > a/fa
$ echo c > a/c/fc
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add -q a
$ brz commit -q -m 'Initial layout'
$ brz mv a b
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
r15461 a => b
$ mkdir a
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz add a
Thomas Arendsen Hein
convert/bzr: fix test of divergent nested renames for bzr 1.x...
r15487 add(ed|ing) a (re)
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz mv b/c a/c
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
r15461 b/c => a/c
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz status
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
r15461 added:
a/
renamed:
Thomas Arendsen Hein
convert/bzr: fix test of divergent nested renames for bzr 1.x...
r15487 a/? => b/? (re)
a/c/? => a/c/? (re)
Raphaël Gomès
convert-bazaar: use breezy package instead of old bzr one...
r48168 $ brz commit -q -m 'Divergent renames'
Patrick Mezard
convert/bzr: correctly handle divergent nested renames (issue3089)...
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 ..