diff mercurial/hg.py @ 7927:a218ba5f60df

allow clone into existing but empty directories
author Steve Borho <steve@borho.org>
date Sun, 29 Mar 2009 16:15:06 -0500
parents 9fe7e6acf525
children 39566bb99a9c
line wrap: on
line diff
--- a/mercurial/hg.py	Sun Mar 29 19:56:53 2009 -0300
+++ b/mercurial/hg.py	Sun Mar 29 16:15:06 2009 -0500
@@ -131,7 +131,10 @@
     source = localpath(source)
 
     if os.path.exists(dest):
-        raise util.Abort(_("destination '%s' already exists") % dest)
+        if not os.path.isdir(dest):
+            raise util.Abort(_("destination '%s' already exists") % dest)
+        elif os.listdir(dest):
+            raise util.Abort(_("destination '%s' is not empty") % dest)
 
     class DirCleanup(object):
         def __init__(self, dir_):