Show More
@@ -1,60 +1,61 | |||
|
1 | 1 | Test hg log changeset printer external hook |
|
2 | 2 | ------------------------------------------- |
|
3 | 3 | |
|
4 | 4 | $ cat > $TESTTMP/logexthook.py <<EOF |
|
5 | 5 | > from __future__ import absolute_import |
|
6 | > import codecs | |
|
6 | 7 | > from mercurial import ( |
|
7 | 8 | > commands, |
|
8 | 9 | > logcmdutil, |
|
9 | 10 | > repair, |
|
10 | 11 | > ) |
|
11 | 12 | > def rot13description(self, ctx): |
|
12 |
> summary = "summary" |
|
|
13 | > summary = codecs.encode("summary", 'rot-13') | |
|
13 | 14 | > description = ctx.description().strip().splitlines()[0].encode('rot13') |
|
14 | 15 | > self.ui.write("%s: %s\n" % (summary, description)) |
|
15 | 16 | > def reposetup(ui, repo): |
|
16 | 17 | > logcmdutil.changesetprinter._exthook = rot13description |
|
17 | 18 | > EOF |
|
18 | 19 | |
|
19 | 20 | Prepare the repository |
|
20 | 21 | |
|
21 | 22 | $ hg init empty |
|
22 | 23 | $ cd empty |
|
23 | 24 | $ touch ROOT |
|
24 | 25 | $ hg commit -A -m "Root" ROOT |
|
25 | 26 | |
|
26 | 27 | $ touch a b c |
|
27 | 28 | $ hg commit -A -m "Add A, B, C" a b c |
|
28 | 29 | |
|
29 | 30 | Check the log |
|
30 | 31 | |
|
31 | 32 | $ hg log --config extensions.t=$TESTTMP/logexthook.py |
|
32 | 33 | changeset: 1:70fc82b23320 |
|
33 | 34 | tag: tip |
|
34 | 35 | user: test |
|
35 | 36 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
36 | 37 | fhzznel: Nqq N, O, P |
|
37 | 38 | summary: Add A, B, C |
|
38 | 39 | |
|
39 | 40 | changeset: 0:b00443a54871 |
|
40 | 41 | user: test |
|
41 | 42 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
42 | 43 | fhzznel: Ebbg |
|
43 | 44 | summary: Root |
|
44 | 45 | |
|
45 | 46 | Check that exthook is working with graph log too |
|
46 | 47 | |
|
47 | 48 | $ hg log -G --config extensions.t=$TESTTMP/logexthook.py |
|
48 | 49 | @ changeset: 1:70fc82b23320 |
|
49 | 50 | | tag: tip |
|
50 | 51 | | user: test |
|
51 | 52 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
52 | 53 | | fhzznel: Nqq N, O, P |
|
53 | 54 | | summary: Add A, B, C |
|
54 | 55 | | |
|
55 | 56 | o changeset: 0:b00443a54871 |
|
56 | 57 | user: test |
|
57 | 58 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | 59 | fhzznel: Ebbg |
|
59 | 60 | summary: Root |
|
60 | 61 |
General Comments 0
You need to be logged in to leave comments.
Login now