[PATCH 1 of 1] convert: missing p4 tool is only slightly fatal

Mads Kiilerich mads at kiilerich.com
Fri Mar 27 07:40:03 CDT 2009


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1238157558 -3600
# Node ID e1bc4e07919fceafd061b2255610bd131f14b83b
# Parent  67e59a9886d5902de5b94cd2552d854b6292ec63
convert: missing p4 tool is only slightly fatal

checktool with default abort=True caused convert to fail too early.

diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py
--- a/hgext/convert/p4.py
+++ b/hgext/convert/p4.py
@@ -28,7 +28,7 @@
     def __init__(self, ui, path, rev=None):
         super(p4_source, self).__init__(ui, path, rev=rev)
 
-        checktool('p4')
+        checktool('p4', abort=False)
 
         self.p4changes = {}
         self.heads = {}
diff --git a/tests/test-convert b/tests/test-convert
--- a/tests/test-convert
+++ b/tests/test-convert
@@ -44,3 +44,7 @@
 echo 'include b' > filemap
 hg convert --debug --filemap filemap a partialb | \
     grep 'run hg'
+
+echo % converting empty dir should fail "nicely"
+mkdir emptydir
+PATH=$BINDIR hg convert emptydir 2>&1 | sed 's,file://.*/emptydir,.../emptydir,g'
diff --git a/tests/test-convert.out b/tests/test-convert.out
--- a/tests/test-convert.out
+++ b/tests/test-convert.out
@@ -226,3 +226,16 @@
 run hg sink pre-conversion action
 run hg sink post-conversion action
 run hg source post-conversion action
+% converting empty dir should fail nicely
+assuming destination emptydir-hg
+initializing destination emptydir-hg repository
+emptydir does not look like a CVS checkout
+emptydir does not look like a Git repo
+.../emptydir does not look like a Subversion repo
+emptydir is not a local Mercurial repo
+emptydir does not look like a darcs repo
+cannot find required "mtn" tool
+emptydir does not look like a GNU Arch repo
+emptydir does not look like a Bazaar repo
+cannot find required "p4" tool
+abort: emptydir: missing or unsupported repository


More information about the Mercurial-devel mailing list