Commit Graph

507 Commits

Author SHA1 Message Date
Augie Fackler
9f565e54cb gendoc: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:23:57 -04:00
Augie Fackler
4b15479b96 check-seclevel: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:23:47 -04:00
FUJIWARA Katsunori
138416bff7 doc: show short description of each commands in generated documents
Before this patch, short description of each commands is not shown in
generated documents (HTML file and UNIX man page). This omitting may
prevent users from understanding about commands.

This patch show it as the 1st paragraph in the help section of each
commands. This style is chosen because:

  - showing it as the section title in "command - short desc" style
    disallows referencing by "#command" in HTML file: in "en" locale,
    hyphen concatenated title is used as the section ID in HTML file
    for this style

  - showing it as the 1st paragraph in "command - short desc" style
    seems to be redundant: "command" appears also just before as the
    section title

  - showing it just after synopsis like "hg help command" seems not to
    be reasonable in UNIX man page

This patch just writes short description ("d['desc'][0]") before "::",
because it should be already "strip()"-ed in "get_desc()", or empty
string for the command without description.
2014-03-11 14:36:40 +09:00
Simon Heimberg
ff9aaaba6b doc: gendoc.py creates valid output for option descriptions with newlines
gendoc.py did not handle the hanging indentation for descriptions. Work around
this by joining all in one single line (same as in minirst since previous
patch).

This problem occurred when translations of option lines were very long. Do not
bother the translators with this detail.

On a long option description, the translator continued on a new line as usual.
gendoc.py created invalid rst syntax like this:

-o, --option
    Description line 1
description line 2

The new output is:

-o, --option
    Description line 1 description line 2

The lines could theoretically become very long, but line breaking is handled
when generating the final documentation.
2014-02-20 09:17:22 +01:00
FUJIWARA Katsunori
8c1c74a873 doc: show details of command options in pages generated by docutils
Before this patch, HTML/man pages generated by docutils don't show
details of each command options, whether it should take argument or
not for example, even though "hg help" does.

This patch shows details of command options as same as "hg help"
shows.

This patch uses "--option <VALUE[+]>" style instead of "--option
<VALUE> [+]" used in output of "hg help", because docutils requires
that option argument strings starts with "<" and ends with ">".
2013-11-08 14:42:09 +09:00
Takumi IINO
c57d1116da doc: make i18n man and html
Allow overwrite LANGUAGE and LC_ALL make variables, for make i18n man and html.
After this patch, we can make i18n man and html by following command:

  $ make clean all LANGUAGE=ja
2013-07-03 21:50:20 +09:00
Takumi IINO
2d38f7b9dd doc: make man and html from translated documents
Before this patch, man and html are english only, and there sources are not
translatable.
This patch make translatable all documents.
2013-07-03 21:49:43 +09:00
Takumi IINO
4e9e5e1a97 gendoc: dispatch print document content by commandline arguments
Before this patch, gendoc.py only prints hg.1.gendoc.txt content.
This adds any content print function.
2013-07-03 21:49:41 +09:00
Takumi IINO
aa35bddf6e gendoc: add showtopic
This function prints any topic.
2013-07-03 21:49:39 +09:00
Takumi IINO
6a0123c5c5 gendoc: rename to showdoc from show_doc
This function prints hg.1.gendoc.txt content.
2013-07-03 21:49:37 +09:00
Simon Heimberg
6059e06d0f cleanup: drop unused variables and an unused import 2013-07-01 20:48:56 +02:00
Matt Mackall
db1209d4bd merge with stable 2013-06-21 15:31:40 -05:00
Matt Mackall
ea11ead369 docs: change description to synopsis in hgrc.5
Spotted by Eric S. Raymond.
2013-06-20 14:06:11 -05:00
Simon Heimberg
8a32578a00 cleanup: remove unused imports
detected by pyflakes
2013-06-13 01:36:58 +02:00
Takumi IINO
b0aea72ba7 gendoc: extract print help topics into a dedicated function
This will be used in an upcoming patch.
2013-05-15 15:44:59 +09:00
Takumi IINO
9b959d84eb gendoc: make commnd __doc__ and extension __doc__ as translatable
Before this patch, commnd __doc__ and extension __doc__ are not translatable.
But other messages, like doc of helptalbe, section headers, are translatable.

This patch makes commnd __doc__ and extension __doc__ translatable.
2013-05-15 15:44:55 +09:00
Mads Kiilerich
3f5dd3e256 codingstyle: remove trailing spaces in various text files
Better do it once than see random changes in diffs later.
2013-04-17 03:40:18 +02:00
Mads Kiilerich
eeb6ef563e check-code: check txt files for trailing whitespace 2013-04-15 01:37:23 +02:00
Dan Villiom Podlaski Christiansen
d045d03b91 help: use a full header for topic titles
...for prettier HTML!
2013-02-10 12:58:57 +01:00
Mads Kiilerich
ac8e1fc147 check-code: there must also be whitespace between ')' and operator
The check pattern only checked for whitespace between keyword and operator.

Now it also warns:
 >     x = f(),7
 missing whitespace after ,
 >     x = f()+7
 missing whitespace in expression
2012-12-09 23:33:16 +01:00
FUJIWARA Katsunori
807a8f6caa doc: add the tool to check section marks in help documents
This patch adds "doc/check-seclevel.py" which checks below in help
documents:

  - whether unknown or unavailable section marks are used or not
  - whether appropriate section mark is used at sub-sectioning

It should be invoked in "doc" directory.

It checks all help documents of Mercurial (topics, commands,
extensions), if no file is specified by --file option.

With --file option, it checks contents of the specified file as help
document, for self testing purpose: -t/-c/-e/-C are used to specify
what kind of help document contents of the specified file is.

This checking is related to changeset 8d980034517b.
2012-08-13 21:25:48 +09:00
timeless@mozdev.org
faad4fb533 spelling: Structured 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
5e8f508211 spelling: don't/do not 2012-08-17 13:58:18 -07:00
FUJIWARA Katsunori
0cf97588a4 doc: unify section level between help topics
Some help topics use "-" for the top level underlining section mark,
but "-" is used also for the top level categorization in generated
documents: "hg.1.html", for example.

So, TOC in such documents contain "sections in each topics", too.

This patch changes underlining section mark in some help topics to
unify section level in generated documents.

After this patching, levels of each section marks are:

  level0
  """"""
    level1
    ======
      level2
      ------
        level3
        ......
          level4
          ######

And use of section markers in each documents are:

  - mercurial/help/*.txt can use level1 or more
    (now these use level1 and level2)

  - help for core commands can use level2 or more
    (now these use no section marker)

  - descriptions of extensions can use level2 or more
    (now hgext/acl uses level2)

  - help for commands defined in extension can use level4 or more
    (now "convert" of hgext/convert uses level4)

"Level0" is used as top level categorization only in "doc/hg.1.txt"
and the intermediate file generated by "doc/gendoc.py", so end users
don't see it in "hg help" outoput and so on.
2012-07-25 16:40:38 +09:00
Brodie Rao
a7ef0a0cc5 cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Nikolaj Sjujskij
4640646cf7 build: fix hgrc manpage building with docutils 0.9
Since docutils 0.9, `roman` module has been moved from module directory root
(i.e. `site-packages/roman.py`) to `docutils.utils` module. Therefore `import
roman` statement should be wrapped in `try: ... except ImportError: ...` block
to handle importing correctly.
2012-05-08 23:59:39 +04:00
Martin Geisler
bde13df69f doc: update copyright years to 2012
I sometimes look at a piece of software and if the man page says
"Copyright 2004", then I'm inclined to think that the project is stale
or that the authors are lazy. Neither is good publicity for us :-)
2012-04-30 12:04:30 +02:00
Olav Reinert
f1e67c7732 Describe all files related to the standard commands. 2011-12-06 15:50:28 +01:00
Martin Geisler
1c39113f99 runrst: improve error message when Docutils is missing
Peter Toft told me he had installed a 'python-doc' package instead of
the correct 'python-docutils' and he suggested that we add the URL to
Docutils in our error message.
2011-10-20 17:47:33 +02:00
Augie Fackler
fdd2f9d735 globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__') 2011-07-25 16:24:37 -05:00
Thomas Arendsen Hein
692a53d202 classes: fix class style problems found by 06e968819ac9
This makes test-wireprotocol.py work on Python 2.4
2011-06-29 15:00:00 +02:00
Satish Balay
c27b39c4fa hgmanpage: adapt to Docutils 0.8 API change 2011-06-16 19:34:42 +02:00
Martin Geisler
9573c538b1 gendoc: config help topic is in hgrc.5, do not include it in hg.1 2011-05-30 11:18:47 +02:00
Martin Geisler
5cdd89938e doc: improve merge between hgrc.5 and config help topic 2011-05-30 11:15:25 +02:00
Martin Geisler
8a54b72005 doc: rebuild hgrc.5 man and HTML page when help/config changes 2011-05-30 11:14:31 +02:00
Yun Lee
657bb2225f help: move part of hgrc.5 man page config help topic 2011-05-30 10:21:39 +02:00
Yun Lee
5e2a128d7e hgrc.5: make minirst find headings correctly
The minirst parser is stricter than Docutils here and require a blank
after a heading. Otherwise the heading is classified as a paragraph.
2011-05-30 10:05:39 +02:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Martin Geisler
a06eb9c517 hgrc.5: document positional arguments in aliases 2011-05-09 11:01:45 +02:00
Martin Geisler
f5c2dafa86 merge with stable 2011-05-09 10:52:08 +02:00
Martin Geisler
1583dc8eb5 hgrc.5: document shell aliases 2011-05-09 10:46:54 +02:00
Martin Geisler
bcd0e81ccd hgrc.5: drop 'hgext.' prefix when talking about extensions
The first paragraph apply to all extensions, not just those in hgext.
The second paragraph can just use the simpler form to load mq.
2011-04-07 11:17:55 +02:00
Steve Borho
fe1b6543d5 filemerge: introduce a 'regkeyalt' merge tool variable
This allows us to provide alternate search keys for 64bit operating systems that
may have 32bit merge tools installed.  Presumably it may find other uses.
2011-03-08 13:05:18 -06:00
Patrick Mezard
1e4894d773 commit: abort if a subrepo is modified and ui.commitsubrepos=no
The default behaviour is to commit subrepositories with uncommitted changes. In
my experience this is usually undesirable:

- Changes to dependencies are often debugging leftovers
- Real changes should generally be applied on the source project directly,
  tested then committed. This is not always possible, subversion subrepos may
  include only a small part of the source project, without the tests.

Setting ui.commitsubrepos=no will now abort commits containing such modified
subrepositories like:

  $ hg --config ui.commitsubrepos=no ci -m msg
  abort: uncommitted changes in subrepo sub

I ruled out the hook solution because it does not easily take --include/exclude
options in account. Also, my main concern is whether this flag could cause
problems with extensions. If there are legitimate reasons for callers to
override this behaviour (I could not find any), they might either override at ui
level, or we could add an argument to localrepo.commit() later.

v2:
- Renamed ui.commitsubs to ui.commitsubrepos
- Mention the configuration entry in hg help subrepos
2011-02-15 22:25:48 +01:00
Afuna
d6f1c156c0 doc: Add diff.unified to the hgrc docs. 2011-02-11 17:23:24 +08:00
Javi Merino
aadbeeda71 doc: Capitalize the "options" header of mercurial commands 2011-02-05 14:37:25 +00:00
Mads Kiilerich
0c2d4a2e7e merge with stable 2011-02-01 01:55:45 +01:00
Yuya Nishihara
da93c3bd0b url: add --insecure option to bypass verification of ssl certificates
If --insecure specified, it behaves in the same way as no web.cacerts
configured.

Also shows hint for --insecure option when _verifycert() failed. But currently
the hint isn't displayed on SSLError, because it needs a certain level of
changes.
2011-01-29 23:23:24 +09:00
Mads Kiilerich
e10e504454 url: 'ssh known host'-like checking of fingerprints of HTTPS certificates
Known fingerprints of HTTPS servers can now be configured in the
hostfingerprints section. That makes it possible to verify the identify of web
servers without configuring and trusting the CA chain.

Limitations:
* Portnumbers are ignored, just like with ordinary certificates.
* Host name matching is case sensitive.
2011-01-28 02:57:59 +01:00