def putcommit(self, files, copies, parents, commit, source, revmap):
### gegogi mod ###
def _cp949(s):
return s.decode('utf-8').encode('cp950')
def _utf8(s):
return s.decode('cp950').encode('utf-8')
##################
files = dict(files)
### gegogi mod ###
for k, v in files.items():
del files[k]
files[_cp949(k)] = v
for k, v in copies.items():
del copies[k]
copies[_cp949(k)] = _cp949(v)
##################
def getfilectx(repo, memctx, f):
### gegogi mod ###
v = files[f]
data , e= source.getfile(_utf8(f), v)
if f == '.hgtags':
data = self._rewritetags(source, revmap, data)
return context.memfilectx(f, data, 'l' in e, 'x' in e, copies.get(f))
##################
pl = []
for p in parents:
if p not in pl:
pl.append(p)
parents = pl
nparents = len(parents)
if self.filemapmode and nparents == 1:
m1node = self.repo.changelog.read(bin(parents[0]))[0]
parent = parents[0]
if len(parents) < 2:
parents.append(nullid)
if len(parents) < 2:
parents.append(nullid)
p2 = parents.pop(0)
text = commit.desc
extra = commit.extra.copy()
if self.branchnames and commit.branch:
extra['branch'] = commit.branch
if commit.rev:
extra['convert_revision'] = commit.rev
while parents:
p1 = p2
p2 = parents.pop(0)
ctx = context.memctx(self.repo, (p1, p2), text, files.keys(),
getfilectx, commit.author, commit.date, extra)
self.repo.commitctx(ctx)
text = "(octopus merge fixup)\n"
p2 = hex(self.repo.changelog.tip())
if self.filemapmode and nparents == 1:
man = self.repo.manifest
mnode = self.repo.changelog.read(bin(p2))[0]
closed = 'close' in commit.extra
if not closed and not man.cmp(m1node, man.revision(mnode)):
self.ui.status(_("filtering out empty revision\n"))
self.repo.rollback(force=True)
return parent
return p2