Commit Graph

25639 Commits

Author SHA1 Message Date
Matt Mackall
3e2882b908 http2: mark experimental and developer options 2015-06-25 17:48:43 -05:00
Matt Mackall
2c7ca511c2 bookmarks: mark internal-only config option 2015-06-25 17:47:32 -05:00
Matt Mackall
647579e3af filemerge: mark internal-only config option 2015-06-25 17:46:55 -05:00
Matt Mackall
694178b7ed profiler: mark developer-only config option 2015-06-25 17:46:29 -05:00
Matt Mackall
48e65fe108 debugger: mark developer-only option
(and rearrange comment)
2015-06-25 17:45:49 -05:00
Matt Mackall
da38b28f4f commandserver: mark developer-only logging option 2015-06-25 17:44:15 -05:00
Matt Mackall
e2fb109462 generaldelta: mark experimental reordering option 2015-06-25 17:43:52 -05:00
Matt Mackall
7c02d2b4b4 bundlerepo: mark internal-only config variable 2015-06-25 17:43:24 -05:00
Matt Mackall
49af250493 win32text: mark deprecated extension option deprecated 2015-06-25 17:42:45 -05:00
Matt Mackall
ef6c4dec08 transplant: mark some undocumented options deprecated 2015-06-25 17:42:09 -05:00
Matt Mackall
06c4019bce mq: tweak config reading to make check-config happy
The not-really-a-bool handling here upsets the type checker.
2015-06-25 17:41:40 -05:00
Matt Mackall
e8ae5150ee patchbomb: make sure all users of smtp.verifycert agree on the default 2015-07-17 13:41:07 -05:00
Matt Mackall
65f1e11a48 patchbomb: mark ancient option deprecated
This just exists for backwards compatibility with the earliest
versions of patchbomb.
2015-06-25 17:38:14 -05:00
Matt Mackall
f9425f2260 histedit: mark defaultrev option experimental 2015-06-25 17:37:35 -05:00
Gregory Szorc
2768272919 changegroup: compute seen files as changesets are added (issue4750)
Before this patch, addchangegroup() would walk the changelog and compute
the set of seen files between applying changesets and applying
manifests. When cloning large repositories such as mozilla-central,
this consumed a non-trivial amount of time. On my MBP, this walk takes
~10s. On a dainty EC2 instance, this was measured to take ~125s! On the
latter machine, this delay was enough for the Mercurial server to
disconnect the client, thinking it had timed out, thus causing a clone
to abort.

This patch enables the changelog to compute the set of changed files as
new revisions are added. By doing so, we:

* avoid a potentially heavy computation between changelog and manifest
  processing by spreading the computation across all changelog additions
* avoid extra reads from the changelog by operating on the data as it is
  added

The downside of this is that the add revision callback does result in
extra I/O. Before, we would perform a flush (and subsequent read to
construct the full revision) when new delta chains were created. For
changelogs, this is typically every 2-4 revisions. Using the callback
guarantees there will be a flush after every added revision *and* an
open + read of the changelog to obtain the full revision in order to
read the added files. So, this increases the frequency of these
operations by the average chain length. In the future, the revlog
should be smart enough to know how to read revisions that haven't been
flushed yet, thus eliminating this extra I/O.

On my MBP, the total CPU times for an `hg unbundle` with a local
mozilla-central gzip bundle containing 251,934 changesets and 211,065
files did not have a statistically significant change with this patch,
holding steady around 360s. So, the increased revlog flushing did not
have an effect.

With this patch, there is no longer a visible pause between applying
changeset and manifest data. Before, it sure felt like Mercurial was
lethargic making this transition. Now, the transition is nearly
instantaneous, giving the impression that Mercurial is faster. Of course,
eliminating this pause means that the potential for network disconnect due
to channel inactivity during the changelog walk is eliminated as well.
And that is the impetus behind this change.
2015-07-18 10:57:20 -07:00
Gregory Szorc
a60875d3fb revlog: add support for a callback whenever revisions are added
A subsequent patch will add a feature that performs iterative
computation as changesets are added from a changegroup. To facilitate
this type of processing in a generic manner, we add a mechanism for
calling a function whenever a revision is added via revlog.addgroup().

There are potential performance concerns with this callback, as using it
will flush the revlog after every revision is added.
2015-07-18 10:29:37 -07:00
Laurent Charignon
f9a0bb5c34 crecord: throws error instead of crashing for large diffs
Before this patch, crecord was crashing for large diffs
(30k lines on my laptop). This patch catches the exception raised in that case
and use the error reporting mechanism introduced in the previous patch for
notifying the user of the issue. It is not possible to add a test for that for
now as we don't yet have full blown ui tests for the curses interface.
2015-07-17 13:44:01 -07:00
Laurent Charignon
678b69749a crecord: add error reporting for failure in curses interface initialization
Before this patch, we couldn't report to the user any error that occurred:
- after we enabled the curses interface but
- before the interface is set up and drawn
This patch, provides a way to set errors that happens during the initialization
of the interface and log them once the curses interface has been displayed.
2015-07-17 13:41:17 -07:00
Yuya Nishihara
f7a6661b37 revset: parse nullary ":" operator as "0:tip"
This is necessary for compatibility with the old-style parser that will be
removed by future patches.
2015-07-05 12:15:54 +09:00
Yuya Nishihara
6cb504f763 parser: take suffix action if no infix action is defined
If no infix action is defined, a suffix action isn't ambiguous, so it should
be taken no matter if the next token can be an operand. This is exactly the
same flow as prefix/primary handling.

This change has no effect now because all suffix tokens have infix actions.
2015-07-06 22:01:41 +09:00
Yuya Nishihara
43ae52143a parser: reorder infix/suffix handling to be similar to prefix/primary flow
It can be exactly the same flow as the prefix/primary handling. A suffix
action is accepted only if the next token never starts new term.
2015-07-06 21:55:55 +09:00
Yuya Nishihara
cdaa060788 parser: resolve ambiguity where both prefix and primary actions are defined
If both actions are defined, a primary-expression action is accepted only if
the next token never starts new term. For example,

  parsed as primary expression:
  ":"   # next token 'end' has no action
  "(:)" # next token ')' has no action
  ":+y" # next token '+' is infix operator

  parsed as prefix operator:
  ":y"  # next token 'y' is primary expression
  ":-y" # next token '-' is prefix operator

This is mostly the same resolution as the infix/suffix rules.
2015-07-05 12:09:27 +09:00
Yuya Nishihara
b4caf94446 parser: separate actions for primary expression and prefix operator
This will allow us to define both a primary expression, ":", and a prefix
operator, ":y". The ambiguity will be resolved by the next patch.

Prefix actions in elements table are adjusted as follows:

  original prefix      primary  prefix
  -----------------    -------- -----------------
  ("group", 1, ")") -> n/a      ("group", 1, ")")
  ("negate", 19)    -> n/a      ("negate", 19)
  ("symbol",)       -> "symbol" n/a
2015-07-05 12:02:13 +09:00
Pierre-Yves David
b06e4ae06e changelog: update read pending documentation
The pending index contains a full copy of the index + in-transaction data. We
replace "extend" with "overwrite" to make this clearer.
2015-07-17 15:53:56 +02:00
Matt Harbison
400240f7c1 extdiff: add support for subrepos
Git and svn subrepo support is incomplete, because they don't support archiving
the working copy.
2012-07-15 12:43:10 -04:00
Matt Harbison
6579c8c6d9 extdiff: use archiver to take snapshots of committed revisions
This is the last step before supporting extdiff -S.  It maintains the existing
behavior of diffing the largefile standins instead of the largefiles themselves.
Note however that the standins are not updated immediately upon modification, so
uncommitted largefile changes are ignored, as they previously were, even with
the diff command.
2012-07-11 20:48:51 -04:00
Matt Harbison
66766c7b03 largefiles: allow the archiving of largefiles to be disabled
There are currently no users of this, but it is a necessary step before
converting extdiff to use archive.  It may be useful to add an argument to
extdiff in the future and allow largefiles to be diffed, but archiving
largefiles can have significant overhead and may not be very diffable, so
archiving them by default seems wrong.

It is a mystery to me why the lfstatus attribute needs to be set on the
unfiltered repo.  However if it is set on the filtered repo instead (and the
filtered repo is passed to the original command), the lfstatus attribute is
False in the overrides for archival.archive() and hgsubrepo.archive() when
invoking the archive command.  This smells like the buggy status behavior (see
9fc565fa1621, which was reverted in e1574a4a2cad).  Neither the status nor
summary commands have this weird behavior in their respective overrides.
2015-07-11 23:26:33 -04:00
Yuya Nishihara
83b3c48a90 parsers: fix buffer overflow by invalid parent revision read from revlog
If revlog file is corrupted, it can have parent pointing to invalid revision.
So we should validate it before updating nothead[], phases[], seen[], etc.
Otherwise it would cause segfault at best.

We could use "rev" instead of "maxrev" as upper bound, but I think the explicit
"maxrev" can clarify that we just want to avoid possible buffer overflow
vulnerability.
2015-07-16 23:36:08 +09:00
Laurent Charignon
e2ba5b2bbc histedit: mark temporary commits as obsolete when allowed to
Before this patch, we were stripping temporary commits at the end of a histedit
whether it was successful or not. If we can create obs markers, we should
create them instead of stripping because it is faster and safer.
2015-07-16 11:12:15 -07:00
Laurent Charignon
5d5716b606 histedit: minor refactoring of createmarkers check
We use a variable to store whether or not we can create obsolescence markers.
It makes the patch series more readable as we are going to reuse this
values in other places in the function.
2015-07-16 11:17:37 -07:00
Laurent Charignon
ea68db323a crecord: fix issue when backgrounding editor would leave artefact
Before this patch:
- if a user was entering a commit message after having ran the curses
interface
- and then uses ctrl-z, followed by fg to put the editor in the
background/foreground
- then the curses interface would leave artefact on the screen of
the editor, making entering the commit message a difficult task

This happened because ncurses registers a signal handler for SIGTSTP and
does not restore the original signal handler after running.
More info at:
http://stackoverflow.com/questions/31440392/
curses-wrapper-messing-up-terminal-after-background-foreground-sequence/
31441709#31441709

This patch restores the original value of the signal handler after
running the curses interface and therefore fixes this issue.
It don't know how to add a test for this issue, I tested the scenario
above manually and it works correctly with the patch.
2015-07-15 20:39:23 -07:00
FUJIWARA Katsunori
a8288b7afa censor: make various path forms available like other Mercurial commands
Before this patch, censored file should be exactly "a path relative to
repository root" regardless of current working directory, because "hg
censor" passes "path" to "repo.file()" directly without any
preparations.

To make various path forms available like other Mercurial commands,
this patch gets a target file path in the way of "hg parents FILE".

Getting "wctx" is relocated to reuse "wctx" for efficiency.
2015-07-17 00:22:16 +09:00
Eugene Baranov
afafa68827 convert: use 'default' for specifying branch name in branchmap (issue4753)
A fix for issue2653 with f5abbf51a76e introduced a discrepancy how default
branch should be denoted when converting with branchmap from different SCM.
E.g. for Git and Mercurial you need to use 'default' whilst for Perforce and
SVN you had to use 'None'. This changeset unifies 'default' for such purposes
whilst falling back to 'None' when no 'default' mapping specified.
2015-07-14 14:40:56 +01:00
Yuya Nishihara
718c23ab58 parser: extract function that tests if next token may start new term
Future patches will separate primary expression and prefix operator actions.
This function will be used to resolve ambiguity of them.

This is a step to remove the old-style revexpr parser. We need both ":" and
":y" operators for backward compatibility.
2015-07-05 11:54:14 +09:00
Yuya Nishihara
c84ce8d445 parser: factor out function that parses right-hand side of prefix/infix ops
These two had common pattern. The significant difference was just a result
expression:

  prefix: (op-name, rhs)
  infix:  (op-name, lhs, rhs)
2015-07-05 18:09:15 +09:00
Yuya Nishihara
8905d3395c parser: remove unused parameter 'pos' from _match()
This backs out 58030471e557. The issue spotted by that changeset was addressed
earlier by a50a014eb0ba.
2015-07-05 17:50:35 +09:00
Yuya Nishihara
4645c24be5 parser: fill invalid infix and suffix actions by None
This can simplify the expansion of (prefix, infix, suffix) actions.
2015-07-05 11:17:22 +09:00
Yuya Nishihara
b677e35b5b parser: add comment about structure of elements to each table 2015-07-05 11:06:58 +09:00
FUJIWARA Katsunori
3894a2e107 shelve: omit incorrect 'commit' suggestion at 'hg shelve -i'
Before this patch, 'hg shelve -i' under non-interactive mode suggests
'use commit instead', and it obviously incorrect, because what user
wants to do isn't 'commit' but 'shelve'.

To omit incorrect 'commit' suggestion at 'hg shelve -i', this patch
specifies 'None' for 'cmdsuggest' argument of 'cmdutil.dorecord()'.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
a26b3feac9 record: omit meaningless 'qrefresh' suggestion at 'hg qrefresh -i'
Before this patch, 'hg qrefresh -i' under non-interactive mode
suggests 'use qrefresh instead', and it obviously meaningless.

To omit meaningless 'qrefresh' suggestion at 'hg qrefresh -i', this
patch specifies 'None' for 'cmdsuggest' argument of 'cmdutil.dorecord()'.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
b6717eba7b record: omit meaningless 'qnew' suggestion at 'hg qnew -i'
Before this patch, 'hg qnew -i' under non-interactive mode suggests
'use qnew instead', and it obviously meaningless.

To omit meaningless 'qnew' suggestion at 'hg qnew -i', this patch adds
internal function '_qrecord()' and specifies 'cmdsuggest' for each of
'qrecord' and 'qnew' separately.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
b3a7702a57 record: omit meaningless 'commit' suggestion at 'hg commit -i'
Before this patch, 'hg commit -i' under non-interactive mode suggests
'use commit instead', and it obviously meaningless.

This patch makes 'record.record'()' examine 'ui.interactive()' and
show suggestion by itself before calling 'commands.commit()'.

This allows 'commands.commit()' to specify 'None' for 'cmdsuggest'
argument of 'cmdutil.dorecord()' to omit meaningless 'commit'
suggestion at 'hg commit -i'.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
10e6e169f7 cmdutil: allow callers of cmdutil.dorecord to omit suggestion
Interactive committing under non-interactive mode shows command
suggestion, but sometimes it is meaningless.

  command      suggestion usability
  ------------ ---------- -----------
  record       commit
  commit -i    commit     meaningless
  qrecord      qnew
  qnew -i      qnew       meaningless
  qrefersh -i  qrefresh   meaningless
  shelve -i    commit     incorrect
  ------------ ---------- -----------

This patch allows callers of 'cmdutil.dorecord()' to omit meaningless
suggestion by passing None or so for 'cmdsuggest' argument of it.

This is a preparation for subsequent patches, which fix each
suggestion issues above.
2015-07-15 03:43:16 +09:00
Anton Shestakov
f8c9284f5c spartan: don't drop current revision in log/graph links
Just to be consistent with log and shortlog links, graph links should have a
revision context too. And the same goes for the graph page, where it's log and
shortlog links that should have context.
2015-07-12 01:51:01 +08:00
Matt Mackall
5e9adcf8df hgk: tweak doc format for path option
This lets the config checker see it.
2015-06-25 17:37:14 -05:00
Matt Mackall
0dd375ec19 acl: mark deprecated config option
This option has been undocumented since day 0.
2015-06-25 17:36:46 -05:00
Matt Mackall
92ac7a79d1 gpg: mention undocumented options 2015-06-25 17:35:57 -05:00
Matt Mackall
9b5bba3207 check-config: add config option checker
This script scans files for lines that look like either ui.config
usage or config variable documentation. It then ensures:

- ui.config calls for each option agree on types and defaults
- every option appears to be mentioned in documentation

It doesn't complain about devel/experimental options and allows
marking options that are not intended to be public.

Since we haven't been able to come up with a good scheme for
documenting config options at point of use, this will help close the
loop of making sure all options that should be documented are.
2015-06-25 17:34:53 -05:00
Matt Mackall
9573c557ad bookmarks: clear active bookmark on non-linear update 2015-07-14 18:50:20 -05:00
Eugene Baranov
39327b5b56 convert: unescape Perforce-escaped special characters in filenames 2015-07-14 16:23:57 +01:00