Mercurial > hg-stable
comparison mercurial/hg.py @ 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 |
comparison
equal
deleted
inserted
replaced
21802:ff27fad408c4 | 21803:62cc4055c6c8 |
---|---|
309 dest = util.urllocalpath(dest) | 309 dest = util.urllocalpath(dest) |
310 source = util.urllocalpath(source) | 310 source = util.urllocalpath(source) |
311 | 311 |
312 if not dest: | 312 if not dest: |
313 raise util.Abort(_("empty destination path is not valid")) | 313 raise util.Abort(_("empty destination path is not valid")) |
314 if os.path.exists(dest): | 314 |
315 if not os.path.isdir(dest): | 315 destvfs = scmutil.vfs(dest, expandpath=True) |
316 if destvfs.lexists(): | |
317 if not destvfs.isdir(): | |
316 raise util.Abort(_("destination '%s' already exists") % dest) | 318 raise util.Abort(_("destination '%s' already exists") % dest) |
317 elif os.listdir(dest): | 319 elif os.listdir(dest): |
318 raise util.Abort(_("destination '%s' is not empty") % dest) | 320 raise util.Abort(_("destination '%s' is not empty") % dest) |
319 | 321 |
320 srclock = destlock = cleandir = None | 322 srclock = destlock = cleandir = None |