Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/convert/hg.py @ 5435:d0c67b52ac01
convert: make contents of "extra" dict available from sources, for sinks.
This breaks hash preservation for hg->hg conversion, as each converted
change gets a convert_revision item added to its extra dict. Ugh.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 10 Oct 2007 15:30:00 -0700 |
parents | 4d34f8b12a9e |
children | b4ae8535f834 |
comparison
equal
deleted
inserted
replaced
5434:6fa5258be3d4 | 5435:d0c67b52ac01 |
---|---|
106 if len(parents) < 2: parents.append("0" * 40) | 106 if len(parents) < 2: parents.append("0" * 40) |
107 if len(parents) < 2: parents.append("0" * 40) | 107 if len(parents) < 2: parents.append("0" * 40) |
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: |
115 extra['convert_revision'] = commit.rev | 115 extra['convert_revision'] = commit.rev |
116 | 116 |
228 def getcommit(self, rev): | 228 def getcommit(self, rev): |
229 ctx = self.changectx(rev) | 229 ctx = self.changectx(rev) |
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'] |
237 return dict([(name, hex(node)) for name, node in tags]) | 237 return dict([(name, hex(node)) for name, node in tags]) |
238 | 238 |