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