##// END OF EJS Templates
convert: don't drop missing or corrupt tag entries...
Matt Harbison -
r39132:7e023ce2 stable
parent child Browse files
Show More
@@ -143,12 +143,17 b' class mercurial_sink(common.converter_si'
143 for line in data.splitlines():
143 for line in data.splitlines():
144 s = line.split(' ', 1)
144 s = line.split(' ', 1)
145 if len(s) != 2:
145 if len(s) != 2:
146 self.ui.warn(_('invalid tag entry: "%s"\n') % line)
147 fp.write('%s\n' % line) # Bogus, but keep for hash stability
146 continue
148 continue
147 revid = revmap.get(source.lookuprev(s[0]))
149 revid = revmap.get(source.lookuprev(s[0]))
148 if not revid:
150 if not revid:
149 if s[0] == nodemod.nullhex:
151 if s[0] == nodemod.nullhex:
150 revid = s[0]
152 revid = s[0]
151 else:
153 else:
154 # missing, but keep for hash stability
155 self.ui.warn(_('missing tag entry: "%s"\n') % line)
156 fp.write('%s\n' % line)
152 continue
157 continue
153 fp.write('%s %s\n' % (revid, s[1]))
158 fp.write('%s %s\n' % (revid, s[1]))
154 return fp.getvalue()
159 return fp.getvalue()
@@ -17,10 +17,17 b''
17 $ hg ci -qAm 'add foo/file'
17 $ hg ci -qAm 'add foo/file'
18 $ hg tag some-tag
18 $ hg tag some-tag
19 $ hg tag -l local-tag
19 $ hg tag -l local-tag
20 $ echo '1234567890123456789012345678901234567890 missing_tag' >> .hgtags
21 $ hg ci -m 'add a missing tag'
20 $ hg log
22 $ hg log
23 changeset: 4:3fb95ee23a66
24 tag: tip
25 user: test
26 date: Thu Jan 01 00:00:00 1970 +0000
27 summary: add a missing tag
28
21 changeset: 3:593cbf6fb2b4
29 changeset: 3:593cbf6fb2b4
22 tag: local-tag
30 tag: local-tag
23 tag: tip
24 user: test
31 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
32 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: Added tag some-tag for changeset ad681a868e44
33 summary: Added tag some-tag for changeset ad681a868e44
@@ -48,12 +55,16 b''
48 scanning source...
55 scanning source...
49 sorting...
56 sorting...
50 converting...
57 converting...
51 3 add foo and bar
58 4 add foo and bar
52 2 remove foo
59 3 remove foo
53 1 add foo/file
60 2 add foo/file
54 0 Added tag some-tag for changeset ad681a868e44
61 1 Added tag some-tag for changeset ad681a868e44
62 0 add a missing tag
63 missing tag entry: "1234567890123456789012345678901234567890 missing_tag"
55 $ cd new
64 $ cd new
56 $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n'
65 $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n'
66 o 4 3fb95ee23a66 (public) "add a missing tag"
67 |
57 o 3 593cbf6fb2b4 (public) "Added tag some-tag for changeset ad681a868e44"
68 o 3 593cbf6fb2b4 (public) "Added tag some-tag for changeset ad681a868e44"
58 |
69 |
59 o 2 ad681a868e44 (public) "add foo/file"
70 o 2 ad681a868e44 (public) "add foo/file"
@@ -125,14 +136,16 b' test tag rewriting'
125 scanning source...
136 scanning source...
126 sorting...
137 sorting...
127 converting...
138 converting...
128 4 add foo and bar
139 5 add foo and bar
129 3 remove foo
140 4 remove foo
130 2 add foo/file
141 3 add foo/file
131 1 Added tag some-tag for changeset ad681a868e44
142 2 Added tag some-tag for changeset ad681a868e44
143 1 add a missing tag
144 missing tag entry: "1234567890123456789012345678901234567890 missing_tag"
132 0 add baz
145 0 add baz
133 $ cd new-filemap
146 $ cd new-filemap
134 $ hg tags
147 $ hg tags
135 tip 2:3c74706b1ff8
148 tip 3:7bb553f2c68a
136 some-tag 0:ba8636729451
149 some-tag 0:ba8636729451
137 $ cd ..
150 $ cd ..
138
151
General Comments 0
You need to be logged in to leave comments. Login now