mercurial/hg.py
branchstable
changeset 18511 798ab869b2ee
parent 18493 fe67107094fd
child 18553 b6b9475c563a
equal deleted inserted replaced
18510:f254ab6207ae 18511:798ab869b2ee
   169     util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
   169     util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
   170 
   170 
   171     r = repository(ui, root)
   171     r = repository(ui, root)
   172 
   172 
   173     default = srcrepo.ui.config('paths', 'default')
   173     default = srcrepo.ui.config('paths', 'default')
   174     if not default:
   174     if default:
   175         # set default to source for being able to clone subrepos
   175         fp = r.opener("hgrc", "w", text=True)
   176         default = os.path.abspath(util.urllocalpath(origsource))
   176         fp.write("[paths]\n")
   177     fp = r.opener("hgrc", "w", text=True)
   177         fp.write("default = %s\n" % default)
   178     fp.write("[paths]\n")
   178         fp.close()
   179     fp.write("default = %s\n" % default)
       
   180     fp.close()
       
   181     r.ui.setconfig('paths', 'default', default)
       
   182 
   179 
   183     if update:
   180     if update:
   184         r.ui.status(_("updating working directory\n"))
   181         r.ui.status(_("updating working directory\n"))
   185         if update is not True:
   182         if update is not True:
   186             checkout = update
   183             checkout = update