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