equal
deleted
inserted
replaced
1 Test hg log changeset printer external hook |
1 Test hg log changeset printer external hook |
2 ------------------------------------------- |
2 ------------------------------------------- |
3 |
3 |
4 $ cat > $TESTTMP/logexthook.py <<EOF |
4 $ cat > $TESTTMP/logexthook.py <<EOF |
5 > from __future__ import absolute_import |
5 > from __future__ import absolute_import |
|
6 > import codecs |
6 > from mercurial import ( |
7 > from mercurial import ( |
7 > commands, |
8 > commands, |
8 > logcmdutil, |
9 > logcmdutil, |
9 > repair, |
10 > repair, |
10 > ) |
11 > ) |
11 > def rot13description(self, ctx): |
12 > def rot13description(self, ctx): |
12 > summary = "summary".encode('rot13') |
13 > summary = codecs.encode("summary", 'rot-13') |
13 > description = ctx.description().strip().splitlines()[0].encode('rot13') |
14 > description = ctx.description().strip().splitlines()[0].encode('rot13') |
14 > self.ui.write("%s: %s\n" % (summary, description)) |
15 > self.ui.write("%s: %s\n" % (summary, description)) |
15 > def reposetup(ui, repo): |
16 > def reposetup(ui, repo): |
16 > logcmdutil.changesetprinter._exthook = rot13description |
17 > logcmdutil.changesetprinter._exthook = rot13description |
17 > EOF |
18 > EOF |