##// 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 m = m.group(1)
637 m = m.group(1)
638 if m == 'HEAD':
638 if m == 'HEAD':
639 m = None
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 if m in branches and c.branch != m and not candidate.synthetic:
646 if m in branches and c.branch != m and not candidate.synthetic:
642 c.parents.append(candidate)
647 c.parents.append(candidate)
643
648
@@ -31,8 +31,10 b' filterpath()'
31
31
32 echo "[extensions]" >> $HGRCPATH
32 echo "[extensions]" >> $HGRCPATH
33 echo "convert = " >> $HGRCPATH
33 echo "convert = " >> $HGRCPATH
34 echo "graphlog = " >> $HGRCPATH
34 echo "[convert]" >> $HGRCPATH
35 echo "[convert]" >> $HGRCPATH
35 echo "cvsps=builtin" >> $HGRCPATH
36 echo "cvsps=builtin" >> $HGRCPATH
37 echo "cvsps.cache=0" >> $HGRCPATH
36 echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
38 echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
37
39
38 echo % create cvs repository with one project
40 echo % create cvs repository with one project
@@ -90,6 +92,18 b' filterpath cvscall -Q update -j1.2 -j1.3'
90 cvsci -m"add other text [MERGE from HEAD]" file1
92 cvsci -m"add other text [MERGE from HEAD]" file1
91
93
92 set -e
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 echo % convert to hg
107 echo % convert to hg
94 cd ..
108 cd ..
95 filterpath hg convert proj proj.hg
109 filterpath hg convert proj proj.hg
@@ -98,11 +112,5 b' echo % complete log'
98 template="{rev}: '{branches}' {desc}\n"
112 template="{rev}: '{branches}' {desc}\n"
99 hg -R proj.hg log --template="$template"
113 hg -R proj.hg log --template="$template"
100
114
101 echo % parents of rev 3
115 echo % graphical log
102 hg -R proj.hg parents --template="$template" -r3
116 hg -R proj.hg glog --template="$template"
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
@@ -60,26 +60,43 b' retrieving revision 1.2'
60 retrieving revision 1.3
60 retrieving revision 1.3
61 Merging differences between 1.2 and 1.3 into file1
61 Merging differences between 1.2 and 1.3 into file1
62 cvs -f ci -madd other text [MERGE from HEAD] file1
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 % convert to hg
74 % convert to hg
75 warning: CVS commit message references non-existent branch 'v1-1':
76 fix file1 [MERGE from v1-1]
64 initializing destination proj.hg repository
77 initializing destination proj.hg repository
65 connecting to *REPO*
78 connecting to *REPO*
66 scanning source...
79 scanning source...
67 using builtin cvsps
80 using builtin cvsps
68 collecting CVS rlog
81 collecting CVS rlog
69 10 log entries
82 12 log entries
70 creating changesets
83 creating changesets
71 8 changeset entries
84 10 changeset entries
72 sorting...
85 sorting...
73 converting...
86 converting...
74 7 add file1 on trunk
87 9 add file1 on trunk
75 6 add text
88 8 add text
76 5 unrelated change
89 7 unrelated change
77 4 add text [MERGE from v1_0]
90 6 add text [MERGE from v1_0]
78 3 add text [MERGE from v1_1]
91 5 add text [MERGE from v1_1]
79 2 add file2 on trunk
92 4 add file2 on trunk
80 1 add other text
93 3 add other text
81 0 add other text [MERGE from HEAD]
94 2 add other text [MERGE from HEAD]
95 1 fix file1
96 0 fix file1 [MERGE from v1-1]
82 % complete log
97 % complete log
98 9: '' fix file1 [MERGE from v1-1]
99 8: 'v1_1' fix file1
83 7: 'v1_1' add other text [MERGE from HEAD]
100 7: 'v1_1' add other text [MERGE from HEAD]
84 6: '' add other text
101 6: '' add other text
85 5: '' add file2 on trunk
102 5: '' add file2 on trunk
@@ -88,14 +105,24 b" 3: 'v1_1' add text [MERGE from v1_0]"
88 2: 'v1_1' unrelated change
105 2: 'v1_1' unrelated change
89 1: 'v1_0' add text
106 1: 'v1_0' add text
90 0: '' add file1 on trunk
107 0: '' add file1 on trunk
91 % parents of rev 3
108 % graphical log
92 2: 'v1_1' unrelated change
109 o 9: '' fix file1 [MERGE from v1-1]
93 1: 'v1_0' add text
110 |
94 % parents of rev 4
111 | o 8: 'v1_1' fix file1
95 0: '' add file1 on trunk
112 | |
96 3: 'v1_1' add text [MERGE from v1_0]
113 | o 7: 'v1_1' add other text [MERGE from HEAD]
97 % parents of rev 5
114 |/|
98 4: '' add text [MERGE from v1_1]
115 o | 6: '' add other text
99 % parents of rev 7
116 | |
100 3: 'v1_1' add text [MERGE from v1_0]
117 o | 5: '' add file2 on trunk
101 6: '' add other text
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