Show More
@@ -143,20 +143,30 b' class convert_git(converter_source):' | |||
|
143 | 143 | |
|
144 | 144 | def gettags(self): |
|
145 | 145 | tags = {} |
|
146 | alltags = {} | |
|
146 | 147 | fh = self.gitopen('git ls-remote --tags "%s"' % self.path) |
|
147 | 148 | prefix = 'refs/tags/' |
|
149 | ||
|
150 | # Build complete list of tags, both annotated and bare ones | |
|
148 | 151 | for line in fh: |
|
149 | 152 | line = line.strip() |
|
150 | if not line.endswith("^{}"): | |
|
151 | continue | |
|
152 | 153 | node, tag = line.split(None, 1) |
|
153 | 154 | if not tag.startswith(prefix): |
|
154 | 155 | continue |
|
155 |
|
|
|
156 | tags[tag] = node | |
|
156 | alltags[tag[len(prefix):]] = node | |
|
157 | 157 | if fh.close(): |
|
158 | 158 | raise util.Abort(_('cannot read tags from %s') % self.path) |
|
159 | 159 | |
|
160 | # Filter out tag objects for annotated tag refs | |
|
161 | for tag in alltags: | |
|
162 | if tag.endswith('^{}'): | |
|
163 | tags[tag[:-3]] = alltags[tag] | |
|
164 | else: | |
|
165 | if tag + '^{}' in alltags: | |
|
166 | continue | |
|
167 | else: | |
|
168 | tags[tag] = alltags[tag] | |
|
169 | ||
|
160 | 170 | return tags |
|
161 | 171 | |
|
162 | 172 | def getchangedfiles(self, version, i): |
General Comments 0
You need to be logged in to leave comments.
Login now