Commit Graph

197 Commits

Author SHA1 Message Date
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
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
timeless
129b8093c7 tests: favor single quotes for wrapping hg help ... 2016-09-20 23:49:20 +00:00
timeless
5fd9e9e1b5 help: use single quotes in use warning 2016-09-20 23:47:46 +00:00
Gregory Szorc
9c6bc630a3 ui: path option to declare which revisions to push by default
Now that we have a mechanism for declaring path sub-options, we can
start to pile on features!

Many power users have expressed frustration that bare `hg push`
attempts to push all local revisions to the remote. This patch
introduces the "pushrev" path sub-option to control which revisions
are pushed when no "-r" argument is specified.

The value of this sub-option is a revset, naturally.

A future feature addition could potentially introduce a "pushnames"
sub-options that declares the list of names (branches, bookmarks,
topics, etc) to push by default. The entire "what to push by default"
feature should probably be considered before this patch lands.
2016-06-26 07:59:02 -07:00
Matt Mackall
a24591e84c merge with stable 2016-05-17 11:28:46 -05:00
FUJIWARA Katsunori
17fa5d0520 help: search section of help topic by translated section name correctly
Before this patch, "hg help topic.section" might show unexpected
section of help topic in some encoding.

It applies str.lower() instead of encoding.lower(str) on translated
message to search section case-insensitively, but some encoding uses
0x41(A) - 0x5a(Z) as the second or later byte of multi-byte character
(for example, ja_JP.cp932), and str.lower() causes unexpected result.

To search section of help topic by translated section name correctly,
this patch replaces str.lower() by encoding.lower(str) for both query
string (in commands.help()) and translated help text (in
minirst.getsections()).
2016-05-13 07:19:59 +09:00
Jun Wu
1c8f26818c hgcia: remove hgcia (BC)
As discussed at:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-March/081018.html,
cia service is down for years. It also uses socket.setdefaulttimeout() which
will break chg. This patch removes the extension.
2016-05-12 01:03:19 +01:00
Jun Wu
de167181c6 ui: add new config option for help text width
Before this patch, when printing help text using `hg help`, or `hg log -h`,
the output will wrap at 78 chars even if the user has a bigger terminal width
and there is no config option to change it, making the experience different
from the commonly used `man` tool.

This patch introduces a new config option `ui.textwidth`, which replaces the
hardcoded number. It's set to 78 by default to maintain compatibility. When
set to 0, `hg help` will behave more like `man`.
2016-05-04 18:18:24 +01:00
liscju
3f71c6cdfa help: show content for explicitly disabled extension (issue5228) 2016-09-01 22:06:42 +02:00
Gregory Szorc
5c136c2209 help: internals topic for wire protocol
The Mercurial wire protocol is under-documented. This includes a lack
of source docstrings and comments as well as pages on the official
wiki.

This patch adds the beginnings of "internals" documentation on the
wire protocol.

The documentation should have nearly complete coverage on the
lower-level parts of the protocol, such as the different transport
mechanims, how commands and arguments are sent, capabilities, and,
of course, the commands themselves.

As part of writing this documentation, I discovered a number of
deficiencies in the protocol and bugs in the implementation. I've
started sending patches for some of the issues. I hope to send a lot
more.

This patch starts with the scaffolding for a new internals page.
2016-08-22 19:46:39 -07:00
Gregory Szorc
efb3c4ff63 help: don't try to render a section on sub-topics
This patch subtly changes the behavior of the parsing of "X.Y" values
to not set the "section" variable when rendering a known sub-topic.
Previously, "section" would be the same as the sub-topic name. This
required the sub-topic RST to have a section named the same as the
sub-topic name.

When I made this change, the descriptions from help.internalstable
started being rendered in command line output. This didn't look correct
to me, as it didn't match the formatting of main help pages. I
corrected this by moving the top section to help.internalstable and
changing the section levels of all the "internals" topics.

The end result is that "internals" topics now match the rendering of
main topics on both the CLI and HTML. And, "internals" topics no longer
require a main section matching the name of the topic.
2016-08-06 17:04:22 -07:00
liscju
22e1e3529b remove: fix --force option help description (issue5177)
Before this commit --force option help description stated
that file was removed and deleted even if file was added
or modified which is not true. Force option removes added
file only from dirstate, it doesn't delete it from the
filesystem.
2016-04-13 09:56:51 +02:00
timeless
4fdfca9cff help: report source of aliases 2016-04-08 18:35:49 +00:00
Pierre-Yves David
6fceb4873e record: deprecate the extension
The feature has been moved into core behind the -i flag. We can safely
deprecated the extension and point people at the --interactive flag in core.
2016-03-28 12:50:56 -07:00
timeless
81737a7154 filemerge: use revset notation for p1/p2 of local/other descriptions 2016-03-17 00:36:01 +00:00
Yuya Nishihara
8968749681 tests: make config/help tests pass even if chgserver extension is loaded
It isn't important for these tests if "extensions.chgserver=" is set or not.
So let's make them ignore such lines.
2016-03-20 12:25:46 -07:00
timeless
a136072319 filemerge: indicate that local/other are p1/p2 2016-03-17 00:36:01 +00:00
Yuya Nishihara
7d5bdcf68d templater: add debugtemplate command
This is useful for debugging template parsing. Several tests are ported to
this command.
2016-02-14 01:06:12 +09:00
Gregory Szorc
891be7d008 help: document requirements
We didn't have unified documentation of the various repository
requirements. This patch changes that.
2016-03-12 18:51:07 -08:00
timeless
7c2842e773 copyright: update to 2016 2016-01-21 21:15:52 +00:00
timeless
308696c2c1 help: add --system flag to get help for various platform(s) 2016-01-10 08:03:58 +00:00
Gregory Szorc
5732d02b64 exchange: make clone bundles non-experimental and enabled by default
The clone bundles feature was introduced in Mercurial 3.6 behind an
experimental and disabled by default flag. The feature has been enabled
on hg.mozilla.org for a few months and has served many terabytes of
clones. Users have been encouraged to use the feature and reception
has been very positive (mainly due to faster clones as a result of
connecting to a CDN). I have heard no feedback about changing the
feature other than inquiries about when it will be enabled by default.
So, I think the feature is ready to be enabled by default.

This patch renames experimental.clonebundles to ui.clonebundles,
documents the option, and enables it by default. References to the
experimental state of clone bundles have been removed. The remaining
config option docs in clonebundles.py have been removed because they
are redudant with `hg help config`.

There are some oddities with behavior of clone bundles. Because clones
with clone bundles are effectively 2 `hg pull` operations, there may be
2 transactions. This could result in hooks running twice. If the
subsequent pull is aborted, it could result in partial rollback and an
incomplete clone. This behavior is a bit wonky and should probably
be documented. If this patch is accepted, I'll send a follow-up to
document it. I don't think this behavior should prevent the feature
being enabled by default. Reworking the clone mechanism to support
interrupted or multi-part clones feels like a major new feature and
something that when implemented can change the hook and rollback
semantics of clone bundles. Besides, partial clone is better than
full rollback and hooks running on initial clone are likely rare, so I
think the impact is minimal.
2016-01-08 10:58:04 -08:00
timeless
45b895c57d minirst: change hgrole to use single quotes
We decided to reserve double quotes for arguments to hg because cmd
does not like single quotes, so switch the outer quotes to single
2016-01-12 06:03:36 +00:00
Laurent Charignon
f5214fc7b3 debugignore: find out if a file is being ignored
Before this patch debugignore was just displaying the list of ignore patterns.
This patch makes it support a list of filename as argument and tells the user
if those given files are ignored or not.
2016-01-05 07:47:08 -08:00
Gregory Szorc
8e5f315fff internals: document revlog format
It seems like a good idea to document the revlog format.

There is a lot more that could be added to this documentation.
But you have to start somewhere.
2015-12-30 16:21:57 -07:00
Bryan O'Sullivan
ca96e23cd1 dispatch: report similar names consistently 2016-01-04 21:52:44 -08:00
timeless
c09ee5764f help: include section heading if section depth changes
This makes it easier to distinguish between:

"format"
--------
"usestore"
...
    Enabled by default.

and

"progress.format"
    Format of the progress bar.
2016-01-01 16:59:13 +00:00
Gregory Szorc
a3e59a30b6 hgweb: support rendering a sub-topic
If the requested topic contains a "." we assume a sub-topic is
requested and display it.
2015-12-30 17:15:10 -07:00
Gregory Szorc
a320e743a7 hgweb: support rendering sub-topic indexes
If the requested topic name is the name of a sub-topic, we now render
an index of topics within that sub-topic.
2015-12-30 17:34:51 -07:00
Gregory Szorc
627d3b55af templates: make earlycommands and othercommands optional
We now have sub-topics in the help system. The "helptopics" template
serves as a mechanism for displaying an index of help topics.
Previously, it was only used to show the top-level list of help topics,
which includes special groupings of topics.

In the near future, we'll adapt "helptopics" for showing the index
of sub-topics. In this patch, we optionally render {earlycommands} and
{othercommands} since they aren't present on sub-topics.
2015-12-30 17:12:59 -07:00
timeless
c754b0afd2 remove: quote --force in never deletes note
Split Note into a note container
2015-12-22 06:02:01 +00:00
timeless
a433b637d1 commands: the first word of each note should be capital or hg 2015-12-22 02:24:16 +00:00
timeless
78ff92a147 diff: clarify comparison as first parent 2015-12-18 18:52:25 +00:00
Augie Fackler
e4e988fdf5 changegroups: add documentation for cg3 2015-12-18 09:57:35 -05:00
timeless
86a42ddbf7 add: mention .hgignore in help 2015-12-17 14:53:40 +00:00
timeless
8e17ef3397 help: filter extension commands 2015-12-14 05:29:55 +00:00
timeless
37c2440209 test-help: tighten grep patterns
Help should output section headings, but no debug commands
2015-12-14 06:00:32 +00:00
Gregory Szorc
aaa8195abf help: support loading sub-topics
If a sub-topic/section is requested and the main topic corresponds to
a topic with sub-topics, we now look for and return content for a
sub-topic if found.

With this patch, `hg help internals.X` now works. hgweb does not yet
render sub-topics, however.
2015-12-13 11:19:55 -08:00