mercurial/hg.py
changeset 7927 a218ba5f60df
parent 7821 9fe7e6acf525
child 7935 39566bb99a9c
--- 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_):