Show More
@@ -665,8 +665,13 b' def reposetup(ui, repo):' | |||
|
665 | 665 | |
|
666 | 666 | def kwdiff(orig, *args, **kwargs): |
|
667 | 667 | '''Monkeypatch patch.diff to avoid expansion.''' |
|
668 | restrict = kwt.restrict | |
|
668 | 669 | kwt.restrict = True |
|
669 | return orig(*args, **kwargs) | |
|
670 | try: | |
|
671 | for chunk in orig(*args, **kwargs): | |
|
672 | yield chunk | |
|
673 | finally: | |
|
674 | kwt.restrict = restrict | |
|
670 | 675 | |
|
671 | 676 | def kwweb_skip(orig, web, req, tmpl): |
|
672 | 677 | '''Wraps webcommands.x turning off keyword expansion.''' |
@@ -1378,4 +1378,35 b' Test restricted mode with fetch (with me' | |||
|
1378 | 1378 | $Xinfo$ |
|
1379 | 1379 | +xxxx |
|
1380 | 1380 | |
|
1381 | Test that patch.diff(), which is implied by "hg diff" or so, doesn't | |
|
1382 | suppress expanding keywords at subsequent commands | |
|
1383 | ||
|
1384 | #if windows | |
|
1385 | $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" | |
|
1386 | #else | |
|
1387 | $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" | |
|
1388 | #endif | |
|
1389 | $ export PYTHONPATH | |
|
1390 | ||
|
1391 | $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new | |
|
1392 | $ mv $HGRCPATH.new $HGRCPATH | |
|
1393 | ||
|
1394 | >>> from __future__ import print_function | |
|
1395 | >>> from hgclient import readchannel, runcommand, check | |
|
1396 | >>> @check | |
|
1397 | ... def check(server): | |
|
1398 | ... # hello block | |
|
1399 | ... readchannel(server) | |
|
1400 | ... | |
|
1401 | ... runcommand(server, ['cat', 'm']) | |
|
1402 | ... runcommand(server, ['diff', '-c', '.', 'm']) | |
|
1403 | ... runcommand(server, ['cat', 'm']) | |
|
1404 | *** runcommand cat m | |
|
1405 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
|
1406 | bar | |
|
1407 | *** runcommand diff -c . m | |
|
1408 | *** runcommand cat m | |
|
1409 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
|
1410 | bar | |
|
1411 | ||
|
1381 | 1412 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now