changeset 1715:40346aa66b0f

Revert convert-repo changes
author Matt Mackall <mpm@selenic.com>
date Mon, 13 Feb 2006 12:48:28 -0600
parents eabfbd220f39
children ef8cd889a78b 7a4a16a7d21f 686bf56c17d0 284fc722c342
files contrib/convert-repo
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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