##// END OF EJS Templates
tests: finally fix up test-fuzz-targets.t...
tests: finally fix up test-fuzz-targets.t It's been failing on my workstation for a while, since I have a new enough LLVM that I had the fuzzer goo, but not so new that I actually had FuzzedDataProvider. This is a better solution all around in my opinion. I _believe_ this should let us run these tests on most systems, even those using GCC instead of clang. That said, my one attempt to test this on my macOS laptop failed miserably, and I don't feel like doing more work on this right now. Differential Revision: https://phab.mercurial-scm.org/D7566

File last commit:

r42597:0c72eddb default
r44267:19da643d default
Show More
test-convert-bzr.t
288 lines | 6.6 KiB | text/troff | Tads3Lexer
/ tests / test-convert-bzr.t
Gregory Szorc
tests: move '#require bzr' into .t files...
r26066 #require bzr
Matt Mackall
tests: unify test-convert-bzr
r12512 $ . "$TESTDIR/bzr-definitions"
create and rename on the same file in the same step
$ mkdir test-createandrename
$ cd test-createandrename
$ bzr init -q source
Patrick Mezard
convert/bzr: handle empty bzr repositories (issue3233)
r16061
test empty repo conversion (issue3233)
$ hg convert source source-hg
initializing destination source-hg repository
scanning source...
sorting...
converting...
back to the rename stuff
Matt Mackall
tests: unify test-convert-bzr
r12512 $ cd source
$ echo a > a
$ echo c > c
$ echo e > e
$ bzr add -q a c e
$ bzr commit -q -m 'Initial add: a, c, e'
$ bzr mv a b
a => b
$ bzr mv c d
c => d
$ bzr mv e f
e => f
$ echo a2 >> a
$ mkdir e
$ bzr add -q a e
$ bzr commit -q -m 'rename a into b, create a, rename c into d'
$ cd ..
$ hg convert source source-hg
scanning source...
sorting...
converting...
1 Initial add: a, c, e
0 rename a into b, create a, rename c into d
$ glog -R source-hg
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 1@source "rename a into b, create a, rename c into d" files+: [b d f], files-: [c e], files: [a]
Matt Mackall
tests: unify test-convert-bzr
r12512 |
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
Matt Mackall
tests: unify test-convert-bzr
r12512
manifest
$ hg manifest -R source-hg -r tip
a
b
d
f
test --rev option
$ hg convert -r 1 source source-1-hg
initializing destination source-1-hg repository
scanning source...
sorting...
converting...
0 Initial add: a, c, e
$ glog -R source-1-hg
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
Matt Mackall
tests: unify test-convert-bzr
r12512
test with filemap
$ cat > filemap <<EOF
> exclude a
> EOF
$ hg convert --filemap filemap source source-filemap-hg
initializing destination source-filemap-hg repository
scanning source...
sorting...
converting...
1 Initial add: a, c, e
0 rename a into b, create a, rename c into d
$ hg -R source-filemap-hg manifest -r tip
b
d
f
convert from lightweight checkout
$ bzr checkout --lightweight source source-light
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ hg convert -s bzr source-light source-light-hg
Matt Mackall
tests: unify test-convert-bzr
r12512 initializing destination source-light-hg repository
warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository
abort: source-light: missing or unsupported repository
[255]
Matt Mackall
tests: unify test-convert-bzr
r12512
extract timestamps that look just like hg's {date|isodate}:
yyyy-mm-dd HH:MM zzzz (no seconds!)
compare timestamps
$ cd source
$ bzr log | \
> sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
> > ../bzr-timestamps
$ cd ..
$ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
Danek Duvall
solaris: diff -u emits "No differences encountered"...
r20598 $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
Matt Mackall
tests: unify test-convert-bzr
r12512 $ cd ..
merge
$ mkdir test-merge
$ cd test-merge
$ cat > helper.py <<EOF
> import sys
> from bzrlib import workingtree
> wt = workingtree.WorkingTree.open('.')
>
> message, stamp = sys.argv[1:]
> wt.commit(message, timestamp=int(stamp))
> EOF
$ bzr init -q source
$ cd source
$ echo content > a
$ echo content2 > b
$ bzr add -q a b
$ bzr commit -q -m 'Initial add'
$ cd ..
$ bzr branch -q source source-improve
$ cd source
$ echo more >> a
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../helper.py 'Editing a' 100
Matt Mackall
tests: unify test-convert-bzr
r12512 $ cd ../source-improve
$ echo content3 >> b
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../helper.py 'Editing b' 200
Matt Mackall
tests: unify test-convert-bzr
r12512 $ cd ../source
$ bzr merge -q ../source-improve
$ bzr commit -q -m 'Merged improve branch'
$ cd ..
$ hg convert --datesort source source-hg
initializing destination source-hg repository
scanning source...
sorting...
converting...
3 Initial add
2 Editing a
1 Editing b
0 Merged improve branch
$ glog -R source-hg
Martin von Zweigbergk
templatekw: make {file_*} compare to both merge parents (issue4292)...
r42597 o 3@source "Merged improve branch" files+: [], files-: [], files: []
Matt Mackall
tests: unify test-convert-bzr
r12512 |\
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 | o 2@source-improve "Editing b" files+: [], files-: [], files: [b]
Matt Mackall
tests: unify test-convert-bzr
r12512 | |
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o | 1@source "Editing a" files+: [], files-: [], files: [a]
Matt Mackall
tests: unify test-convert-bzr
r12512 |/
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 0@source "Initial add" files+: [a b], files-: [], files: []
Matt Mackall
tests: unify test-convert-bzr
r12512
$ cd ..
Mads Kiilerich
tests: convert some 'hghave execbit' to #if...
r16899 #if symlink execbit
Matt Mackall
tests: unify test-convert-bzr
r12512 symlinks and executable files
$ mkdir test-symlinks
$ cd test-symlinks
$ bzr init -q source
$ cd source
$ touch program
$ chmod +x program
$ ln -s program altname
$ mkdir d
$ echo a > d/a
$ ln -s a syma
$ bzr add -q altname program syma d/a
$ bzr commit -q -m 'Initial setup'
$ touch newprog
$ chmod +x newprog
$ rm altname
$ ln -s newprog altname
$ chmod -x program
$ bzr add -q newprog
$ bzr commit -q -m 'Symlink changed, x bits changed'
$ cd ..
$ hg convert source source-hg
initializing destination source-hg repository
scanning source...
sorting...
converting...
1 Initial setup
0 Symlink changed, x bits changed
$ manifest source-hg 0
% manifest of 0
644 @ altname
644 d/a
755 * program
644 @ syma
$ manifest source-hg tip
% manifest of tip
644 @ altname
644 d/a
755 * newprog
644 program
644 @ syma
test the symlinks can be recreated
Mads Kiilerich
tests: convert some 'hghave execbit' to #if...
r16899 $ cd source-hg
Matt Mackall
tests: unify test-convert-bzr
r12512 $ hg up
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg cat syma; echo
a
Mads Kiilerich
tests: convert some 'hghave execbit' to #if...
r16899 $ cd ../..
#endif
Matt Mackall
tests: unify test-convert-bzr
r12512
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 Multiple branches
$ bzr init-repo -q --no-trees repo
$ bzr init -q repo/trunk
$ bzr co repo/trunk repo-trunk
$ cd repo-trunk
$ echo a > a
Thomas Arendsen Hein
convert/bzr: make tests work with bzr 2.0 again...
r17034 $ bzr add -q a
$ bzr ci -qm adda
Patrick Mezard
convert/bzr: test tags conversion
r16062 $ bzr tag trunk-tag
Created tag trunk-tag.
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ bzr switch -b branch
Tree is up to date at revision 1.
Switched to branch: *repo/branch/ (glob)
Mads Kiilerich
tests: make test-convert-bzr.t more stable...
r17097 $ sleep 1
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ echo b > b
Thomas Arendsen Hein
convert/bzr: make tests work with bzr 2.0 again...
r17034 $ bzr add -q b
$ bzr ci -qm addb
Patrick Mezard
convert/bzr: test tags conversion
r16062 $ bzr tag branch-tag
Created tag branch-tag.
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ bzr switch --force ../repo/trunk
Updated to revision 1.
Switched to branch: */repo/trunk/ (glob)
Mads Kiilerich
tests: make test-convert-bzr.t more stable...
r17097 $ sleep 1
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ echo a >> a
Thomas Arendsen Hein
convert/bzr: make tests work with bzr 2.0 again...
r17034 $ bzr ci -qm changea
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ cd ..
$ hg convert --datesort repo repo-bzr
initializing destination repo-bzr repository
scanning source...
sorting...
converting...
2 adda
1 addb
0 changea
Patrick Mezard
convert/bzr: test tags conversion
r16062 updating tags
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 $ (cd repo-bzr; glog)
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 3@default "update tags" files+: [.hgtags], files-: [], files: []
Patrick Mezard
convert/bzr: test tags conversion
r16062 |
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 2@default "changea" files+: [], files-: [], files: [a]
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 |
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 | o 1@branch "addb" files+: [b], files-: [], files: []
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060 |/
Matt Harbison
tests: show added/modified/removed files when logging repos converted from bzr...
r39256 o 0@default "adda" files+: [a], files-: [], files: []
Patrick Mezard
convert/bzr: convert all branches (issue3229) (BC)...
r16060
Patrick Mezard
convert/bzr: test tags conversion
r16062
Test tags (converted identifiers are not stable because bzr ones are
not and get incorporated in extra fields).
$ hg -R repo-bzr tags
tip 3:* (glob)
branch-tag 1:* (glob)
trunk-tag 0:* (glob)
Patrick Mezard
convert/bzr: ignore nested repos when listing branches (issue3254)...
r16099
Nested repositories (issue3254)
$ bzr init-repo -q --no-trees repo/inner
$ bzr init -q repo/inner/trunk
$ bzr co repo/inner/trunk inner-trunk
$ cd inner-trunk
$ echo b > b
Thomas Arendsen Hein
convert/bzr: make tests work with bzr 2.0 again...
r17034 $ bzr add -q b
Patrick Mezard
convert/bzr: ignore nested repos when listing branches (issue3254)...
r16099 $ bzr ci -qm addb
$ cd ..
$ hg convert --datesort repo noinner-bzr
initializing destination noinner-bzr repository
scanning source...
sorting...
converting...
2 adda
1 addb
0 changea
updating tags