# HG changeset patch # User Benoit Boissinot # Date 1268496161 -3600 # Node ID 97022cef0a20808431c368af2d384c07d36879c0 # Parent 05856e6825219b6316b8e99a8052c8bd35f2a69a# Parent 181cbb23572ee71f27d4238ab71c60f25a87516b merge with stable diff -r 05856e682521 -r 97022cef0a20 contrib/mercurial.spec --- a/contrib/mercurial.spec Fri Mar 12 01:23:35 2010 +0100 +++ b/contrib/mercurial.spec Sat Mar 13 17:02:41 2010 +0100 @@ -67,7 +67,7 @@ %files %defattr(-,root,root,-) -%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html doc/ja *.cgi contrib/*.fcgi +%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi %doc %attr(644,root,root) %{_mandir}/man?/hg* %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc %{_sysconfdir}/bash_completion.d/mercurial.sh diff -r 05856e682521 -r 97022cef0a20 mercurial/subrepo.py --- a/mercurial/subrepo.py Fri Mar 12 01:23:35 2010 +0100 +++ b/mercurial/subrepo.py Sat Mar 13 17:02:41 2010 +0100 @@ -131,7 +131,7 @@ source = repo._subsource if source.startswith('/') or '://' in source: return source - parent = _abssource(repo._subparent) + parent = _abssource(repo._subparent, push) if '://' in parent: if parent[-1] == '/': parent = parent[:-1] @@ -177,24 +177,32 @@ self._state = state r = ctx._repo root = r.wjoin(path) - if os.path.exists(os.path.join(root, '.hg')): - self._repo = hg.repository(r.ui, root) - else: + create = False + if not os.path.exists(os.path.join(root, '.hg')): + create = True 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' % os.path.join( - _abssource(ctx._repo), path)) - f.close() + self._repo = hg.repository(r.ui, root, create=create) self._repo._subparent = r self._repo._subsource = state[0] + if create: + fp = self._repo.opener("hgrc", "w", text=True) + fp.write('[paths]\n') + + def addpathconfig(key, value): + fp.write('%s = %s\n' % (key, value)) + self._repo.ui.setconfig('paths', key, value) + + defpath = os.path.join(_abssource(ctx._repo), path) + addpathconfig('default', defpath) + fp.close() + def dirty(self): r = self._state[1] if r == '': return True w = self._repo[None] - if w.p1() != self._repo[r]: # version checked out changed + if w.p1() != self._repo[r]: # version checked out change return True return w.dirty() # working directory changed diff -r 05856e682521 -r 97022cef0a20 tests/test-extension --- a/tests/test-extension Fri Mar 12 01:23:35 2010 +0100 +++ b/tests/test-extension Sat Mar 13 17:02:41 2010 +0100 @@ -168,12 +168,13 @@ cat > hgext/broken.py < /dev/null -PYTHONPATH="$TMPPYTHONPATH" -export PYTHONPATH +cat > path.py < /dev/null exit 0