##// END OF EJS Templates
merge with stable...
Kevin Bullock -
r20860:81d6dc8c merge default
parent child Browse files
Show More
@@ -105,9 +105,10 b' explicitly do so with the --large flag p'
105 command.
105 command.
106 '''
106 '''
107
107
108 from mercurial import commands, localrepo
108 from mercurial import commands, hg, localrepo
109
109
110 import lfcommands
110 import lfcommands
111 import proto
111 import reposetup
112 import reposetup
112 import uisetup as uisetupmod
113 import uisetup as uisetupmod
113
114
@@ -121,6 +122,7 b' def featuresetup(ui, supported):'
121
122
122 def uisetup(ui):
123 def uisetup(ui):
123 localrepo.localrepository.featuresetupfuncs.add(featuresetup)
124 localrepo.localrepository.featuresetupfuncs.add(featuresetup)
125 hg.wirepeersetupfuncs.append(proto.wirereposetup)
124 uisetupmod.uisetup(ui)
126 uisetupmod.uisetup(ui)
125
127
126 commands.norepo += " lfconvert"
128 commands.norepo += " lfconvert"
@@ -16,14 +16,13 b' from mercurial.i18n import _'
16 from mercurial import localrepo
16 from mercurial import localrepo
17
17
18 import lfcommands
18 import lfcommands
19 import proto
20 import lfutil
19 import lfutil
21
20
22 def reposetup(ui, repo):
21 def reposetup(ui, repo):
23 # wire repositories should be given new wireproto functions but not the
22 # wire repositories should be given new wireproto functions
24 # other largefiles modifications
23 # by "proto.wirereposetup()" via "hg.wirepeersetupfuncs"
25 if not repo.local():
24 if not repo.local():
26 return proto.wirereposetup(ui, repo)
25 return
27
26
28 class lfilesrepo(repo.__class__):
27 class lfilesrepo(repo.__class__):
29 lfstatus = False
28 lfstatus = False
@@ -98,6 +98,9 b' def openpath(ui, path):'
98 else:
98 else:
99 return url.open(ui, path)
99 return url.open(ui, path)
100
100
101 # a list of (ui, repo) functions called for wire peer initialization
102 wirepeersetupfuncs = []
103
101 def _peerorrepo(ui, path, create=False):
104 def _peerorrepo(ui, path, create=False):
102 """return a repository object for the specified path"""
105 """return a repository object for the specified path"""
103 obj = _peerlookup(path).instance(ui, path, create)
106 obj = _peerlookup(path).instance(ui, path, create)
@@ -106,6 +109,9 b' def _peerorrepo(ui, path, create=False):'
106 hook = getattr(module, 'reposetup', None)
109 hook = getattr(module, 'reposetup', None)
107 if hook:
110 if hook:
108 hook(ui, obj)
111 hook(ui, obj)
112 if not obj.local():
113 for f in wirepeersetupfuncs:
114 f(ui, obj)
109 return obj
115 return obj
110
116
111 def repository(ui, path='', create=False):
117 def repository(ui, path='', create=False):
@@ -212,6 +212,7 b' def buildfunc(exp, context):'
212 raise error.ParseError(_("filter %s expects one argument") % n)
212 raise error.ParseError(_("filter %s expects one argument") % n)
213 f = context._filters[n]
213 f = context._filters[n]
214 return (runfilter, (args[0][0], args[0][1], f))
214 return (runfilter, (args[0][0], args[0][1], f))
215 raise error.ParseError(_("unknown function '%s'") % n)
215
216
216 def date(context, mapping, args):
217 def date(context, mapping, args):
217 if not (1 <= len(args) <= 2):
218 if not (1 <= len(args) <= 2):
@@ -1439,6 +1439,12 b' Behind the scenes, this will throw Value'
1439 abort: template filter 'datefilter' is not compatible with keyword 'author'
1439 abort: template filter 'datefilter' is not compatible with keyword 'author'
1440 [255]
1440 [255]
1441
1441
1442 Thrown an error if a template function doesn't exist
1443
1444 $ hg tip --template '{foo()}\n'
1445 hg: parse error: unknown function 'foo'
1446 [255]
1447
1442 $ cd ..
1448 $ cd ..
1443
1449
1444
1450
@@ -299,7 +299,7 b' test saving last-message.txt'
299 $ echo 'sub = sub' > .hgsub
299 $ echo 'sub = sub' > .hgsub
300 $ hg add .hgsub
300 $ hg add .hgsub
301
301
302 $ cat > $TESTDIR/editor.sh <<EOF
302 $ cat > $TESTTMP/editor.sh <<EOF
303 > echo "==== before editing:"
303 > echo "==== before editing:"
304 > cat \$1
304 > cat \$1
305 > echo "===="
305 > echo "===="
@@ -307,7 +307,7 b' test saving last-message.txt'
307 > EOF
307 > EOF
308
308
309 $ rm -f .hg/last-message.txt
309 $ rm -f .hg/last-message.txt
310 $ HGEDITOR="sh $TESTDIR/editor.sh" hg commit -S -q
310 $ HGEDITOR="sh $TESTTMP/editor.sh" hg commit -S -q
311 ==== before editing:
311 ==== before editing:
312
312
313
313
@@ -107,7 +107,7 b' check histedit_source'
107
107
108 check saving last-message.txt
108 check saving last-message.txt
109
109
110 $ cat > $TESTDIR/abortfolding.py <<EOF
110 $ cat > $TESTTMP/abortfolding.py <<EOF
111 > from mercurial import util
111 > from mercurial import util
112 > def abortfolding(ui, repo, hooktype, **kwargs):
112 > def abortfolding(ui, repo, hooktype, **kwargs):
113 > ctx = repo[kwargs.get('node')]
113 > ctx = repo[kwargs.get('node')]
@@ -117,10 +117,10 b' check saving last-message.txt'
117 > EOF
117 > EOF
118 $ cat > .hg/hgrc <<EOF
118 $ cat > .hg/hgrc <<EOF
119 > [hooks]
119 > [hooks]
120 > pretxncommit.abortfolding = python:$TESTDIR/abortfolding.py:abortfolding
120 > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding
121 > EOF
121 > EOF
122
122
123 $ cat > $TESTDIR/editor.sh << EOF
123 $ cat > $TESTTMP/editor.sh << EOF
124 > echo "==== before editing"
124 > echo "==== before editing"
125 > cat \$1
125 > cat \$1
126 > echo "===="
126 > echo "===="
@@ -128,7 +128,7 b' check saving last-message.txt'
128 > EOF
128 > EOF
129
129
130 $ rm -f .hg/last-message.txt
130 $ rm -f .hg/last-message.txt
131 $ HGEDITOR="sh $TESTDIR/editor.sh" hg histedit 6de59d13424a --commands - 2>&1 <<EOF | fixbundle
131 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 6de59d13424a --commands - 2>&1 <<EOF | fixbundle
132 > pick 6de59d13424a f
132 > pick 6de59d13424a f
133 > fold 9c277da72c9b d
133 > fold 9c277da72c9b d
134 > EOF
134 > EOF
@@ -2287,4 +2287,30 b' enabling largefiles extension.'
2287 $ test -d clone-pull-dst
2287 $ test -d clone-pull-dst
2288 [1]
2288 [1]
2289
2289
2290 #if serve
2291
2292 Test largefiles specific peer setup, when largefiles is enabled
2293 locally (issue4109)
2294
2295 $ hg showconfig extensions | grep largefiles
2296 extensions.largefiles=!
2297 $ mkdir -p $TESTTMP/individualenabling/usercache
2298
2299 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
2300 $ cat hg.pid >> $DAEMON_PIDS
2301
2302 $ hg init pull-dst
2303 $ cat > pull-dst/.hg/hgrc <<EOF
2304 > [extensions]
2305 > # enable locally
2306 > largefiles=
2307 > [largefiles]
2308 > # ignore system cache to force largefiles specific wire proto access
2309 > usercache=$TESTTMP/individualenabling/usercache
2310 > EOF
2311 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
2312
2313 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2314 #endif
2315
2290 $ cd ..
2316 $ cd ..
@@ -144,7 +144,7 b' Test saving last-message.txt:'
144
144
145 $ hg qrefresh -m "original message"
145 $ hg qrefresh -m "original message"
146
146
147 $ cat > $TESTDIR/commitfailure.py <<EOF
147 $ cat > $TESTTMP/commitfailure.py <<EOF
148 > from mercurial import util
148 > from mercurial import util
149 > def reposetup(ui, repo):
149 > def reposetup(ui, repo):
150 > class commitfailure(repo.__class__):
150 > class commitfailure(repo.__class__):
@@ -155,10 +155,10 b' Test saving last-message.txt:'
155
155
156 $ cat > .hg/hgrc <<EOF
156 $ cat > .hg/hgrc <<EOF
157 > [extensions]
157 > [extensions]
158 > commitfailure = $TESTDIR/commitfailure.py
158 > commitfailure = $TESTTMP/commitfailure.py
159 > EOF
159 > EOF
160
160
161 $ cat > $TESTDIR/editor.sh << EOF
161 $ cat > $TESTTMP/editor.sh << EOF
162 > echo "==== before editing"
162 > echo "==== before editing"
163 > cat \$1
163 > cat \$1
164 > echo "===="
164 > echo "===="
@@ -166,7 +166,7 b' Test saving last-message.txt:'
166 > EOF
166 > EOF
167
167
168 $ rm -f .hg/last-message.txt
168 $ rm -f .hg/last-message.txt
169 $ HGEDITOR="sh $TESTDIR/editor.sh" hg qfold -e p3
169 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3
170 ==== before editing
170 ==== before editing
171 original message====
171 original message====
172 refresh interrupted while patch was popped! (revert --all, qpush to recover)
172 refresh interrupted while patch was popped! (revert --all, qpush to recover)
@@ -239,7 +239,7 b' Test saving last-message.txt'
239 $ hg init repo
239 $ hg init repo
240 $ cd repo
240 $ cd repo
241
241
242 $ cat > $TESTDIR/commitfailure.py <<EOF
242 $ cat > $TESTTMP/commitfailure.py <<EOF
243 > from mercurial import util
243 > from mercurial import util
244 > def reposetup(ui, repo):
244 > def reposetup(ui, repo):
245 > class commitfailure(repo.__class__):
245 > class commitfailure(repo.__class__):
@@ -249,10 +249,10 b' Test saving last-message.txt'
249 > EOF
249 > EOF
250 $ cat > .hg/hgrc <<EOF
250 $ cat > .hg/hgrc <<EOF
251 > [extensions]
251 > [extensions]
252 > commitfailure = $TESTDIR/commitfailure.py
252 > commitfailure = $TESTTMP/commitfailure.py
253 > EOF
253 > EOF
254
254
255 $ cat > $TESTDIR/editor.sh << EOF
255 $ cat > $TESTTMP/editor.sh << EOF
256 > echo "==== before editing"
256 > echo "==== before editing"
257 > cat \$1
257 > cat \$1
258 > echo "===="
258 > echo "===="
@@ -260,7 +260,7 b' Test saving last-message.txt'
260 > EOF
260 > EOF
261
261
262 $ rm -f .hg/last-message.txt
262 $ rm -f .hg/last-message.txt
263 $ HGEDITOR="sh $TESTDIR/editor.sh" hg qnew -e patch
263 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
264 ==== before editing
264 ==== before editing
265 ====
265 ====
266 abort: emulating unexpected abort
266 abort: emulating unexpected abort
General Comments 0
You need to be logged in to leave comments. Login now