Mercurial > hg
comparison hgext/convert/hg.py @ 11134:33010ff1fd6f
convert: merge sources getmode() into getfile()
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 09 May 2010 21:52:34 +0200 |
parents | 9f6731b03906 |
children | a2f11188e2d2 |
comparison
equal
deleted
inserted
replaced
11133:d7b6aab612b4 | 11134:33010ff1fd6f |
---|---|
132 def putcommit(self, files, copies, parents, commit, source, revmap): | 132 def putcommit(self, files, copies, parents, commit, source, revmap): |
133 | 133 |
134 files = dict(files) | 134 files = dict(files) |
135 def getfilectx(repo, memctx, f): | 135 def getfilectx(repo, memctx, f): |
136 v = files[f] | 136 v = files[f] |
137 data = source.getfile(f, v) | 137 data, mode = source.getfile(f, v) |
138 e = source.getmode(f, v) | |
139 if f == '.hgtags': | 138 if f == '.hgtags': |
140 data = self._rewritetags(source, revmap, data) | 139 data = self._rewritetags(source, revmap, data) |
141 return context.memfilectx(f, data, 'l' in e, 'x' in e, copies.get(f)) | 140 return context.memfilectx(f, data, 'l' in mode, 'x' in mode, |
141 copies.get(f)) | |
142 | 142 |
143 pl = [] | 143 pl = [] |
144 for p in parents: | 144 for p in parents: |
145 if p not in pl: | 145 if p not in pl: |
146 pl.append(p) | 146 pl.append(p) |
264 heads = self.repo.heads() | 264 heads = self.repo.heads() |
265 return [hex(h) for h in heads if self.keep(h)] | 265 return [hex(h) for h in heads if self.keep(h)] |
266 | 266 |
267 def getfile(self, name, rev): | 267 def getfile(self, name, rev): |
268 try: | 268 try: |
269 return self.changectx(rev)[name].data() | 269 fctx = self.changectx(rev)[name] |
270 return fctx.data(), fctx.flags() | |
270 except error.LookupError, err: | 271 except error.LookupError, err: |
271 raise IOError(err) | 272 raise IOError(err) |
272 | |
273 def getmode(self, name, rev): | |
274 return self.changectx(rev).manifest().flags(name) | |
275 | 273 |
276 def getchanges(self, rev): | 274 def getchanges(self, rev): |
277 ctx = self.changectx(rev) | 275 ctx = self.changectx(rev) |
278 parents = self.parents(ctx) | 276 parents = self.parents(ctx) |
279 if not parents: | 277 if not parents: |