mercurial/hg.py
changeset 5186 0d5d03844927
parent 4917 126f527b3ba3
parent 5185 156f4c8a12aa
child 5187 c1dbc9ae8f2b
equal deleted inserted replaced
5184:fe4d9f7161ac 5186:0d5d03844927
   203             elif src_repo.local():
   203             elif src_repo.local():
   204                 src_repo.push(dest_repo, revs=revs)
   204                 src_repo.push(dest_repo, revs=revs)
   205             else:
   205             else:
   206                 raise util.Abort(_("clone from remote to remote not supported"))
   206                 raise util.Abort(_("clone from remote to remote not supported"))
   207 
   207 
       
   208         if dir_cleanup:
       
   209             dir_cleanup.close()
       
   210 
   208         if dest_repo.local():
   211         if dest_repo.local():
   209             fp = dest_repo.opener("hgrc", "w", text=True)
   212             fp = dest_repo.opener("hgrc", "w", text=True)
   210             fp.write("[paths]\n")
   213             fp.write("[paths]\n")
   211             fp.write("default = %s\n" % abspath)
   214             fp.write("default = %s\n" % abspath)
   212             fp.close()
   215             fp.close()
   215                 try:
   218                 try:
   216                     checkout = dest_repo.lookup("default")
   219                     checkout = dest_repo.lookup("default")
   217                 except:
   220                 except:
   218                     checkout = dest_repo.changelog.tip()
   221                     checkout = dest_repo.changelog.tip()
   219                 _update(dest_repo, checkout)
   222                 _update(dest_repo, checkout)
   220         if dir_cleanup:
       
   221             dir_cleanup.close()
       
   222 
   223 
   223         return src_repo, dest_repo
   224         return src_repo, dest_repo
   224     finally:
   225     finally:
   225         del src_lock, dest_lock, dir_cleanup
   226         del src_lock, dest_lock, dir_cleanup
   226 
   227