Commit Graph

557 Commits

Author SHA1 Message Date
Mateusz Kwapich
ccdc9763be hgsuversion: move docs and tools
Summary: Moves various tools from hgsubversion/ to contrib/hgsubversion

Test Plan: N/A

Reviewers: quark, #mercurial

Reviewed By: quark

Differential Revision: https://phabricator.intern.facebook.com/D6698604

Signature: 6698604:1515628552:cfae17dcfdbc96d978a6af5c19dfa1032e8aa48c
2018-01-10 16:20:15 -08:00
Kostia Balytskyi
c2556d553e remotenames: drop the dir and do some cleanup
Summary: Depends on D6693417

Test Plan: - run tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6693427
2018-01-10 09:01:52 -08:00
Kostia Balytskyi
31b2bc4290 fb-hgext: move docs
Summary: Moving the docs over before dropping the dir.

Test Plan: - nope.

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6693238
2018-01-10 08:44:04 -08:00
Ryan McElroy
66bd74e558 hggit: internalize extension
Test Plan: run-tests-.py

Reviewers: mitrandir, #mercurial

Reviewed By: mitrandir

Subscribers: ps, terrelln

Differential Revision: https://phabricator.intern.facebook.com/D6675896

Tasks: T24908724

Signature: 6675896:1515448382:df8d80cd7356ae8f5fb04586dc4a0a651bc498fd
2018-01-09 06:08:01 -08:00
Ryan McElroy
9cf8ea29dd gendoc: fix doc generation to use extensions from repository
Summary:
Previously, we were loading extensions from the environment which
is not good for actually getting the right docs.

> It is just plain wrong. --ikostia

Test Plan: run-tets.py

Reviewers: ikostia, #mercurial

Reviewed By: ikostia

Differential Revision: https://phabricator.intern.facebook.com/D6682879

Signature: 6682879:1515500917:a0b79bdae32dfa300fcab83488012c77a5145e15
2018-01-09 04:29:10 -08:00
Kostia Balytskyi
0e4d95b67e fb-hgext: fix gendoc-related issues
Summary:
These fixes are related to documentation-related check-style tests.

Depends on D6675344

Test Plan: - more tests pass

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675351
2018-01-09 03:44:33 -08:00
Jun Wu
9c14bace2f check-seclevel: skip checking extensions that cannot be imported
Summary:
check-seclevel will load disabled extensions including hgsql, which may fail
if its external dependency mysql.connector is not installed. That will break
test-help.t. The error is not fatal so let's just ignore it.

Test Plan:
Run test-help.t on a machine without mysql.connector installed and it now
passes.

Reviewers: durham, #mercurial

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6678500

Signature: 6678500:1515454124:cdd59b644189da86f7d861e80ea3968d6c4b45b1
2018-01-08 14:34:05 -08:00
Mark Thomas
c423f614f2 gendoc: ignore extensions that can't be loaded while generating docs
Summary:
hgsql can't be loaded if you don't have mysql.connector installed on the build
machine.  That shouldn't stop documentation from being generated.

Test Plan:
Make hgsql fail to load on my devserver (add a syntax error) and then build the
documentation.  Make sure it builds anyway.

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6660865

Tasks: T24908724
2018-01-04 09:26:37 -08:00
Mark Thomas
742cd624f7 hgsql: integrate with hg-crew
Summary:
Move hgsql into the hgext directory, and the tests to tests/test-hgsql-*.

Update the tests to refer to the new places for things.

Test Plan: Run the hgsql tests and make sure they pass.

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6660499

Tasks: T24908724
2018-01-04 07:22:19 -08:00
muxator
0c29e9b194 build: make install in "/doc" failed if the destination dir contained spaces
This and the following commits try to add the necessary quoting in the build
scripts to make the process more robust.

The target for now is rendering "make deb" successful even when the base
directory contains spaces (eg. "/opt/mercu rial").
The build process should succeed without scattering files in spurious
directories (eg.: "/opt/mercu/usr/bin/hg").
2017-10-11 01:19:48 +02:00
Augie Fackler
4f9e357bf2 doc: port check-seclevel.py to be Python 2/3 portable 2017-05-28 15:51:26 -04:00
Yuya Nishihara
cf5160a016 gendoc: make sure locale path is set before loading any modules
Otherwise some messages wouldn't be translated depending on when the util
was loaded.
2017-05-13 17:53:55 +09:00
Yuya Nishihara
1d44bd2bbb ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.

ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
2016-10-22 14:35:10 +09:00
Augie Fackler
8facc4e910 hgmanpage: stop using raw-unicode strings
These don't exist in Python 3, and this ends up looking a little more
explicit to Martijn and me anyway.
2016-10-07 07:43:04 -04:00
Yuya Nishihara
e1051c310e doc: remove double imports of inspect from hgmanpage.py 2016-05-14 14:37:25 +09:00
FUJIWARA Katsunori
f46b49a0e3 check-code: detect "missing _() in ui message" more exactly
Before this patch, "missing _() in ui message" rule overlooks
translatable message, which starts with other than alphabet.

To detect "missing _() in ui message" more exactly, this patch
improves the regexp with assumptions below.

  - sequence consisting of below might precede "translatable message"
    in same string token

    - formatting string, which starts with '%'
    - escaped character, which starts with 'b' (as replacement of '\\'), or
    - characters other than '%', 'b' and 'x' (as replacement of alphabet)

  - any string tokens might precede a string token, which contains
    "translatable message"

This patch builds an input file, which is used to examine "missing _()
in ui message" detection, before '"$check_code" stringjoin.py' in
test-contrib-check-code.t, because this reduces amount of change churn
in subsequent patch.

This patch also applies "()" instead of "_()" on messages below to
hide false-positives:

  - messages for ui.debug() or debug commands/tools
    - contrib/debugshell.py
    - hgext/win32mbcs.py (ui.write() is used, though)
    - mercurial/commands.py
      - _debugchangegroup
      - debugindex
      - debuglocks
      - debugrevlog
      - debugrevspec
      - debugtemplate

  - untranslatable messages
    - doc/gendoc.py (ReST specific text)
    - hgext/hgk.py (permission string)
    - hgext/keyword.py (text written into configuration file)
    - mercurial/cmdutil.py (formatting strings for JSON)
2016-06-21 00:50:39 +09:00
timeless
a1cb3173a2 py3: convert to next() function
next(..) was introduced in py2.6 and .next() is not available in py3

https://docs.python.org/2/library/functions.html#next
2016-05-16 21:30:53 +00:00
Matt Mackall
a24591e84c merge with stable 2016-05-17 11:28:46 -05:00
Sean Farley
dc865d7f73 hg-ssh: copy doc string to man page
This corrects a warning from lintian that we're shipping an executable without
a man page. Since there is a doc string in the text, let's use that for the man
page.
2016-05-06 23:03:41 -07:00
Pulkit Goyal
8ceac3e1b6 py3: make doc/docchecker use print_function 2016-05-13 02:41:35 +05:30
Pulkit Goyal
5e47f5d746 py3: make doc/docchecker use absolute_import 2016-05-13 02:40:39 +05:30
Pulkit Goyal
4970ad7eb8 py3: make raise statement python3 compatible
In python3
	raise error, message
has been changed to
	raise error(message)

In additional to that nodes.SkipNode is changed to nodes.SkipNode() so that
it creates an instance directly.
2016-05-13 03:18:04 +05:30
Pulkit Goyal
16d6b10e69 py3: make hgmanpage use absolute_import 2016-04-17 00:23:05 +05:30
Pulkit Goyal
e736fa4f52 py3: make gendoc use absolute_import
Fixed direct imports even the tests were not complaining.
2016-04-17 00:20:44 +05:30
Pulkit Goyal
f869841929 py3: make check-seclevel use absolute_import
Also fixed direct symbol imports even the tests were not complaining.
2016-04-17 00:14:42 +05:30
timeless
6f6caafe41 docchecker: try to reject single quotes 2016-01-12 09:30:57 +00:00
timeless
052bc178fc docchecker: report context line at most once 2016-03-03 03:32:44 +00:00
FUJIWARA Katsunori
8e59a858bd doc: translate from :hg:help config.SECTION to a valid link to hgrc.5.html
Before this patch, ":hg:`help config.SECTION`" in online help text is
translated to a link to "hg.1.html#config.SECTION" in HTML
unintentionally.

This patch translates from :hg:`help config.SECTION` in online help
text to a valid link to "hgrc.5.html#SECTION" in HTML.

This patch ignores element(s) under "SECTION" (e.g. "ITEM" of
":hg:`help config.SECTION.ITEM`"), because there is no way to refer
directly to it in HTML, yet.
2016-02-11 23:15:34 +09:00
FUJIWARA Katsunori
4436dba238 doc: translate from :hg:help config to a valid link to hgrc.5.html
Before this patch, ":hg:`help config`" in online help text is
translated to a link to "hg.1.html#config" in HTML, even though actual
"hg help config" shows not help for "hg config" command but "config"
help topic, and all of current ":hg:`help config`" expects the latter.

This patch translates from ":hg:`help config`" in online help text to
a link to "hgrc.5.html" in HTML as expected.

This patch also allows ":hg:`help -c COMMAND`" style to link
"hg.1.html#COMMAND" for readability.
2016-02-11 23:15:34 +09:00
FUJIWARA Katsunori
357c04e06b docchecker: use indentation of 4 spaces
This is fixing for 'must indent 4 spaces' check-code rule.

check-code has overlooked this, because a file isn't recognized as one
to be checked (this problem is fixed by subsequent patch).
2016-02-10 22:44:29 +09:00
FUJIWARA Katsunori
c26e9ad792 docchecker: remove naked except clause
This is fixing for 'naked except clause' check-code rule.

check-code has overlooked this, because a file isn't recognized as one
to be checked (this problem is fixed by subsequent patch).
2016-02-10 22:44:29 +09:00
Bryan O'Sullivan
425505f93a check-seclevel: use a context manager for file I/O 2016-01-12 14:28:16 -08:00
timeless
81962ef57d docchecker: scan for missing space before :hg: 2016-01-06 20:05:18 +00:00
timeless
70bec9473a docchecker: introduce a way to check for poor markup
Specifically, :hg:`foo 'bar baz'` when rendered by `hg help`
results in:

  'hg foo 'bar baz''

... which is hard to read.

We encourage :hg:`foo "bar baz"` instead.
2016-01-06 19:47:14 +00:00
Jun Wu
ea41b32b83 mercurial: pass ui to extensions.load (issue5007)
extensions.load does need ui argument to print error if an extension
fails to load.
2015-12-17 10:30:17 +00:00
Bryan O'Sullivan
d7b0a811b8 check-seclevel: pass a ui to the extension loader
Without this, if an import error occurs (as with pypy), the attempt to
report it fails since ui is None.
2015-12-22 21:38:06 -08:00
Bryan O'Sullivan
b75f25ac1e check-seclevel: add a --debug option
This will make it possible to get semi-meaningful tracebacks if an import
error occurs.

Why care? Trying to run this script under pypy currently fails, but the
true error is obscured.
2015-12-22 21:38:05 -08:00
timeless
b7fa6a1a27 doc: add execute bit and fix shbang line for gendoc.py 2015-12-22 07:59:14 +00:00
Gregory Szorc
b6d0b58fa7 doc: make gendoc.py module import policy aware
Without this, running gendoc.py during an install without C modules
available (via `make local`) will result in an import failure because
the default module load policy insists on C modules.

We also remove the sys.path adjustment because it is no longer needed
since our magic importer handles things.
2015-12-12 13:23:29 -05:00
Gregory Szorc
ec18b44ca2 check-seclevel: set module load policy to Python only
If we don't change this, the upcoming change to make the module
loading policy only load C modules will cause this script to fail if
run with CPython against an unbuilt source checkout.
2015-11-24 22:53:55 -08:00
Mads Kiilerich
09567db49a spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Yuya Nishihara
2f746aa9d3 help: pass around ui to doc loader (API)
This is necessary to hide DEPRECATED items conditionally.

Flagged as API change because it will break "hg help git|subversion".
2015-09-26 12:06:30 +09:00
Yuya Nishihara
958a6389af gendoc: use real ui in place of stdout
ui attributes will be required by a help function, so a file object can't be
used as a fake ui.
2015-09-27 23:34:37 +09:00
Yuya Nishihara
f3df68f405 check-seclevel: use ui to show status and error messages
Future patches will require ui module to be passed to a help function, so
let's use it where appropriate.

Additional parens are necessary to silence a check-code warning.
2015-09-27 22:29:07 +09:00
Yuya Nishihara
4b52e9276e check-seclevel: wrap entry point by function
This is intended to narrow scope of local variables. The global _verbose
flag will be replaced later by ui.verbose.
2015-09-27 22:19:54 +09:00
Yuya Nishihara
a63986f458 check-seclevel: set executable bit as it has shebang 2015-09-27 22:16:24 +09:00
timeless@mozdev.org
96eb7ea38c hgmanpage: fix grammar
remove 's's from places where they don't belong
insert the preposition 'in'
2015-09-08 13:22:01 -04:00
timeless@mozdev.org
52f5c5239d check-seclevel: fix file description grammar 2015-09-08 12:54:39 -04:00
Mads Kiilerich
b2b60414f6 spelling: fixes from proofreading of spell checker issues 2015-01-18 02:38:57 +01:00