Commit Graph

234 Commits

Author SHA1 Message Date
Augie Fackler
9a0414f5ae tests: clean up many print statements to be print functions instead
Differential Revision: https://phab.mercurial-scm.org/D294
2017-06-15 14:22:25 -04:00
Pulkit Goyal
4d367c3543 commitextras: mark the extension as ADVANCED 2017-07-18 00:10:44 +05:30
Pulkit Goyal
90d68a27f9 commitextras: move fb extension to core which add extras to a commit
This patch moves the Facebook extension to add extra fields to a commit to a
in-core extension.
2017-07-12 00:23:45 +05:30
Matt Harbison
48f91ce813 debug: add a method to check the state of, and built an SSL cert chain
This is only useful on Windows, and avoids the need to use Internet Explorer to
build the certificate chain.  I can see this being extended in the future to
print information about the certificate(s) to help debug issues on any platform.
Maybe even perform some of the python checks listed on the secure connections
wiki page.  But for now, all I need is 1) a command that can be invoked in a
setup script to ensure the certificate is installed, and 2) a command that the
user can run if/when a certificate changes in the future.

It would have been nice to leverage the sslutil library to pick up host specific
settings, but attempting to use sslutil.wrapsocket() failed the
'not sslsocket.cipher()' check in it and aborted.

The output is a little more chatty than some commands, but I've seen the update
take 10+ seconds, and this is only a debug command.
2017-03-30 00:27:46 -04:00
Martin von Zweigbergk
d4520a7687 dispatch: fix typo suggestion for disabled extension
If the matching command lives in an in-tree extension (which is all we
scan for), and the user has disabled that extension with
"extensions.<name>=!", we were not finding it, because the path in
_disabledextensions was the empty string. If the user had set
"extensions.<name>=!<valid path>" it would work, so it seems like just
a mistake that it didn't work.
2017-07-07 00:13:53 -07:00
Martin von Zweigbergk
8ea70f4620 tests: add tests for typoed commands
This includes one test showing how disabling a command with e.g.
"extensions.rebase=!" results in the command not being
suggested. We'll fix that next.
2017-07-07 00:12:44 -07:00
Augie Fackler
3112944d5b tests: replace yet more calls to python with $PYTHON
These are some simple cases. More to come in a future change.

Reviewers: krbullock

Reviewed By: krbullock

Differential Revision: https://phab.mercurial-scm.org/D4
2017-07-05 11:10:11 -05:00
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Gregory Szorc
3816d83a29 hgweb: consolidate search form for paper
AFAICT this was mostly a bunch of copy pasta. The only variation is
some pages defined a "value" attribute. The "query" variable will
just be empty on pages that don't accept it. So let's consolidate
the template and remove the redundancy.
2017-06-09 13:59:13 -07:00
Augie Fackler
a4af15f677 tests: port test extension in test-help.t to python 3
The changes required herein suggest to me that we should probably
accept ascii-safe unicode strings for command name, flag name, etc.
2017-05-28 15:42:05 -04:00
Yuya Nishihara
3e663dde68 registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
2016-01-09 23:07:20 +09:00
Pierre-Yves David
383c4352b9 caches: introduce a 'debugupdatecaches' command
That command make sure caches are updated. This is based on
'localrepo.updatecaches' so when we move support for new cache in that function this
command will benefit from it.
2017-05-02 21:35:06 +02:00
FUJIWARA Katsunori
0dd849cb04 debugcommands: add debugpickmergetool to examine which merge tool is chosen
Before this patch, there is no convenient way to know which merge tool
is chosen for each managed files without actual merging.
2017-05-13 03:37:50 +09:00
FUJIWARA Katsunori
aa0e47b129 filemerge: add internal merge tool to dump files forcibly
Internal merge tool :dump implies premerge. Therefore, files aren't
dumped, if premerge runs successfully.

This undocumented behavior might confuse users, if they want to always
dump files. But just making :dump omit premerge might cause backward
compatibility issue for existing automation.

This patch adds new internal merge tool :forcedump, which works as
same as :dump, but omits premerge always.

Internal tools annotated with "nomerge" should merge "change and
delete" correctly, but _forcedump() can't. Therefore, it is annotated
with "mergeonly" to always omit premerge, even though it doesn't merge
files actually.

This patch also adds explanation about premerge to :dump, to clarify
how :dump actually works.

BTW, this patch specifies internal tools with "internal:" prefix in
newly added test scenario in test-merge-tools.t, even though this
prefix is already deprecated. This is only for similarity to other
tests in test-merge-tools.t.
2017-05-13 03:31:42 +09:00
FUJIWARA Katsunori
b7a92ca8d3 help: describe about choice of :prompt as a fallback merge tool explicitly
"merge-tools" help topic has described that the merge of the file
fails if no tool is found to merge binary or symlink, since
9da9bced2226 (or Mercurial 1.7), which based on (already removed)
MergeProgram wiki page.

But even at that revision, and of course now, merge of the file
doesn't fail automatically for binary/symlink. ":prompt" (or
equivalent logic) is used, if there is no appropriate tool
configuration for binary/symlink.
2017-05-06 02:33:00 +09:00
Matt Harbison
44c7a911a4 help: spelling fixes 2017-05-03 22:07:47 -04:00
Matt DeVore
212fc81929 help: explain how to access subtopics in internals 2017-04-19 17:04:22 -07:00
Alexander Fomin
b6338c907a diff: add --binary option for git mode diffs
This patch adds --binary option to `hg diff` and `hg export` to allow more
control about when binary diffs are displayed in Git mode as well as some
tests to verify it behaves correctly (issue5510).
2017-04-05 15:31:08 -07:00
Augie Fackler
66c2df4ce9 tests: make zstd-related output optional
Caught by the buildbot with --pure, fix suggested by indygreg.
2017-04-03 19:45:09 -04:00
Gregory Szorc
04c3125727 commands: update help for "unbundle"
Similar to the recent change to "bundle," this command no longer
just deals with "changegroup" data.
2017-04-01 13:43:52 -07:00
Gregory Szorc
5c890f5f16 commands: update help for "bundle"
We now have a dedicated help topic to describe bundle specification
strings. Let's update `hg bundle`'s documentation to reflect its
existence.

While I was hear, I also tweaked some wording which I felt was out
of date and needed tweaking. Specifically, `hg bundle` no longer
just deals with "changegroup" data: it can also generate files
that have non-changegroup data.
2017-04-01 13:43:43 -07:00
Gregory Szorc
2f6dff3311 help: document bundle specifications
I softly formalized the concept of a "bundle specification" a while
ago when I was working on clone bundles and stream clone bundles and
wanted a more robust way to define what exactly is in a bundle file.

The concept has existed for a while. Since it is part of the clone
bundles feature and exposed to the user via the "-t" argument to
`hg bundle`, it is something we need to support for the long haul.

After the 4.1 release, I heard a few people comment that they didn't
realize you could generate zstd bundles with `hg bundle`. I'm
partially to blame for not documenting it in bundle's docstring.

Additionally, I added a hacky, experimental feature for controlling
the compression level of bundles in 054e64c4d837. As the commit
message says, I went with a quick and dirty solution out of time
constraints. Furthermore, I wanted to eventually store this
configuration in the "bundlespec" so it could be made more flexible.

Given:

a) bundlespecs are here to stay
b) we don't have great documentation over what they are, despite being
   a user-facing feature
c) the list of available compression engines and their behavior isn't
   exposed
d) we need an extensible place to modify behavior of compression
   engines

I want to move forward with formalizing bundlespecs as a user-facing
feature. This commit does that by introducing a "bundlespec" help
page. Leaning on the just-added compression engine documentation
and API, the topic also conveniently lists available compression
engines and details about them. This makes features like zstd
bundle compression more discoverable. e.g. you can now
`hg help -k zstd` and it lists the "bundlespec" topic.
2017-04-01 13:42:06 -07:00
Augie Fackler
0ab8866ffd help: update help.internalstable for new censor docs 2017-03-10 17:37:39 -05:00
Yuya Nishihara
cb8fe16f12 help: fix layout of pre-formatted text 2017-03-09 12:55:48 +09:00
Kyle Lippincott
2dc3df2798 help: fix internals.changegroups
Add information about tree manifests, copy edit the text and fix up a few
ambiguities.

The document also contains a few additional fixes from Siddharth Agarwal
<sid0@fb.com>, who used it to build a parser for changegroups in Rust.
2017-03-01 18:37:34 -08:00
Pierre-Yves David
c15f0613a0 color: update the help table
We also need to reference the new topic in the great old help table.
2017-03-01 20:22:04 +01:00
Pierre-Yves David
a29094b506 color: update main documentation
Now that the feature no longer lives in the extension, we document it in the
help of the core config. This include the new 'ui.color' option introduced in
the previous changesets.

As a result the color extensions can now be deprecated.

This is a documentation patch only; color is still disabled by default.
2017-02-21 20:04:55 +01:00
Pierre-Yves David
394a984c5e color: move 'debugcolor' into the 'debugcommands' modules
This is the last bits we needed to move out of the extensions. 'hgext/color.py'
now only contains logic to changes the default color behavior to 'auto'.

However, more cleanups are on the way and we need to document the new config
directly in core.
2017-02-21 18:41:37 +01:00
Pierre-Yves David
b29eb57306 color: add a 'ui.color' option to control color behavior
This new option control whether or not color will be used. It mirror the behavior
of '--color'. I usually avoid adding new option to '[ui]' as the section is
already filled with many option. However, I feel like 'color' is central enough
to deserves a spot in this '[ui]' section.

For now the option is not documented so it is still marked as experimental. Once
it get documented and official, we should be able to deprecate the color
extensions.

There is more cleanup to do before that documentation is written, but we need
this option early to made them. Having that option will allow for more cleanup
of the initialisation process and proper separation between color
configuration.
2017-02-25 19:44:23 +01:00
Pierre-Yves David
e5d5db7cf5 color: add the definition of '--color' in core
If we want to be able to move the initialisation in core, we need core to be
aware of that '--color' flag at all time. So we now have the definition in core. That flag
is currently unprocessed without the extensions (will be fixed soon). In
addition the default value for this flag in core is 'never'. Enabling the
extensions change that default value to 'auto'.
2017-02-21 18:09:21 +01:00
Jun Wu
e6e6b6f331 help: hide command line options marked as "advanced"
Previously, we have keywords like "(DEPRECATED)" and "(EXPERIMENTAL)" to
hide command line options in non-verbose help output.

However, sometimes an option is neither deprecated nor experimental. It's
well-tested and working, but just not designed to average users. This patch
adds a keyword "(ADVANCED)" to fit in such use cases.

Thanks rom1dep for the suggestion of the word "advanced".
2016-11-01 14:50:45 +00:00
Augie Fackler
2e832efca3 pager: move most help to a new help topic and deprecate extension 2017-02-07 00:07:53 -05:00
Jun Wu
7bdcbacb01 tests: use LOCALIP
This patch replaces hardcoded 127.0.0.1 with $LOCALIP in all tests.

Till now, the IPv6 series should make tests pass on common IPv6 systems
where the local device has the address "::1" and the hostname "localhost"
resolves to "::1".
2017-02-16 09:38:52 -08:00
Augie Fackler
3967c4ed9b pager: move more behavior into core
This moves the global flag and the --pager=yes logic into core. Only
functionality change is that users now always get a --pager flag and
can enable the pager via the flag without the extension active.

Moving the flag into core exposes a defect in the ro localization,
which will have to be corrected later.
2017-02-15 17:47:57 -05:00
Martin von Zweigbergk
2b641873b5 merge with stable 2017-02-13 09:44:16 -08:00
FUJIWARA Katsunori
2afd920706 misc: update year in copyright lines
This patch also makes some expected output lines in tests glob-ed for
persistence of them.

BTW, files below aren't yet changed in 2017, but this patch also
updates copyright of them, because:

    - mercurial/help/hg.1.txt

      almost all of "man hg" output comes from online help of hg
      command, and is already changed in 2017

    - mercurial/help/hgignore.5.txt
    - mercurial/help/hgrc.5

      "copyright 2005-201X Matt Mackall" in them mentions about
      copyright of Mercurial itself
2017-02-12 02:23:33 +09:00
Gregory Szorc
16568ee7f0 debugcommands: stub for debugupgraderepo command
Currently, if Mercurial introduces a new repository/store feature or
changes behavior of an existing feature, users must perform an
`hg clone` to create a new repository with hopefully the
correct/optimal settings. Unfortunately, even `hg clone` may not
give the correct results. For example, if you do a local `hg clone`,
you may get hardlinks to revlog files that inherit the old state.
If you `hg clone` from a remote or `hg clone --pull`, changegroup
application may bypass some optimization, such as converting to
generaldelta.

Optimizing a repository is harder than it seems and requires more
than a simple `hg` command invocation.

This commit starts the process of changing that. We introduce
`hg debugupgraderepo`, a command that performs an in-place upgrade
of a repository to use new, optimal features. The command is just
a stub right now. Features will be added in subsequent commits.

This commit does foreshadow some of the behavior of the new command,
notably that it doesn't do anything by default and that it takes
arguments that influence what actions it performs. These will be
explained more in subsequent commits.
2016-11-24 16:24:09 -08:00
Martin von Zweigbergk
1840263a8c help: merge revsets.txt into revisions.txt
Selecting single and multiple revisions is closely related, so let's
put it in one place, so users can easily find it. We actually did not
even point to "hg help revsets" from "hg help revisions", but now that
they're on a single page, that won't be necessary.
2017-01-11 11:37:38 -08:00
Martin von Zweigbergk
4ef1db40a7 tests: use hg help dates instead of hg help revs in test
The revisions help is already long and will get longer, so switch to
another short and stable topic.
2017-01-11 11:40:40 -08:00
Martin von Zweigbergk
01bab7fc55 help: use a single paragraph to describe full and abbreviated nodeids
The texts describing 40-digit strings and the abbreviated form are
closely related, so make it a single paragraph.
2017-01-11 11:28:54 -08:00
Gregory Szorc
49f189afa0 hgweb: call process_dates() via DOM event listener
All the hgweb templates include mercurial.js in their header. All
the hgweb templates have the same <script> boilerplate to run
process_dates(). This patch factors that function call into
mercurial.js as part of a DOMContentLoaded event listener.
2017-01-10 20:47:48 -08:00
Yuya Nishihara
da936af562 help: show section that couldn't be found
For better error indication.
2017-02-05 18:57:19 +09:00
Martin von Zweigbergk
8f2ed099c1 help: make multirevs just an alias for revsets
The multirevs topis seems to be covered well by the revsets topic, so
just make it an alias and remove multirevs.txt.
2016-12-16 09:48:14 -08:00
Yuya Nishihara
30fe4722fb chgserver: make it a core module and drop extension flags
It was an extension just because there were several dependency cycles I
needed to address.

I don't add 'chgserver' to extensions._builtin since chgserver is considered
an internal extension so nobody should enable it by their config.
2016-10-15 14:30:16 +09:00
Pierre-Yves David
d482e52866 help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now
The ability to negate any boolean flags itself is great, but I think we are not
ready to expose the help side of it yet.

First, while there exist a handful of such flags whose default value can be
changed (eg: git diff, patchwork confirmation), there is only a few of them. The
users who benefit the most from this change are alias users and large
installation that can deploy extension to change behavior (eg: facebook
tweakdefault).  So the majority of user who will be affected by a large change
to command help that is not yet relevant to them. (I expect this to become
relevant when ui.progressive start to exists).

Below is an example of the impact of the new help on 'hg help diff':

  -r --rev REV [+]              revision
  -c --change REV               change made by revision
  -a --[no-]text                treat all files as text
  -g --[no-]git                 use git extended diff format
     --[no-]nodates             omit dates from diff headers
     --[no-]noprefix            omit a/ and b/ prefixes from filenames
  -p --[no-]show-function       show which function each change is in
     --[no-]reverse             produce a diff that undoes the changes
  -w --[no-]ignore-all-space    ignore white space when comparing lines
  -b --[no-]ignore-space-change ignore changes in the amount of white space
  -B --[no-]ignore-blank-lines  ignore changes whose lines are all blank
  -U --unified NUM              number of lines of context to show
     --[no-]stat                output diffstat-style summary of changes
     --root DIR                 produce diffs relative to subdirectory
  -I --include PATTERN [+]      include names matching the given patterns
  -X --exclude PATTERN [+]      exclude names matching the given patterns
  -S --[no-]subrepos            recurse into subrepositories

Another issue with the current state of help, the default value for the
flag is not conveyed to the user. For example in the 'backout' help, there is
no real distinction between "--[no-]backup" (default to True) and "--[no-]keep"
(default) to False:

  --[no-]backup        no backups
  --[no-]keep          do not modify working directory during strip

In addition, I've discussed with Augie Fackler and the last batch of the work on
this have burned him out quite some. Therefore he is not intending to perform
any more work on this topic. Quoting him, he would rather see the help part
backed out than spending more time on it.

I do not think we are ready to expose this to users in 4.0 (freeze in a week),
especially because we cannot expect quick improvement on these aspect as this
topic no longer have an owner. We should be able to reintroduce that change in
the future when someone get back on it and the main issues are solves:

* Introduction of  ui.progressive makes it relevant for a majority of user,
* Current default value are efficiently conveyed to the user.

(In addition, the excerpt from diff help show that we still have some issue with
some negative option like '--nodates' so further improvement are probably
welcome there.)
2016-10-09 03:11:18 +02:00
Augie Fackler
8bed0bf30f merge with stable 2016-10-01 15:10:38 -04:00
Kevin Bullock
9eb7f2dc02 grep: rewrite help to better document current (confusing) behavior 2016-09-23 12:45:10 -05:00
Augie Fackler
8843ab4c98 help: mark boolean flags with [no-] to explain that they can be negated
That is, help gets tweaked thus:

  global options ([+] can be repeated):
   -v --[no-]verbose      enable additional output


Other proposals have included:

  global options ([+] can be repeated, options marked [?] are boolean flags):
   -v --verbose[?]        enable additional output

and

  global options ([+] can be repeated, options marked [^] are boolean flags):
   -v --verbose[^]        enable additional output

which avoid the unfortunate visual noise in this patch. In this
version's favor, it's consistent with what I'm used to seeing in man
pages and similar documentation venues.
2016-09-13 22:58:12 -04:00
Anton Shestakov
9edbb61202 hgweb: make anchor name actually match its href on help index page 2016-09-26 16:12:40 +08:00
Hannes Oldenburg
d853961750 templates: add built-in files() function
We already support multiple primitive for listing files, which were
affected by the current changeset.
This patch adds files() which returns files of the current changeset
matching a given pattern or fileset query via the "set:" prefix.
2016-09-23 08:15:05 +00:00