# HG changeset patch # User Matt Mackall # Date 1139856508 21600 # Node ID 40346aa66b0f8c285c65f93be5fdeb21f4f364f6 # Parent eabfbd220f399e112cfce91e0aee38f6ac689971 Revert convert-repo changes diff -r eabfbd220f39 -r 40346aa66b0f contrib/convert-repo --- a/contrib/convert-repo Sat Feb 11 00:31:52 2006 -0800 +++ b/contrib/convert-repo Mon Feb 13 12:48:28 2006 -0600 @@ -21,7 +21,7 @@ # interrupted and can be run repeatedly to copy new commits. import sys, os, zlib, sha, time -from mercurial import hg, ui, util, commands +from mercurial import hg, ui, util class convert_git: def __init__(self, path): @@ -113,7 +113,7 @@ except: pass - def putcommit(self, files, parents, author, date, text): + def putcommit(self, files, parents, author, dest, text): seen = {} pl = [] for p in parents: @@ -129,13 +129,8 @@ while parents: p1 = p2 p2 = parents.pop(0) - self.repo.dirstate.setparents(hg.bin(p1), hg.bin(p2)) - if len(files) > 0: - olddir = os.getcwd() - os.chdir(self.path) - commands.addremove(self.repo.ui, self.repo, *files) - os.chdir(olddir) - self.repo.commit(files, text, author, date) + self.repo.rawcommit(files, text, author, dest, + hg.bin(p1), hg.bin(p2)) text = "(octopus merge fixup)\n" p2 = hg.hex(self.repo.changelog.tip()) @@ -265,6 +260,7 @@ t = self.toposort(parents) t = [n for n in t if n not in self.map] num = len(t) + c = None for c in t: num -= 1 @@ -279,7 +275,7 @@ if v in self.map: ctags[k] = self.map[v] - if ctags: + if c and ctags: nrev = self.dest.puttags(ctags) # write another hash correspondence to override the previous # one so we don't end up with extra tag heads