##// END OF EJS Templates
merge with stable
Benoit Boissinot -
r10670:97022cef merge default
parent child Browse files
Show More
@@ -67,7 +67,7 b' rm -rf $RPM_BUILD_ROOT'
67
67
68 %files
68 %files
69 %defattr(-,root,root,-)
69 %defattr(-,root,root,-)
70 %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html doc/ja *.cgi contrib/*.fcgi
70 %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi
71 %doc %attr(644,root,root) %{_mandir}/man?/hg*
71 %doc %attr(644,root,root) %{_mandir}/man?/hg*
72 %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
72 %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
73 %{_sysconfdir}/bash_completion.d/mercurial.sh
73 %{_sysconfdir}/bash_completion.d/mercurial.sh
@@ -131,7 +131,7 b' def _abssource(repo, push=False):'
131 source = repo._subsource
131 source = repo._subsource
132 if source.startswith('/') or '://' in source:
132 if source.startswith('/') or '://' in source:
133 return source
133 return source
134 parent = _abssource(repo._subparent)
134 parent = _abssource(repo._subparent, push)
135 if '://' in parent:
135 if '://' in parent:
136 if parent[-1] == '/':
136 if parent[-1] == '/':
137 parent = parent[:-1]
137 parent = parent[:-1]
@@ -177,24 +177,32 b' class hgsubrepo(object):'
177 self._state = state
177 self._state = state
178 r = ctx._repo
178 r = ctx._repo
179 root = r.wjoin(path)
179 root = r.wjoin(path)
180 if os.path.exists(os.path.join(root, '.hg')):
180 create = False
181 self._repo = hg.repository(r.ui, root)
181 if not os.path.exists(os.path.join(root, '.hg')):
182 else:
182 create = True
183 util.makedirs(root)
183 util.makedirs(root)
184 self._repo = hg.repository(r.ui, root, create=True)
184 self._repo = hg.repository(r.ui, root, create=create)
185 f = file(os.path.join(root, '.hg', 'hgrc'), 'w')
186 f.write('[paths]\ndefault = %s\n' % os.path.join(
187 _abssource(ctx._repo), path))
188 f.close()
189 self._repo._subparent = r
185 self._repo._subparent = r
190 self._repo._subsource = state[0]
186 self._repo._subsource = state[0]
191
187
188 if create:
189 fp = self._repo.opener("hgrc", "w", text=True)
190 fp.write('[paths]\n')
191
192 def addpathconfig(key, value):
193 fp.write('%s = %s\n' % (key, value))
194 self._repo.ui.setconfig('paths', key, value)
195
196 defpath = os.path.join(_abssource(ctx._repo), path)
197 addpathconfig('default', defpath)
198 fp.close()
199
192 def dirty(self):
200 def dirty(self):
193 r = self._state[1]
201 r = self._state[1]
194 if r == '':
202 if r == '':
195 return True
203 return True
196 w = self._repo[None]
204 w = self._repo[None]
197 if w.p1() != self._repo[r]: # version checked out changed
205 if w.p1() != self._repo[r]: # version checked out change
198 return True
206 return True
199 return w.dirty() # working directory changed
207 return w.dirty() # working directory changed
200
208
@@ -168,12 +168,13 b' echo > hgext/__init__.py'
168 cat > hgext/broken.py <<EOF
168 cat > hgext/broken.py <<EOF
169 "broken extension'
169 "broken extension'
170 EOF
170 EOF
171 TMPPYTHONPATH="$PYTHONPATH"
171 cat > path.py <<EOF
172 PYTHONPATH="`pwd`:$PYTHONPATH"
172 import os, sys
173 export PYTHONPATH
173 sys.path.insert(0, os.environ['HGEXTPATH'])
174 hg help broken
174 EOF
175 hg help foo > /dev/null
175 HGEXTPATH=`pwd`
176 PYTHONPATH="$TMPPYTHONPATH"
176 export HGEXTPATH
177 export PYTHONPATH
177 hg --config extensions.path=./path.py help broken
178 hg --config extensions.path=./path.py help foo > /dev/null
178
179
179 exit 0
180 exit 0
General Comments 0
You need to be logged in to leave comments. Login now