Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 5185:156f4c8a12aa
clone: do not delete the target if only the update fails
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 17 Aug 2007 00:42:22 +0200 |
parents | 63b9d2deed48 |
children | 0d5d03844927 cbe6e263357b d3874a286b51 |
comparison
equal
deleted
inserted
replaced
5181:ee6a6592c997 | 5185:156f4c8a12aa |
---|---|
210 raise util.Abort(_("clone from remote to remote not supported")) | 210 raise util.Abort(_("clone from remote to remote not supported")) |
211 | 211 |
212 if src_lock: | 212 if src_lock: |
213 src_lock.release() | 213 src_lock.release() |
214 | 214 |
215 if dir_cleanup: | |
216 dir_cleanup.close() | |
217 | |
215 if dest_repo.local(): | 218 if dest_repo.local(): |
216 fp = dest_repo.opener("hgrc", "w", text=True) | 219 fp = dest_repo.opener("hgrc", "w", text=True) |
217 fp.write("[paths]\n") | 220 fp.write("[paths]\n") |
218 fp.write("default = %s\n" % abspath) | 221 fp.write("default = %s\n" % abspath) |
219 fp.close() | 222 fp.close() |
225 try: | 228 try: |
226 checkout = dest_repo.lookup("default") | 229 checkout = dest_repo.lookup("default") |
227 except: | 230 except: |
228 checkout = dest_repo.changelog.tip() | 231 checkout = dest_repo.changelog.tip() |
229 _update(dest_repo, checkout) | 232 _update(dest_repo, checkout) |
230 if dir_cleanup: | |
231 dir_cleanup.close() | |
232 | 233 |
233 return src_repo, dest_repo | 234 return src_repo, dest_repo |
234 | 235 |
235 def _showstats(repo, stats): | 236 def _showstats(repo, stats): |
236 stats = ((stats[0], _("updated")), | 237 stats = ((stats[0], _("updated")), |