Mercurial > hg-stable
annotate tests/test-convert-bzr.t @ 16060:f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Instead of opening the target bzr checkout as a single branch, we try to open
it as a repository. This has the following effects:
- All branches are now converted
- bzr branch names are preserved. Previously, the selected branch was always
converted as 'default'. Branches without a name or 'trunk' are mapped to
'default branch.
- Lightweight checkouts are no longer supported. Maybe they can be, I did not
try to fix that at all.
Implementation notes:
- This was a quick fix, I have no knowledge of bzr API besides browsing 2.0.3
sources.
- The fix was only tested on OSX against bzr 2.4.2.
- Tags discovery does not handle collisions. I have no idea how tags work in
bzr so maybe such collisions are not possible.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 02 Feb 2012 10:15:12 +0100 |
parents | db0340f4b507 |
children | 915e06faa8f3 |
rev | line source |
---|---|
15442
db0340f4b507
tests: use 'hghave execbit' for tests that manipulate x bit in file system
Mads Kiilerich <mads@kiilerich.com>
parents:
15441
diff
changeset
|
1 $ "$TESTDIR/hghave" symlink execbit || exit 80 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
2 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
3 $ . "$TESTDIR/bzr-definitions" |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
4 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
5 create and rename on the same file in the same step |
7053 | 6 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
7 $ mkdir test-createandrename |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
8 $ cd test-createandrename |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
9 $ bzr init -q source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
10 $ cd source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
11 $ echo a > a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
12 $ echo c > c |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
13 $ echo e > e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
14 $ bzr add -q a c e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
15 $ bzr commit -q -m 'Initial add: a, c, e' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
16 $ bzr mv a b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
17 a => b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
18 $ bzr mv c d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
19 c => d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
20 $ bzr mv e f |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
21 e => f |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
22 $ echo a2 >> a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
23 $ mkdir e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
24 $ bzr add -q a e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
25 $ bzr commit -q -m 'rename a into b, create a, rename c into d' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
26 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
27 $ hg convert source source-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
28 initializing destination source-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
29 scanning source... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
30 sorting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
31 converting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
32 1 Initial add: a, c, e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
33 0 rename a into b, create a, rename c into d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
34 $ glog -R source-hg |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
35 o 1@source "rename a into b, create a, rename c into d" files: a b c d e f |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
36 | |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
37 o 0@source "Initial add: a, c, e" files: a c e |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
38 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
39 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
40 manifest |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
41 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
42 $ hg manifest -R source-hg -r tip |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
43 a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
44 b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
45 d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
46 f |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
47 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
48 test --rev option |
7053 | 49 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
50 $ hg convert -r 1 source source-1-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
51 initializing destination source-1-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
52 scanning source... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
53 sorting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
54 converting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
55 0 Initial add: a, c, e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
56 $ glog -R source-1-hg |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
57 o 0@source "Initial add: a, c, e" files: a c e |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
58 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
59 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
60 test with filemap |
8305
7a0fcdd3828f
convert/bzr: handle Bazaar timestamps correctly (issue1652).
Greg Ward <greg-hg@gerg.ca>
parents:
8165
diff
changeset
|
61 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
62 $ cat > filemap <<EOF |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
63 > exclude a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
64 > EOF |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
65 $ hg convert --filemap filemap source source-filemap-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
66 initializing destination source-filemap-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
67 scanning source... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
68 sorting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
69 converting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
70 1 Initial add: a, c, e |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
71 0 rename a into b, create a, rename c into d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
72 $ hg -R source-filemap-hg manifest -r tip |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
73 b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
74 d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
75 f |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
76 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
77 convert from lightweight checkout |
8470
dd24488cba2d
convert/bzr: warn when source is a lightweight checkout (issue1647)
Patrick Mezard <pmezard@gmail.com>
parents:
8434
diff
changeset
|
78 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
79 $ bzr checkout --lightweight source source-light |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
80 $ hg convert -s bzr source-light source-light-hg |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
81 initializing destination source-light-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
82 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead. |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
83 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
84 abort: source-light: missing or unsupported repository |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
85 [255] |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
86 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
87 extract timestamps that look just like hg's {date|isodate}: |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
88 yyyy-mm-dd HH:MM zzzz (no seconds!) |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
89 compare timestamps |
7053 | 90 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
91 $ cd source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
92 $ bzr log | \ |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
93 > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \ |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
94 > > ../bzr-timestamps |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
95 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
96 $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
97 $ diff -u bzr-timestamps hg-timestamps |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
98 $ cd .. |
7053 | 99 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
100 merge |
7053 | 101 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
102 $ mkdir test-merge |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
103 $ cd test-merge |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
104 $ cat > helper.py <<EOF |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
105 > import sys |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
106 > from bzrlib import workingtree |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
107 > wt = workingtree.WorkingTree.open('.') |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
108 > |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
109 > message, stamp = sys.argv[1:] |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
110 > wt.commit(message, timestamp=int(stamp)) |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
111 > EOF |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
112 $ bzr init -q source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
113 $ cd source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
114 $ echo content > a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
115 $ echo content2 > b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
116 $ bzr add -q a b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
117 $ bzr commit -q -m 'Initial add' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
118 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
119 $ bzr branch -q source source-improve |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
120 $ cd source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
121 $ echo more >> a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
122 $ python ../helper.py 'Editing a' 100 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
123 $ cd ../source-improve |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
124 $ echo content3 >> b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
125 $ python ../helper.py 'Editing b' 200 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
126 $ cd ../source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
127 $ bzr merge -q ../source-improve |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
128 $ bzr commit -q -m 'Merged improve branch' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
129 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
130 $ hg convert --datesort source source-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
131 initializing destination source-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
132 scanning source... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
133 sorting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
134 converting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
135 3 Initial add |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
136 2 Editing a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
137 1 Editing b |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
138 0 Merged improve branch |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
139 $ glog -R source-hg |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
140 o 3@source "Merged improve branch" files: |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
141 |\ |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
142 | o 2@source-improve "Editing b" files: b |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
143 | | |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
144 o | 1@source "Editing a" files: a |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
145 |/ |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
146 o 0@source "Initial add" files: a b |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
147 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
148 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
149 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
150 symlinks and executable files |
7053 | 151 |
12512
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
152 $ mkdir test-symlinks |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
153 $ cd test-symlinks |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
154 $ bzr init -q source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
155 $ cd source |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
156 $ touch program |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
157 $ chmod +x program |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
158 $ ln -s program altname |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
159 $ mkdir d |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
160 $ echo a > d/a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
161 $ ln -s a syma |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
162 $ bzr add -q altname program syma d/a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
163 $ bzr commit -q -m 'Initial setup' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
164 $ touch newprog |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
165 $ chmod +x newprog |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
166 $ rm altname |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
167 $ ln -s newprog altname |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
168 $ chmod -x program |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
169 $ bzr add -q newprog |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
170 $ bzr commit -q -m 'Symlink changed, x bits changed' |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
171 $ cd .. |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
172 $ hg convert source source-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
173 initializing destination source-hg repository |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
174 scanning source... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
175 sorting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
176 converting... |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
177 1 Initial setup |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
178 0 Symlink changed, x bits changed |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
179 $ manifest source-hg 0 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
180 % manifest of 0 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
181 644 @ altname |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
182 644 d/a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
183 755 * program |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
184 644 @ syma |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
185 $ manifest source-hg tip |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
186 % manifest of tip |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
187 644 @ altname |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
188 644 d/a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
189 755 * newprog |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
190 644 program |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
191 644 @ syma |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
192 $ cd source-hg |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
193 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
194 test the symlinks can be recreated |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
195 |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
196 $ hg up |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
197 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
198 $ hg cat syma; echo |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
199 a |
8d84166d34d7
tests: unify test-convert-bzr
Matt Mackall <mpm@selenic.com>
parents:
8470
diff
changeset
|
200 |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
201 Multiple branches |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
202 |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
203 $ bzr init-repo -q --no-trees repo |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
204 $ bzr init -q repo/trunk |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
205 $ bzr co repo/trunk repo-trunk |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
206 $ cd repo-trunk |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
207 $ echo a > a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
208 $ bzr add a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
209 adding a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
210 $ bzr ci -qm adda --commit-time '2012-01-01 00:00:01 +0000' |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
211 $ bzr switch -b branch |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
212 Tree is up to date at revision 1. |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
213 Switched to branch: *repo/branch/ (glob) |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
214 $ echo b > b |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
215 $ bzr add b |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
216 adding b |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
217 $ bzr ci -qm addb --commit-time '2012-01-01 00:00:02 +0000' |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
218 $ bzr switch --force ../repo/trunk |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
219 Updated to revision 1. |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
220 Switched to branch: */repo/trunk/ (glob) |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
221 $ echo a >> a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
222 $ bzr ci -qm changea --commit-time '2012-01-01 00:00:03 +0000' |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
223 $ cd .. |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
224 $ hg convert --datesort repo repo-bzr |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
225 initializing destination repo-bzr repository |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
226 scanning source... |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
227 sorting... |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
228 converting... |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
229 2 adda |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
230 1 addb |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
231 0 changea |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
232 $ (cd repo-bzr; glog) |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
233 o 2@default "changea" files: a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
234 | |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
235 | o 1@branch "addb" files: b |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
236 |/ |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
237 o 0@default "adda" files: a |
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
15442
diff
changeset
|
238 |