##// END OF EJS Templates
cvsps: fix crash when log message refers to non-existent branch (issue1615).
Greg Ward -
r8171:4e5bd9b9 default
parent child Browse files
Show More
@@ -637,7 +637,12 b' def createchangeset(ui, log, fuzz=60, me'
637 637 m = m.group(1)
638 638 if m == 'HEAD':
639 639 m = None
640 candidate = changesets[branches[m]]
640 try:
641 candidate = changesets[branches[m]]
642 except KeyError:
643 ui.warn(_("warning: CVS commit message references "
644 "non-existent branch %r:\n%s\n")
645 % (m, c.comment))
641 646 if m in branches and c.branch != m and not candidate.synthetic:
642 647 c.parents.append(candidate)
643 648
@@ -31,8 +31,10 b' filterpath()'
31 31
32 32 echo "[extensions]" >> $HGRCPATH
33 33 echo "convert = " >> $HGRCPATH
34 echo "graphlog = " >> $HGRCPATH
34 35 echo "[convert]" >> $HGRCPATH
35 36 echo "cvsps=builtin" >> $HGRCPATH
37 echo "cvsps.cache=0" >> $HGRCPATH
36 38 echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
37 39
38 40 echo % create cvs repository with one project
@@ -90,6 +92,18 b' filterpath cvscall -Q update -j1.2 -j1.3'
90 92 cvsci -m"add other text [MERGE from HEAD]" file1
91 93
92 94 set -e
95 echo "% fix bug on v1_1, merge to trunk with error"
96 cvscall -Q update -rv1_1
97 echo "merge forward" >> file1
98 cvscall -Q tag unmerged
99 cvsci -m"fix file1"
100 cvscall -Q update -A
101 filterpath cvscall -Q update -junmerged -jv1_1
102 # note the typo in the commit log message
103 cvsci -m"fix file1 [MERGE from v1-1]"
104 cvs -Q tag -d unmerged
105
106 set -e
93 107 echo % convert to hg
94 108 cd ..
95 109 filterpath hg convert proj proj.hg
@@ -98,11 +112,5 b' echo % complete log'
98 112 template="{rev}: '{branches}' {desc}\n"
99 113 hg -R proj.hg log --template="$template"
100 114
101 echo % parents of rev 3
102 hg -R proj.hg parents --template="$template" -r3
103 echo % parents of rev 4
104 hg -R proj.hg parents --template="$template" -r4
105 echo % parents of rev 5
106 hg -R proj.hg parents --template="$template" -r5
107 echo % parents of rev 7
108 hg -R proj.hg parents --template="$template" -r7
115 echo % graphical log
116 hg -R proj.hg glog --template="$template"
@@ -60,26 +60,43 b' retrieving revision 1.2'
60 60 retrieving revision 1.3
61 61 Merging differences between 1.2 and 1.3 into file1
62 62 cvs -f ci -madd other text [MERGE from HEAD] file1
63 % fix bug on v1_1, merge to trunk with error
64 cvs -f -Q update -rv1_1
65 cvs -f -Q tag unmerged
66 cvs -f ci -mfix file1
67 cvs -f -Q update -A
68 cvs -f -Q update -junmerged -jv1_1
69 RCS file: *REPO*/proj/file1,v
70 retrieving revision 1.1.4.2
71 retrieving revision 1.1.4.3
72 Merging differences between 1.1.4.2 and 1.1.4.3 into file1
73 cvs -f ci -mfix file1 [MERGE from v1-1]
63 74 % convert to hg
75 warning: CVS commit message references non-existent branch 'v1-1':
76 fix file1 [MERGE from v1-1]
64 77 initializing destination proj.hg repository
65 78 connecting to *REPO*
66 79 scanning source...
67 80 using builtin cvsps
68 81 collecting CVS rlog
69 10 log entries
82 12 log entries
70 83 creating changesets
71 8 changeset entries
84 10 changeset entries
72 85 sorting...
73 86 converting...
74 7 add file1 on trunk
75 6 add text
76 5 unrelated change
77 4 add text [MERGE from v1_0]
78 3 add text [MERGE from v1_1]
79 2 add file2 on trunk
80 1 add other text
81 0 add other text [MERGE from HEAD]
87 9 add file1 on trunk
88 8 add text
89 7 unrelated change
90 6 add text [MERGE from v1_0]
91 5 add text [MERGE from v1_1]
92 4 add file2 on trunk
93 3 add other text
94 2 add other text [MERGE from HEAD]
95 1 fix file1
96 0 fix file1 [MERGE from v1-1]
82 97 % complete log
98 9: '' fix file1 [MERGE from v1-1]
99 8: 'v1_1' fix file1
83 100 7: 'v1_1' add other text [MERGE from HEAD]
84 101 6: '' add other text
85 102 5: '' add file2 on trunk
@@ -88,14 +105,24 b" 3: 'v1_1' add text [MERGE from v1_0]"
88 105 2: 'v1_1' unrelated change
89 106 1: 'v1_0' add text
90 107 0: '' add file1 on trunk
91 % parents of rev 3
92 2: 'v1_1' unrelated change
93 1: 'v1_0' add text
94 % parents of rev 4
95 0: '' add file1 on trunk
96 3: 'v1_1' add text [MERGE from v1_0]
97 % parents of rev 5
98 4: '' add text [MERGE from v1_1]
99 % parents of rev 7
100 3: 'v1_1' add text [MERGE from v1_0]
101 6: '' add other text
108 % graphical log
109 o 9: '' fix file1 [MERGE from v1-1]
110 |
111 | o 8: 'v1_1' fix file1
112 | |
113 | o 7: 'v1_1' add other text [MERGE from HEAD]
114 |/|
115 o | 6: '' add other text
116 | |
117 o | 5: '' add file2 on trunk
118 | |
119 o | 4: '' add text [MERGE from v1_1]
120 |\|
121 | o 3: 'v1_1' add text [MERGE from v1_0]
122 | |\
123 +---o 2: 'v1_1' unrelated change
124 | |
125 | o 1: 'v1_0' add text
126 |/
127 o 0: '' add file1 on trunk
128
General Comments 0
You need to be logged in to leave comments. Login now