Show More
@@ -417,9 +417,9 b' preoutgoing hook can prevent outgoing ch' | |||
|
417 | 417 | > def printargs(ui, args): |
|
418 | 418 | > a = list(args.items()) |
|
419 | 419 | > a.sort() |
|
420 | > ui.write('hook args:\n') | |
|
420 | > ui.write(b'hook args:\n') | |
|
421 | 421 | > for k, v in a: |
|
422 | > ui.write(' %s %s\n' % (k, v)) | |
|
422 | > ui.write(b' %s %s\n' % (k, v)) | |
|
423 | 423 | > |
|
424 | 424 | > def passhook(ui, repo, **args): |
|
425 | 425 | > printargs(ui, args) |
@@ -432,19 +432,19 b' preoutgoing hook can prevent outgoing ch' | |||
|
432 | 432 | > pass |
|
433 | 433 | > |
|
434 | 434 | > def raisehook(**args): |
|
435 | > raise LocalException('exception from hook') | |
|
435 | > raise LocalException(b'exception from hook') | |
|
436 | 436 | > |
|
437 | 437 | > def aborthook(**args): |
|
438 | > raise error.Abort('raise abort from hook') | |
|
438 | > raise error.Abort(b'raise abort from hook') | |
|
439 | 439 | > |
|
440 | 440 | > def brokenhook(**args): |
|
441 | 441 | > return 1 + {} |
|
442 | 442 | > |
|
443 | 443 | > def verbosehook(ui, **args): |
|
444 | > ui.note('verbose output from hook\n') | |
|
444 | > ui.note(b'verbose output from hook\n') | |
|
445 | 445 | > |
|
446 | 446 | > def printtags(ui, repo, **args): |
|
447 | > ui.write('%s\n' % sorted(repo.tags())) | |
|
447 | > ui.write(b'%s\n' % sorted(repo.tags())) | |
|
448 | 448 | > |
|
449 | 449 | > class container: |
|
450 | 450 | > unreachable = 1 |
@@ -667,7 +667,7 b' test python hook configured with python:' | |||
|
667 | 667 | $ cd hooks |
|
668 | 668 | $ cat > testhooks.py <<EOF |
|
669 | 669 | > def testhook(ui, **args): |
|
670 | > ui.write('hook works\n') | |
|
670 | > ui.write(b'hook works\n') | |
|
671 | 671 | > EOF |
|
672 | 672 | $ echo '[hooks]' > ../repo/.hg/hgrc |
|
673 | 673 | $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc |
@@ -886,7 +886,7 b' Hook from untrusted hgrc are reported as' | |||
|
886 | 886 | > def uisetup(ui): |
|
887 | 887 | > class untrustedui(ui.__class__): |
|
888 | 888 | > def _trusted(self, fp, f): |
|
889 | > if util.normpath(fp.name).endswith('untrusted/.hg/hgrc'): | |
|
889 | > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'): | |
|
890 | 890 | > return False |
|
891 | 891 | > return super(untrustedui, self)._trusted(fp, f) |
|
892 | 892 | > ui.__class__ = untrustedui |
General Comments 0
You need to be logged in to leave comments.
Login now