| 1 |
#require baz symlink |
| 2 |
|
| 3 |
$ baz my-id "mercurial <[email protected]>" |
| 4 |
|
| 5 |
$ echo "[extensions]" >> $HGRCPATH |
| 6 |
$ echo "convert=" >> $HGRCPATH |
| 7 |
|
| 8 |
create baz archive |
| 9 |
$ baz make-archive baz@mercurial--convert hg-test-convert-baz |
| 10 |
|
| 11 |
initialize baz repo |
| 12 |
$ mkdir baz-repo |
| 13 |
$ cd baz-repo/ |
| 14 |
$ baz init-tree baz@mercurial--convert/baz--test--0 |
| 15 |
$ baz import |
| 16 |
* creating version baz@mercurial--convert/baz--test--0 |
| 17 |
* imported baz@mercurial--convert/baz--test--0 |
| 18 |
|
| 19 |
create initial files |
| 20 |
$ echo 'this is a file' > a |
| 21 |
$ baz add a |
| 22 |
$ mkdir src |
| 23 |
$ baz add src |
| 24 |
$ cd src |
| 25 |
$ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
| 26 |
$ baz add b |
| 27 |
HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" |
| 28 |
$ baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' |
| 29 |
* build pristine tree for baz@mercurial--convert/baz--test--0--base-0 |
| 30 |
* Scanning for full-tree revision: . |
| 31 |
* from import revision: baz@mercurial--convert/baz--test--0--base-0 |
| 32 |
A/ .arch-ids |
| 33 |
A/ src |
| 34 |
A/ src/.arch-ids |
| 35 |
A .arch-ids/a.id |
| 36 |
A a |
| 37 |
A src/.arch-ids/=id |
| 38 |
A src/.arch-ids/b.id |
| 39 |
A src/b |
| 40 |
* update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1) |
| 41 |
* committed baz@mercurial--convert/baz--test--0--patch-1 |
| 42 |
|
| 43 |
create link file and modify a |
| 44 |
$ ln -s ../a a-link |
| 45 |
$ baz add a-link |
| 46 |
$ echo 'this a modification to a' >> ../a |
| 47 |
$ baz commit -s "added link to a and modify a" |
| 48 |
A src/.arch-ids/a-link.id |
| 49 |
A src/a-link |
| 50 |
M a |
| 51 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2) |
| 52 |
* committed baz@mercurial--convert/baz--test--0--patch-2 |
| 53 |
|
| 54 |
create second link and modify b |
| 55 |
$ ln -s ../a a-link-2 |
| 56 |
$ baz add a-link-2 |
| 57 |
$ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
| 58 |
$ baz commit -s "added second link and modify b" |
| 59 |
A src/.arch-ids/a-link-2.id |
| 60 |
A src/a-link-2 |
| 61 |
Mb src/b |
| 62 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3) |
| 63 |
* committed baz@mercurial--convert/baz--test--0--patch-3 |
| 64 |
|
| 65 |
b file to link and a-link-2 to regular file |
| 66 |
$ rm -f a-link-2 |
| 67 |
$ echo 'this is now a regular file' > a-link-2 |
| 68 |
$ ln -sf ../a b |
| 69 |
$ baz commit -s "file to link and link to file test" |
| 70 |
fl src/b |
| 71 |
lf src/a-link-2 |
| 72 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4) |
| 73 |
* committed baz@mercurial--convert/baz--test--0--patch-4 |
| 74 |
|
| 75 |
move a-link-2 file and src directory |
| 76 |
$ cd .. |
| 77 |
$ baz mv src/a-link-2 c |
| 78 |
$ baz mv src test |
| 79 |
$ baz commit -s "move and rename a-link-2 file and src directory" |
| 80 |
D/ src/.arch-ids |
| 81 |
A/ test/.arch-ids |
| 82 |
/> src test |
| 83 |
=> src/.arch-ids/a-link-2.id .arch-ids/c.id |
| 84 |
=> src/a-link-2 c |
| 85 |
=> src/.arch-ids/=id test/.arch-ids/=id |
| 86 |
=> src/.arch-ids/a-link.id test/.arch-ids/a-link.id |
| 87 |
=> src/.arch-ids/b.id test/.arch-ids/b.id |
| 88 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5) |
| 89 |
* committed baz@mercurial--convert/baz--test--0--patch-5 |
| 90 |
|
| 91 |
move and add the moved file again |
| 92 |
$ echo e > e |
| 93 |
$ baz add e |
| 94 |
$ baz commit -s "add e" |
| 95 |
A .arch-ids/e.id |
| 96 |
A e |
| 97 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6) |
| 98 |
* committed baz@mercurial--convert/baz--test--0--patch-6 |
| 99 |
$ baz mv e f |
| 100 |
$ echo ee > e |
| 101 |
$ baz add e |
| 102 |
$ baz commit -s "move e and recreate it again" |
| 103 |
A .arch-ids/e.id |
| 104 |
A e |
| 105 |
=> .arch-ids/e.id .arch-ids/f.id |
| 106 |
=> e f |
| 107 |
* update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7) |
| 108 |
* committed baz@mercurial--convert/baz--test--0--patch-7 |
| 109 |
$ cd .. |
| 110 |
|
| 111 |
converting baz repo to Mercurial |
| 112 |
$ hg convert baz-repo baz-repo-hg |
| 113 |
initializing destination baz-repo-hg repository |
| 114 |
analyzing tree version baz@mercurial--convert/baz--test--0... |
| 115 |
scanning source... |
| 116 |
sorting... |
| 117 |
converting... |
| 118 |
7 initial import |
| 119 |
6 added a file, src and src/b (binary) |
| 120 |
5 added link to a and modify a |
| 121 |
4 added second link and modify b |
| 122 |
3 file to link and link to file test |
| 123 |
2 move and rename a-link-2 file and src directory |
| 124 |
1 add e |
| 125 |
0 move e and recreate it again |
| 126 |
|
| 127 |
$ baz register-archive -d baz@mercurial--convert |
| 128 |
|
| 129 |
$ glog() |
| 130 |
> { |
| 131 |
> hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@" |
| 132 |
> } |
| 133 |
|
| 134 |
show graph log |
| 135 |
$ glog -R baz-repo-hg |
| 136 |
o 7 "move e and recreate it again" files: e f |
| 137 |
| |
| 138 |
o 6 "add e" files: e |
| 139 |
| |
| 140 |
o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b |
| 141 |
| |
| 142 |
o 4 "file to link and link to file test" files: src/a-link-2 src/b |
| 143 |
| |
| 144 |
o 3 "added second link and modify b" files: src/a-link-2 src/b |
| 145 |
| |
| 146 |
o 2 "added link to a and modify a" files: a src/a-link |
| 147 |
| |
| 148 |
o 1 "added a file, src and src/b (binary)" files: a src/b |
| 149 |
| |
| 150 |
o 0 "initial import" files: |
| 151 |
|
| 152 |
$ hg up -q -R baz-repo-hg |
| 153 |
$ hg -R baz-repo-hg manifest --debug |
| 154 |
c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a |
| 155 |
0201ac32a3a8e86e303dff60366382a54b48a72e 644 c |
| 156 |
1a4a864db0073705a11b1439f563bfa4b46d9246 644 e |
| 157 |
09e0222742fc3f75777fa9d68a5d8af7294cb5e7 644 f |
| 158 |
c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link |
| 159 |
375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b |
| 160 |
$ hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies |
| 161 |
copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b) |
| 162 |
copies: f (e) |