| 1 |
|
| 2 |
$ cat <<EOF >> $HGRCPATH |
| 3 |
> [extensions] |
| 4 |
> convert = |
| 5 |
> [convert] |
| 6 |
> hg.tagsbranch = 0 |
| 7 |
> EOF |
| 8 |
$ hg init source |
| 9 |
$ cd source |
| 10 |
$ echo a > a |
| 11 |
$ hg ci -qAm adda |
| 12 |
|
| 13 |
Add a merge with one parent in the same branch |
| 14 |
|
| 15 |
$ echo a >> a |
| 16 |
$ hg ci -qAm changea |
| 17 |
$ hg up -qC 0 |
| 18 |
$ hg branch branch0 |
| 19 |
marked working directory as branch branch0 |
| 20 |
(branches are permanent and global, did you want a bookmark?) |
| 21 |
$ echo b > b |
| 22 |
$ hg ci -qAm addb |
| 23 |
$ hg up -qC |
| 24 |
$ hg merge default |
| 25 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 26 |
(branch merge, don't forget to commit) |
| 27 |
$ hg ci -qm mergeab |
| 28 |
$ hg tag -ql mergeab |
| 29 |
$ cd .. |
| 30 |
|
| 31 |
Miss perl... sometimes |
| 32 |
|
| 33 |
$ cat > filter.py <<EOF |
| 34 |
> import re |
| 35 |
> import sys |
| 36 |
> |
| 37 |
> r = re.compile(r'^(?:\d+|pulling from)') |
| 38 |
> sys.stdout.writelines([l for l in sys.stdin if r.search(l)]) |
| 39 |
> EOF |
| 40 |
|
| 41 |
convert |
| 42 |
|
| 43 |
$ hg convert -v --config convert.hg.clonebranches=1 source dest | |
| 44 |
> "$PYTHON" filter.py |
| 45 |
3 adda |
| 46 |
2 changea |
| 47 |
1 addb |
| 48 |
pulling from default into branch0 |
| 49 |
1 changesets found |
| 50 |
0 mergeab |
| 51 |
pulling from default into branch0 |
| 52 |
1 changesets found |
| 53 |
|
| 54 |
Add a merge with both parents and child in different branches |
| 55 |
|
| 56 |
$ cd source |
| 57 |
$ hg branch branch1 |
| 58 |
marked working directory as branch branch1 |
| 59 |
$ echo a > file1 |
| 60 |
$ hg ci -qAm c1 |
| 61 |
$ hg up -qC mergeab |
| 62 |
$ hg branch branch2 |
| 63 |
marked working directory as branch branch2 |
| 64 |
$ echo a > file2 |
| 65 |
$ hg ci -qAm c2 |
| 66 |
$ hg merge branch1 |
| 67 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 68 |
(branch merge, don't forget to commit) |
| 69 |
$ hg branch branch3 |
| 70 |
marked working directory as branch branch3 |
| 71 |
$ hg ci -qAm c3 |
| 72 |
$ cd .. |
| 73 |
|
| 74 |
incremental conversion |
| 75 |
|
| 76 |
$ hg convert -v --config convert.hg.clonebranches=1 source dest | |
| 77 |
> "$PYTHON" filter.py |
| 78 |
2 c1 |
| 79 |
pulling from branch0 into branch1 |
| 80 |
4 changesets found |
| 81 |
1 c2 |
| 82 |
pulling from branch0 into branch2 |
| 83 |
4 changesets found |
| 84 |
0 c3 |
| 85 |
pulling from branch1 into branch3 |
| 86 |
5 changesets found |
| 87 |
pulling from branch2 into branch3 |
| 88 |
1 changesets found |