author | Pulkit Goyal <7895pulkit@gmail.com> |
Mon, 19 Jul 2021 04:11:08 +0530 | |
changeset 48168 | df3021c1f093 |
parent 47377 | 26127236b229 |
permissions | -rw-r--r-- |
26066
89872688893f
tests: move '#require bzr' into .t files
Gregory Szorc <gregory.szorc@gmail.com>
parents:
16913
diff
changeset
|
1 |
#require bzr |
7053 | 2 |
|
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
3 |
$ . "$TESTDIR/bzr-definitions" |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
4 |
$ cat > ghostcreator.py <<EOF |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
5 |
> import sys |
47377
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
6 |
> from breezy import workingtree |
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
7 |
> import breezy.bzr.bzrdir |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
8 |
> wt = workingtree.WorkingTree.open('.') |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
9 |
> |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
10 |
> message, ghostrev = sys.argv[1:] |
47377
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
11 |
> wt.set_parent_ids(wt.get_parent_ids() + [ghostrev.encode()]) |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
12 |
> wt.commit(message) |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
13 |
> EOF |
7053 | 14 |
|
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
15 |
ghost revisions |
7053 | 16 |
|
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
17 |
$ mkdir test-ghost-revisions |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
18 |
$ cd test-ghost-revisions |
47377
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
19 |
$ brz init -q source |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
20 |
$ cd source |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
21 |
$ echo content > somefile |
47377
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
22 |
$ brz add -q somefile |
26127236b229
convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net>
parents:
39707
diff
changeset
|
23 |
$ brz commit -q -m 'Initial layout setup' |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
24 |
$ echo morecontent >> somefile |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
39222
diff
changeset
|
25 |
$ "$PYTHON" ../../ghostcreator.py 'Commit with ghost revision' ghostrev |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
26 |
$ cd .. |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
27 |
$ hg convert source source-hg |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
28 |
initializing destination source-hg repository |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
29 |
scanning source... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
30 |
sorting... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
31 |
converting... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
32 |
1 Initial layout setup |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
33 |
0 Commit with ghost revision |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
34 |
$ glog -R source-hg |
39222
7a88643bc0ef
tests: show added/modified/removed files when logging repos converted from bzr
Matt Harbison <matt_harbison@yahoo.com>
parents:
32940
diff
changeset
|
35 |
o 1@source "Commit with ghost revision" files+: [], files-: [], files: [somefile] |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
36 |
| |
39222
7a88643bc0ef
tests: show added/modified/removed files when logging repos converted from bzr
Matt Harbison <matt_harbison@yahoo.com>
parents:
32940
diff
changeset
|
37 |
o 0@source "Initial layout setup" files+: [somefile], files-: [], files: [] |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
38 |
|
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
39 |
|
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
40 |
$ cd .. |