Show More
@@ -25,6 +25,9 b' from mercurial import hg, util, context,' | |||||
25 |
|
25 | |||
26 | from common import NoRepo, commit, converter_source, converter_sink |
|
26 | from common import NoRepo, commit, converter_source, converter_sink | |
27 |
|
27 | |||
|
28 | import re | |||
|
29 | sha1re = re.compile(r'\b[0-9a-f]{6,40}\b') | |||
|
30 | ||||
28 | class mercurial_sink(converter_sink): |
|
31 | class mercurial_sink(converter_sink): | |
29 | def __init__(self, ui, path): |
|
32 | def __init__(self, ui, path): | |
30 | converter_sink.__init__(self, ui, path) |
|
33 | converter_sink.__init__(self, ui, path) | |
@@ -157,6 +160,14 b' class mercurial_sink(converter_sink):' | |||||
157 | p2 = parents.pop(0) |
|
160 | p2 = parents.pop(0) | |
158 |
|
161 | |||
159 | text = commit.desc |
|
162 | text = commit.desc | |
|
163 | ||||
|
164 | sha1s = re.findall(sha1re, text) | |||
|
165 | for sha1 in sha1s: | |||
|
166 | oldrev = source.lookuprev(sha1) | |||
|
167 | newrev = revmap.get(oldrev) | |||
|
168 | if newrev is not None: | |||
|
169 | text = text.replace(sha1, newrev[:len(sha1)]) | |||
|
170 | ||||
160 | extra = commit.extra.copy() |
|
171 | extra = commit.extra.copy() | |
161 | if self.branchnames and commit.branch: |
|
172 | if self.branchnames and commit.branch: | |
162 | extra['branch'] = commit.branch |
|
173 | extra['branch'] = commit.branch |
General Comments 0
You need to be logged in to leave comments.
Login now