[PATCH] transplant: remove the restriction that the destination repository be nonempty.

Jacob Lee artdent at gmail.com
Fri Apr 24 21:47:14 CDT 2009


I'm sorry, that patch included another test I was trying and couldn't
get to work. (Plus having my signature at the bottom probably did not
make it easier to import it.) Here's the revised version that should
succeed; apologies for the resubmission.

# HG changeset patch
# User Jacob Lee <artdent at gmail.com>
# Date 1240627490 18000
# Node ID 4bdc5ecdf881c76aa354798e4cf2a3f8b4e78c10
# Parent  4f13ed6ee5448cf5de72446f2b6a418e33f691da
transplant: remove the restriction that the destination repository be nonempty.

diff -r 4f13ed6ee544 -r 4bdc5ecdf881 hgext/transplant.py
--- a/hgext/transplant.py	Thu Apr 23 15:40:10 2009 -0500
+++ b/hgext/transplant.py	Fri Apr 24 21:44:50 2009 -0500
@@ -528,8 +528,6 @@
     tp = transplanter(ui, repo)

     p1, p2 = repo.dirstate.parents()
-    if p1 == revlog.nullid:
-        raise util.Abort(_('no revision checked out'))
     if not opts.get('continue'):
         if p2 != revlog.nullid:
             raise util.Abort(_('outstanding uncommitted merges'))
diff -r 4f13ed6ee544 -r 4bdc5ecdf881 tests/test-transplant
--- a/tests/test-transplant	Thu Apr 23 15:40:10 2009 -0500
+++ b/tests/test-transplant	Fri Apr 24 21:44:50 2009 -0500
@@ -114,3 +114,9 @@
 echo % tranplant
 hg transplant -m 1
 cd ..
+
+echo '% test transplant into empty repository'
+hg init empty
+cd empty
+hg transplant -s ../t -b tip -a
+cd ..
diff -r 4f13ed6ee544 -r 4bdc5ecdf881 tests/test-transplant.out
--- a/tests/test-transplant.out	Thu Apr 23 15:40:10 2009 -0500
+++ b/tests/test-transplant.out	Fri Apr 24 21:44:50 2009 -0500
@@ -136,3 +136,9 @@
 % tranplant
 applying 42dc4432fd35
 1:42dc4432fd35 merged at a9f4acbac129
+% test transplant into empty repository
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 4 changesets with 4 changes to 4 files


More information about the Mercurial-devel mailing list