Debian Codegraph @

tests/test-convert-bzr-ghosts.t

raw
1 #require bzr
2
3 $ . "$TESTDIR/bzr-definitions"
4 $ cat > ghostcreator.py <<EOF
5 > import sys
6 > from breezy import workingtree
7 > import breezy.bzr.bzrdir
8 > wt = workingtree.WorkingTree.open('.')
9 >
10 > message, ghostrev = sys.argv[1:]
11 > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev.encode()])
12 > wt.commit(message)
13 > EOF
14
15 ghost revisions
16
17 $ mkdir test-ghost-revisions
18 $ cd test-ghost-revisions
19 $ brz init -q source
20 $ cd source
21 $ echo content > somefile
22 $ brz add -q somefile
23 $ brz commit -q -m 'Initial layout setup'
24 $ echo morecontent >> somefile
25 $ "$PYTHON" ../../ghostcreator.py 'Commit with ghost revision' ghostrev
26 $ cd ..
27 $ hg convert source source-hg
28 initializing destination source-hg repository
29 scanning source...
30 sorting...
31 converting...
32 1 Initial layout setup
33 0 Commit with ghost revision
34 $ glog -R source-hg
35 o 1@source "Commit with ghost revision" files+: [], files-: [], files: [somefile]
36 |
37 o 0@source "Initial layout setup" files+: [somefile], files-: [], files: []
38
39
40 $ cd ..