# HG changeset patch # User Kevin Bullock # Date 1396278727 18000 # Node ID 81d6dc8c3c6390aa8785fc9f2598b8a46b3fcfd7 # Parent 8a6a86c9a5b58ccc020de1ff0429e72dfa5599fc# Parent e259d4c462b563ebcec7751a2e8291313e99bd59 merge with stable This should correct an earlier couple of bad merges (5433856b2558 and 596960a4ad0d, now pruned) that accidentally brought in a change that had been marked obsolete (244ac996a821). diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 hgext/largefiles/__init__.py --- a/hgext/largefiles/__init__.py Tue Mar 18 14:29:33 2014 -0700 +++ b/hgext/largefiles/__init__.py Mon Mar 31 10:12:07 2014 -0500 @@ -105,9 +105,10 @@ command. ''' -from mercurial import commands, localrepo +from mercurial import commands, hg, localrepo import lfcommands +import proto import reposetup import uisetup as uisetupmod @@ -121,6 +122,7 @@ def uisetup(ui): localrepo.localrepository.featuresetupfuncs.add(featuresetup) + hg.wirepeersetupfuncs.append(proto.wirereposetup) uisetupmod.uisetup(ui) commands.norepo += " lfconvert" diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 hgext/largefiles/reposetup.py --- a/hgext/largefiles/reposetup.py Tue Mar 18 14:29:33 2014 -0700 +++ b/hgext/largefiles/reposetup.py Mon Mar 31 10:12:07 2014 -0500 @@ -16,14 +16,13 @@ from mercurial import localrepo import lfcommands -import proto import lfutil def reposetup(ui, repo): - # wire repositories should be given new wireproto functions but not the - # other largefiles modifications + # wire repositories should be given new wireproto functions + # by "proto.wirereposetup()" via "hg.wirepeersetupfuncs" if not repo.local(): - return proto.wirereposetup(ui, repo) + return class lfilesrepo(repo.__class__): lfstatus = False diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 mercurial/hg.py --- a/mercurial/hg.py Tue Mar 18 14:29:33 2014 -0700 +++ b/mercurial/hg.py Mon Mar 31 10:12:07 2014 -0500 @@ -98,6 +98,9 @@ else: return url.open(ui, path) +# a list of (ui, repo) functions called for wire peer initialization +wirepeersetupfuncs = [] + def _peerorrepo(ui, path, create=False): """return a repository object for the specified path""" obj = _peerlookup(path).instance(ui, path, create) @@ -106,6 +109,9 @@ hook = getattr(module, 'reposetup', None) if hook: hook(ui, obj) + if not obj.local(): + for f in wirepeersetupfuncs: + f(ui, obj) return obj def repository(ui, path='', create=False): diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 mercurial/templater.py --- a/mercurial/templater.py Tue Mar 18 14:29:33 2014 -0700 +++ b/mercurial/templater.py Mon Mar 31 10:12:07 2014 -0500 @@ -212,6 +212,7 @@ raise error.ParseError(_("filter %s expects one argument") % n) f = context._filters[n] return (runfilter, (args[0][0], args[0][1], f)) + raise error.ParseError(_("unknown function '%s'") % n) def date(context, mapping, args): if not (1 <= len(args) <= 2): diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-command-template.t --- a/tests/test-command-template.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-command-template.t Mon Mar 31 10:12:07 2014 -0500 @@ -1439,6 +1439,12 @@ abort: template filter 'datefilter' is not compatible with keyword 'author' [255] +Thrown an error if a template function doesn't exist + + $ hg tip --template '{foo()}\n' + hg: parse error: unknown function 'foo' + [255] + $ cd .. diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-commit.t --- a/tests/test-commit.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-commit.t Mon Mar 31 10:12:07 2014 -0500 @@ -299,7 +299,7 @@ $ echo 'sub = sub' > .hgsub $ hg add .hgsub - $ cat > $TESTDIR/editor.sh < $TESTTMP/editor.sh < echo "==== before editing:" > cat \$1 > echo "====" @@ -307,7 +307,7 @@ > EOF $ rm -f .hg/last-message.txt - $ HGEDITOR="sh $TESTDIR/editor.sh" hg commit -S -q + $ HGEDITOR="sh $TESTTMP/editor.sh" hg commit -S -q ==== before editing: diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-histedit-fold.t Mon Mar 31 10:12:07 2014 -0500 @@ -107,7 +107,7 @@ check saving last-message.txt - $ cat > $TESTDIR/abortfolding.py < $TESTTMP/abortfolding.py < from mercurial import util > def abortfolding(ui, repo, hooktype, **kwargs): > ctx = repo[kwargs.get('node')] @@ -117,10 +117,10 @@ > EOF $ cat > .hg/hgrc < [hooks] - > pretxncommit.abortfolding = python:$TESTDIR/abortfolding.py:abortfolding + > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding > EOF - $ cat > $TESTDIR/editor.sh << EOF + $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" @@ -128,7 +128,7 @@ > EOF $ rm -f .hg/last-message.txt - $ HGEDITOR="sh $TESTDIR/editor.sh" hg histedit 6de59d13424a --commands - 2>&1 <&1 < pick 6de59d13424a f > fold 9c277da72c9b d > EOF diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-largefiles.t --- a/tests/test-largefiles.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-largefiles.t Mon Mar 31 10:12:07 2014 -0500 @@ -2287,4 +2287,30 @@ $ test -d clone-pull-dst [1] +#if serve + +Test largefiles specific peer setup, when largefiles is enabled +locally (issue4109) + + $ hg showconfig extensions | grep largefiles + extensions.largefiles=! + $ mkdir -p $TESTTMP/individualenabling/usercache + + $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid + $ cat hg.pid >> $DAEMON_PIDS + + $ hg init pull-dst + $ cat > pull-dst/.hg/hgrc < [extensions] + > # enable locally + > largefiles= + > [largefiles] + > # ignore system cache to force largefiles specific wire proto access + > usercache=$TESTTMP/individualenabling/usercache + > EOF + $ hg -R pull-dst -q pull -u http://localhost:$HGPORT + + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS +#endif + $ cd .. diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-mq-qfold.t --- a/tests/test-mq-qfold.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-mq-qfold.t Mon Mar 31 10:12:07 2014 -0500 @@ -144,7 +144,7 @@ $ hg qrefresh -m "original message" - $ cat > $TESTDIR/commitfailure.py < $TESTTMP/commitfailure.py < from mercurial import util > def reposetup(ui, repo): > class commitfailure(repo.__class__): @@ -155,10 +155,10 @@ $ cat > .hg/hgrc < [extensions] - > commitfailure = $TESTDIR/commitfailure.py + > commitfailure = $TESTTMP/commitfailure.py > EOF - $ cat > $TESTDIR/editor.sh << EOF + $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" @@ -166,7 +166,7 @@ > EOF $ rm -f .hg/last-message.txt - $ HGEDITOR="sh $TESTDIR/editor.sh" hg qfold -e p3 + $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3 ==== before editing original message==== refresh interrupted while patch was popped! (revert --all, qpush to recover) diff -r 8a6a86c9a5b5 -r 81d6dc8c3c63 tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t Tue Mar 18 14:29:33 2014 -0700 +++ b/tests/test-mq-qnew.t Mon Mar 31 10:12:07 2014 -0500 @@ -239,7 +239,7 @@ $ hg init repo $ cd repo - $ cat > $TESTDIR/commitfailure.py < $TESTTMP/commitfailure.py < from mercurial import util > def reposetup(ui, repo): > class commitfailure(repo.__class__): @@ -249,10 +249,10 @@ > EOF $ cat > .hg/hgrc < [extensions] - > commitfailure = $TESTDIR/commitfailure.py + > commitfailure = $TESTTMP/commitfailure.py > EOF - $ cat > $TESTDIR/editor.sh << EOF + $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" @@ -260,7 +260,7 @@ > EOF $ rm -f .hg/last-message.txt - $ HGEDITOR="sh $TESTDIR/editor.sh" hg qnew -e patch + $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch ==== before editing ==== abort: emulating unexpected abort