Show More
@@ -173,8 +173,15 b' def clone(ui, source, dest=None, pull=Fa' | |||||
173 | src_store = os.path.realpath(src_repo.spath) |
|
173 | src_store = os.path.realpath(src_repo.spath) | |
174 | if not os.path.exists(dest): |
|
174 | if not os.path.exists(dest): | |
175 | os.mkdir(dest) |
|
175 | os.mkdir(dest) | |
176 | dest_path = os.path.realpath(os.path.join(dest, ".hg")) |
|
176 | try: | |
177 | os.mkdir(dest_path) |
|
177 | dest_path = os.path.realpath(os.path.join(dest, ".hg")) | |
|
178 | os.mkdir(dest_path) | |||
|
179 | except OSError, inst: | |||
|
180 | if inst.errno == errno.EEXIST: | |||
|
181 | dir_cleanup.close() | |||
|
182 | raise util.Abort(_("destination '%s' already exists") | |||
|
183 | % dest) | |||
|
184 | raise | |||
178 | if src_repo.spath != src_repo.path: |
|
185 | if src_repo.spath != src_repo.path: | |
179 | # XXX racy |
|
186 | # XXX racy | |
180 | dummy_changelog = os.path.join(dest_path, "00changelog.i") |
|
187 | dummy_changelog = os.path.join(dest_path, "00changelog.i") | |
@@ -203,7 +210,14 b' def clone(ui, source, dest=None, pull=Fa' | |||||
203 | dest_repo = repository(ui, dest) |
|
210 | dest_repo = repository(ui, dest) | |
204 |
|
211 | |||
205 | else: |
|
212 | else: | |
206 | dest_repo = repository(ui, dest, create=True) |
|
213 | try: | |
|
214 | dest_repo = repository(ui, dest, create=True) | |||
|
215 | except OSError, inst: | |||
|
216 | if inst.errno == errno.EEXIST: | |||
|
217 | dir_cleanup.close() | |||
|
218 | raise util.Abort(_("destination '%s' already exists") | |||
|
219 | % dest) | |||
|
220 | raise | |||
207 |
|
221 | |||
208 | revs = None |
|
222 | revs = None | |
209 | if rev: |
|
223 | if rev: |
General Comments 0
You need to be logged in to leave comments.
Login now