Show More
@@ -20,13 +20,15 b' class NoRepo(Exception): pass' | |||||
20 | SKIPREV = 'SKIP' |
|
20 | SKIPREV = 'SKIP' | |
21 |
|
21 | |||
22 | class commit(object): |
|
22 | class commit(object): | |
23 |
def __init__(self, author, date, desc, parents, branch=None, rev=None |
|
23 | def __init__(self, author, date, desc, parents, branch=None, rev=None, | |
|
24 | extra={}): | |||
24 | self.author = author |
|
25 | self.author = author | |
25 | self.date = date |
|
26 | self.date = date | |
26 | self.desc = desc |
|
27 | self.desc = desc | |
27 | self.parents = parents |
|
28 | self.parents = parents | |
28 | self.branch = branch |
|
29 | self.branch = branch | |
29 | self.rev = rev |
|
30 | self.rev = rev | |
|
31 | self.extra = extra | |||
30 |
|
32 | |||
31 | class converter_source(object): |
|
33 | class converter_source(object): | |
32 | """Conversion source interface""" |
|
34 | """Conversion source interface""" |
@@ -108,7 +108,7 b' class mercurial_sink(converter_sink):' | |||||
108 | p2 = parents.pop(0) |
|
108 | p2 = parents.pop(0) | |
109 |
|
109 | |||
110 | text = commit.desc |
|
110 | text = commit.desc | |
111 |
extra = |
|
111 | extra = commit.extra.copy() | |
112 | if self.branchnames and commit.branch: |
|
112 | if self.branchnames and commit.branch: | |
113 | extra['branch'] = commit.branch |
|
113 | extra['branch'] = commit.branch | |
114 | if commit.rev: |
|
114 | if commit.rev: | |
@@ -230,7 +230,7 b' class mercurial_source(converter_source)' | |||||
230 | parents = [hex(p.node()) for p in ctx.parents() if p.node() != nullid] |
|
230 | parents = [hex(p.node()) for p in ctx.parents() if p.node() != nullid] | |
231 | return commit(author=ctx.user(), date=util.datestr(ctx.date()), |
|
231 | return commit(author=ctx.user(), date=util.datestr(ctx.date()), | |
232 | desc=ctx.description(), parents=parents, |
|
232 | desc=ctx.description(), parents=parents, | |
233 | branch=ctx.branch()) |
|
233 | branch=ctx.branch(), extra=ctx.extra()) | |
234 |
|
234 | |||
235 | def gettags(self): |
|
235 | def gettags(self): | |
236 | tags = [t for t in self.repo.tagslist() if t[0] != 'tip'] |
|
236 | tags = [t for t in self.repo.tagslist() if t[0] != 'tip'] |
@@ -82,6 +82,7 b' class changectx(object):' | |||||
82 | def files(self): return self._changeset[3] |
|
82 | def files(self): return self._changeset[3] | |
83 | def description(self): return self._changeset[4] |
|
83 | def description(self): return self._changeset[4] | |
84 | def branch(self): return self._changeset[5].get("branch") |
|
84 | def branch(self): return self._changeset[5].get("branch") | |
|
85 | def extra(self): return self._changeset[5] | |||
85 | def tags(self): return self._repo.nodetags(self._node) |
|
86 | def tags(self): return self._repo.nodetags(self._node) | |
86 |
|
87 | |||
87 | def parents(self): |
|
88 | def parents(self): |
General Comments 0
You need to be logged in to leave comments.
Login now