test-convert-bzr-treeroot.t
37 lines
| 829 B
| text/troff
|
Tads3Lexer
/ tests / test-convert-bzr-treeroot.t
Gregory Szorc
|
r26066 | #require bzr | ||
Matt Mackall
|
r12517 | |||
$ . "$TESTDIR/bzr-definitions" | ||||
$ cat > treeset.py <<EOF | ||||
> import sys | ||||
Raphaël Gomès
|
r48168 | > from breezy import workingtree | ||
> import breezy.bzr.bzrdir | ||||
Matt Mackall
|
r12517 | > wt = workingtree.WorkingTree.open('.') | ||
> | ||||
> message, rootid = sys.argv[1:] | ||||
Raphaël Gomès
|
r48168 | > wt.set_root_id(b'tree_root-%s' % rootid.encode()) | ||
Matt Mackall
|
r12517 | > wt.commit(message) | ||
> EOF | ||||
change the id of the tree root | ||||
$ mkdir test-change-treeroot-id | ||||
$ cd test-change-treeroot-id | ||||
Raphaël Gomès
|
r48168 | $ brz init -q source | ||
Matt Mackall
|
r12517 | $ cd source | ||
$ echo content > file | ||||
Raphaël Gomès
|
r48168 | $ brz add -q file | ||
$ brz commit -q -m 'Initial add' | ||||
Matt Harbison
|
r39743 | $ "$PYTHON" ../../treeset.py 'Changed root' new | ||
Matt Mackall
|
r12517 | $ cd .. | ||
$ hg convert source source-hg | ||||
initializing destination source-hg repository | ||||
scanning source... | ||||
sorting... | ||||
converting... | ||||
1 Initial add | ||||
0 Changed root | ||||
$ manifest source-hg tip | ||||
% manifest of tip | ||||
644 file | ||||
Mads Kiilerich
|
r16913 | |||
$ cd .. | ||||