19 run automatically until docutils is delivered), but it enables a "gmake |
19 run automatically until docutils is delivered), but it enables a "gmake |
20 patches/manpage.patch" to regenerate the manpages with the updated text |
20 patches/manpage.patch" to regenerate the manpages with the updated text |
21 (found in rst.patch) with the patched hgmanpage.py, and updates the |
21 (found in rst.patch) with the patched hgmanpage.py, and updates the |
22 manpage.patch file. |
22 manpage.patch file. |
23 |
23 |
24 --- mercurial-2.7/doc/hgmanpage.py Thu Aug 1 20:37:39 2013 |
24 --- mercurial.hg/doc/hgmanpage.py 2016-10-09 20:00:17.207404849 -0700 |
25 +++ mercurial-2.7/doc/hgmanpage.py Mon Aug 19 14:40:04 2013 |
25 +++ mercurial.hg/doc/hgmanpage.py 2016-10-10 10:04:03.695820057 -0700 |
26 @@ -197,6 +197,7 @@ |
26 @@ -202,6 +202,7 @@ |
27 self._in_docinfo = None |
27 self._in_docinfo = None |
28 self._active_table = None |
28 self._active_table = None |
29 self._in_literal = False |
29 self._in_literal = False |
30 + self._in_literal_inline = False |
30 + self._in_literal_inline = False |
31 self.header_written = 0 |
31 self.header_written = 0 |
32 self._line_block = 0 |
32 self._line_block = 0 |
33 self.authors = [] |
33 self.authors = [] |
34 @@ -212,15 +213,15 @@ |
34 @@ -217,15 +218,15 @@ |
35 # ``B`` bold, ``I`` italic, ``R`` roman should be available. |
35 # ``B`` bold, ``I`` italic, ``R`` roman should be available. |
36 # Hopefully ``C`` courier too. |
36 # Hopefully ``C`` courier too. |
37 self.defs = { |
37 self.defs = { |
38 - 'indent' : ('.INDENT %.1f\n', '.UNINDENT\n'), |
38 - 'indent' : ('.INDENT %.1f\n', '.UNINDENT\n'), |
39 + 'indent' : ('.RS %d\n', '.RE\n'), |
39 + 'indent' : ('.RS %d\n', '.RE\n'), |
48 - 'reference' : (r'\%', r'\:'), |
48 - 'reference' : (r'\%', r'\:'), |
49 + 'reference' : (r'', r''), |
49 + 'reference' : (r'', r''), |
50 'emphasis': ('\\fI', '\\fP'), |
50 'emphasis': ('\\fI', '\\fP'), |
51 'strong' : ('\\fB', '\\fP'), |
51 'strong' : ('\\fB', '\\fP'), |
52 'term' : ('\n.B ', '\n'), |
52 'term' : ('\n.B ', '\n'), |
53 @@ -267,6 +268,7 @@ |
53 @@ -272,6 +273,7 @@ |
54 self.body[i - 2][:4] == '.TP\n'): |
54 self.body[i - 2][:4] == '.TP\n'): |
55 self.body[i] = '.\n' |
55 self.body[i] = '.\n' |
56 elif (self.body[i - 1] == '\n' and |
56 elif (self.body[i - 1] == '\n' and |
57 + self.body[i - 2] and |
57 + self.body[i - 2] and |
58 self.body[i - 2][0] != '.' and |
58 self.body[i - 2][0] != '.' and |
59 (self.body[i - 3][:7] == '.TP\n.B ' |
59 (self.body[i - 3][:7] == '.TP\n.B ' |
60 or self.body[i - 3][:4] == '\n.B ') |
60 or self.body[i - 3][:4] == '\n.B ') |
61 @@ -284,7 +286,6 @@ |
61 @@ -289,7 +291,6 @@ |
62 text = text.replace('\\','\\e') |
62 text = text.replace('\\','\\e') |
63 replace_pairs = [ |
63 replace_pairs = [ |
64 (u'-', ur'\-'), |
64 (u'-', u'\\-'), |
65 - (u'\'', ur'\(aq'), |
65 - (u"'", u'\\(aq'), |
66 (u'´', ur'\''), |
66 (u'´', u"\\'"), |
67 (u'`', ur'\(ga'), |
67 (u'`', u'\\(ga'), |
68 ] |
68 ] |
69 @@ -297,6 +298,15 @@ |
69 @@ -302,6 +303,15 @@ |
70 if text[0] == '.': |
70 if text[0] == '.': |
71 text = '\\&' + text |
71 text = '\\&' + text |
72 text = text.replace('\n.', '\n\\&.') |
72 text = text.replace('\n.', '\n\\&.') |
73 + # We need to do the same thing for the inline literals, too |
73 + # We need to do the same thing for the inline literals, too |
74 + if self._in_literal_inline and text[0] == '.': |
74 + if self._in_literal_inline and text[0] == '.': |
80 + text = '\\&' + text |
80 + text = '\\&' + text |
81 + text = text.replace("\n'", "\n\\&'") |
81 + text = text.replace("\n'", "\n\\&'") |
82 self.body.append(text) |
82 self.body.append(text) |
83 |
83 |
84 def depart_Text(self, node): |
84 def depart_Text(self, node): |
85 @@ -381,7 +391,6 @@ |
85 @@ -386,7 +396,6 @@ |
86 if self.header_written: |
86 if self.header_written: |
87 return |
87 return |
88 self.body.append(self.header()) |
88 self.body.append(self.header()) |
89 - self.body.append(MACRO_DEF) |
89 - self.body.append(MACRO_DEF) |
90 self.header_written = 1 |
90 self.header_written = 1 |
91 |
91 |
92 def visit_address(self, node): |
92 def visit_address(self, node): |
93 @@ -795,8 +804,10 @@ |
93 @@ -800,8 +809,10 @@ |
94 |
94 |
95 def visit_literal(self, node): |
95 def visit_literal(self, node): |
96 self.body.append(self.defs['literal'][0]) |
96 self.body.append(self.defs['literal'][0]) |
97 + self._in_literal_inline = True |
97 + self._in_literal_inline = True |
98 |
98 |