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