changeset 21803:62cc4055c6c8

hg: use vfs functions in clone This change applies vfs functions in clone. destvfs.exists will invoke os.path.lexists via lexists of vfs to check for broken symbolic links.
author Chinmay Joshi <c@chinmayjoshi.com>
date Sat, 21 Jun 2014 14:44:09 +0530
parents ff27fad408c4
children becb61de90a1
files mercurial/hg.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Jun 21 14:40:29 2014 +0530
+++ b/mercurial/hg.py	Sat Jun 21 14:44:09 2014 +0530
@@ -311,8 +311,10 @@
 
     if not dest:
         raise util.Abort(_("empty destination path is not valid"))
-    if os.path.exists(dest):
-        if not os.path.isdir(dest):
+
+    destvfs = scmutil.vfs(dest, expandpath=True)
+    if destvfs.lexists():
+        if not destvfs.isdir():
             raise util.Abort(_("destination '%s' already exists") % dest)
         elif os.listdir(dest):
             raise util.Abort(_("destination '%s' is not empty") % dest)