diff mercurial/subrepo.py @ 10378:e1401c74572f

subrepo: change default path in hgrc of subrepo after cloning Previous behavior was to put in the cloned subrepos the path found in the original main repo. However it isn't valid for relative path and it seems more logical to reference instead the subrepos working copy path of the original main repo.
author Saint Germain <saintger@gmail.com>
date Sat, 06 Feb 2010 19:14:37 +0100
parents 55d134ef8ab7
children 4f38d03d4975
line wrap: on
line diff
--- a/mercurial/subrepo.py	Sun Feb 07 15:31:53 2010 +0100
+++ b/mercurial/subrepo.py	Sat Feb 06 19:14:37 2010 +0100
@@ -183,7 +183,8 @@
             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.write('[paths]\ndefault = %s\n' % os.path.join(
+                _abssource(ctx._repo), path))
             f.close()
         self._repo._subparent = r
         self._repo._subsource = state[0]