For once an easy one.
Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG005bc856e919: py3: port test-log-exthook.t to Python 3
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
For once an easy one.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | contrib/python3-whitelist (1 line) | |||
M | tests/test-log-exthook.t (8 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Augie Fackler | Oct 23 2018, 11:31 AM |
test-largefiles-update.t | test-largefiles-update.t | ||||
test-largefiles.t | test-largefiles.t | ||||
test-lfs-largefiles.t | test-lfs-largefiles.t | ||||
test-lfs-pointer.py | test-lfs-pointer.py | ||||
test-linelog.py | test-linelog.py | ||||
test-linerange.py | test-linerange.py | ||||
test-locate.t | test-locate.t | ||||
test-lock-badness.t | test-lock-badness.t | ||||
test-log-exthook.t | |||||
test-log-linerange.t | test-log-linerange.t | ||||
test-log.t | test-log.t | ||||
test-logexchange.t | test-logexchange.t | ||||
test-lrucachedict.py | test-lrucachedict.py | ||||
test-mactext.t | test-mactext.t | ||||
test-mailmap.t | test-mailmap.t | ||||
test-manifest-merging.t | test-manifest-merging.t | ||||
test-manifest.py | test-manifest.py |
Test hg log changeset printer external hook | Test hg log changeset printer external hook | ||||
------------------------------------------- | ------------------------------------------- | ||||
$ cat > $TESTTMP/logexthook.py <<EOF | $ cat > $TESTTMP/logexthook.py <<EOF | ||||
> from __future__ import absolute_import | > from __future__ import absolute_import | ||||
> import codecs | > import codecs | ||||
> from mercurial import ( | > from mercurial import ( | ||||
> commands, | > commands, | ||||
> logcmdutil, | > logcmdutil, | ||||
> repair, | > repair, | ||||
> ) | > ) | ||||
> def brot13(b): | |||||
> return codecs.encode(b.decode('utf8'), 'rot-13').encode('utf8') | |||||
> def rot13description(self, ctx): | > def rot13description(self, ctx): | ||||
> summary = codecs.encode("summary", 'rot-13') | > description = ctx.description().strip().splitlines()[0] | ||||
> description = ctx.description().strip().splitlines()[0].encode('rot13') | > self.ui.write(b"%s: %s\n" % (brot13(b"summary"), | ||||
> self.ui.write("%s: %s\n" % (summary, description)) | > brot13(description))) | ||||
> def reposetup(ui, repo): | > def reposetup(ui, repo): | ||||
> logcmdutil.changesetprinter._exthook = rot13description | > logcmdutil.changesetprinter._exthook = rot13description | ||||
> EOF | > EOF | ||||
Prepare the repository | Prepare the repository | ||||
$ hg init empty | $ hg init empty | ||||
$ cd empty | $ cd empty |