comparison 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
comparison
equal deleted inserted replaced
7926:edf2d83a11aa 7927:a218ba5f60df
129 129
130 dest = localpath(dest) 130 dest = localpath(dest)
131 source = localpath(source) 131 source = localpath(source)
132 132
133 if os.path.exists(dest): 133 if os.path.exists(dest):
134 raise util.Abort(_("destination '%s' already exists") % dest) 134 if not os.path.isdir(dest):
135 raise util.Abort(_("destination '%s' already exists") % dest)
136 elif os.listdir(dest):
137 raise util.Abort(_("destination '%s' is not empty") % dest)
135 138
136 class DirCleanup(object): 139 class DirCleanup(object):
137 def __init__(self, dir_): 140 def __init__(self, dir_):
138 self.rmtree = shutil.rmtree 141 self.rmtree = shutil.rmtree
139 self.dir_ = dir_ 142 self.dir_ = dir_