diff mercurial/subrepo.py @ 10697:c90d923fff64 stable

subrepo: fix hgrc paths section during subrepo pulling There are two bugs in current subrepo ctor: - hgrc paths were using parent repo (ctx._repo) instead of self._repo - it was joined with local extract path, not its source repo path Fixed both bugs using _abssource on self once it is fully initialized. It gets the job done perfectly for pull and push urls.
author Edouard Gomez <ed.gomez@free.fr>
date Sun, 14 Mar 2010 00:28:10 +0100
parents 4c50a90b90fc
children 7b0a0d498cc0 33119d0252c1
line wrap: on
line diff
--- a/mercurial/subrepo.py	Tue Mar 09 12:09:57 2010 +0100
+++ b/mercurial/subrepo.py	Sun Mar 14 00:28:10 2010 +0100
@@ -193,8 +193,11 @@
                 fp.write('%s = %s\n' % (key, value))
                 self._repo.ui.setconfig('paths', key, value)
 
-            defpath = os.path.join(_abssource(ctx._repo), path)
+            defpath = _abssource(self._repo)
+            defpushpath = _abssource(self._repo, True)
             addpathconfig('default', defpath)
+            if defpath != defpushpath:
+                addpathconfig('default-push', defpushpath)
             fp.close()
 
     def dirty(self):