subrepo: add default path to new clones stable
authorMatt Mackall <mpm@selenic.com>
Mon, 14 Dec 2009 15:01:13 -0600
branchstable
changeset 10068 8f14f749f471
parent 10051 a02d43acbc04
child 10069 606b563e41db
child 10074 ad5ef62b5a98
subrepo: add default path to new clones
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Mon Dec 07 12:44:15 2009 -0500
+++ b/mercurial/subrepo.py	Mon Dec 14 15:01:13 2009 -0600
@@ -160,6 +160,9 @@
         else:
             util.makedirs(root)
             self._repo = hg.repository(r.ui, root, create=True)
+            f = file(os.path.join(root, '.hg', 'hgrc'), 'w')
+            f.write('[paths]\ndefault = %s\n' % state[0])
+            f.close()
         self._repo._subparent = r
         self._repo._subsource = state[0]