mercurial/hg.py
changeset 17938 fd903f89e42b
parent 17922 7f5dab94e48c
child 18303 4d1671b39168
equal deleted inserted replaced
17937:3cb032d50447 17938:fd903f89e42b
   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 default:
   174     if not default:
   175         fp = r.opener("hgrc", "w", text=True)
   175         # set default to source for being able to clone subrepos
   176         fp.write("[paths]\n")
   176         default = os.path.abspath(util.urllocalpath(origsource))
   177         fp.write("default = %s\n" % default)
   177     fp = r.opener("hgrc", "w", text=True)
   178         fp.close()
   178     fp.write("[paths]\n")
       
   179     fp.write("default = %s\n" % default)
       
   180     fp.close()
       
   181     r.ui.setconfig('paths', 'default', default)
   179 
   182 
   180     if update:
   183     if update:
   181         r.ui.status(_("updating working directory\n"))
   184         r.ui.status(_("updating working directory\n"))
   182         if update is not True:
   185         if update is not True:
   183             checkout = update
   186             checkout = update