Commit Graph

15982 Commits

Author SHA1 Message Date
Augie Fackler
f7dec33abe httppeer: do less splitting on httpheader value
We only care about the first value split off, so only split off the first
value.
2016-03-11 11:24:50 -05:00
Anton Shestakov
245ded8e7d streamclone: specify unit for ui.progress when handling data 2016-03-11 22:28:27 +08:00
Anton Shestakov
e850090773 similar: specify unit for ui.progress when operating on files 2016-03-11 22:29:20 +08:00
Anton Shestakov
edb97f0e4a verify: specify unit for ui.progress when checking files 2016-03-11 20:18:41 +08:00
Anton Shestakov
e4ad4cc290 repair: specify unit for ui.progress in rebuildfncache() 2016-03-11 20:44:40 +08:00
Anton Shestakov
9c0d085179 repair: use 'rebuilding' progress topic in rebuildfncache() 2016-03-11 20:39:29 +08:00
Yuya Nishihara
823c900008 templater: make label() just fail if ui object isn't available
Silent failure hides bugs and makes it harder to track down the issue. It's
worse than raising exception.

In future patches, I plan to sort out template functions that require 'ui',
'ctx', 'fctx', etc. so that incompatible functions are excluded and the doc can
say in which context these functions are usable.

  @templatefunc('label', requires=('ui',))
  def label(context, mapping, args):
      ...
2016-03-09 23:59:26 +09:00
Nathan Goldbaum
c0c761b27a pushoperation: fix language issues in docstring 2016-03-10 17:31:38 -06:00
Jun Wu
df2c932cf1 serve: add chdir command for --daemon-postexec
For chgserver, it probably needs a chdir to /. This patch adds chdir command
support for --daemon-postexec so chg client can make use of it.
2016-03-09 01:17:02 +00:00
Jun Wu
704e54e1c7 serve: accept multiple values for --daemon-postexec
The next patch will add another postexec command: chdir, which can be used
together with unlink. This patch changes the option type of --daemon-postexec
from string to list to accept multiple commands. The error message of invalid
--daemon-postexec value is also changed to include the actual invalid value.
2016-03-09 02:07:40 +00:00
Matt Mackall
6d2484af42 merge with stable 2016-03-11 15:24:27 -06:00
FUJIWARA Katsunori
13e7cbee4b fileset: replace predicate by filesetpredicate of registrar (API)
To make all built-in predicates be known to hggettext, loading
built-in predicates by loadpredicate() should be placed before fixing
i18nfunctions but after all of predicate decorating.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
f997d054b1 registrar: add filesetpredicate to mark a function as fileset predicate
filesetpredicate is used to replace fileset.predicate in subsequent
patch.

This patch also adds loadpredicate() to fileset, because this
combination helps to figure out how the name of "status caller" (or
"existing caller") predicate is put into _statuscallers (or
_existingcallers).

Listing up loadpredicate() in dispatch.extraloaders causes implicit
loading fileset predicate functions at loading (3rd party) extension.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
e8fc6a5935 registrar: remove useless base classes (API)
Previous patches make these classes useless by removing classes
derived from them.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
bd921cd006 revset: remove useless extpredicate class (API)
Previous patch makes this classes useless by replacing it with
revsetpredicate of registrar.

BTW, extpredicate itself has already been broken by that patch,
because revsetpredicate of registrar doesn't have compatibility with
original predicate (derived from funcregistrar of registrar), in fact.
2016-03-11 04:14:54 +09:00
timeless
c4098a81cc debuginstall: convert to formatter
commit editor now reports its editor
default template is now reported

a broken vi editor (vi not in path) is still not considered a problem (!!)
2016-03-09 18:58:51 +00:00
Augie Fackler
af1601947d wireproto: make iterbatcher behave streamily over http(s)
Unfortunately, the ssh and http implementations are slightly different
due to differences in their _callstream implementations, which
prevents ssh from behaving streamily. We should probably introduce a
new batch command that can stream results over ssh at some point in
the near future.

The streamy behavior of batch over http(s) is an enormous win for
remotefilelog over http: in my testing, it's saving about 40% on file
fetches with a cold cache against a server on localhost.
2016-03-01 18:41:43 -05:00
Augie Fackler
b6dda02542 setdiscovery: use iterbatch interface instead of batch
It's a little more concise, and gives us some simple test coverage.
2016-03-01 17:44:41 -05:00
Augie Fackler
19d5a9a428 peer: add an iterbatcher interface
This is very much like ordinary batch(), but it will let me add a mode
for batch where we have pathologically large requests which are then
handled streamily. This will be a significant improvement for things
like remotefilelog, which may want to request thousands of entities at
once.
2016-03-01 18:39:25 -05:00
Augie Fackler
44da57a9e4 wireproto: document quirk of _callstream between http and ssh
This tripped me up when trying to use it, so it feels like we should
document this to avoid future pain.
2016-03-02 14:18:43 -05:00
Augie Fackler
13fce12876 peer: raise NotImplementedError for abstract submit() method
Nothing should ever call this submit method directly as it should be
overridden by concrete batcher implementations.
2016-03-01 16:37:56 -05:00
Durham Goode
58ee8fb13a obsolete: fix n^2 marker computation behavior
Previously, if you ran obsolete.createmarkers with a bunch of markers that did
not have successors (like when you do a prune), it encountered a n^2 computation
behavior because the loop would read the changelog (to get ctx.parents()), then
add a marker, in a loop.  Adding a marker invalidated the computehidden cache,
and reading the changelog recomputed it.

This resulted in pruning 150 commits taking 150+ seconds in a large repo.

The fix is to break the reading part of the loop to be separate from the writing
part.
2016-02-04 15:38:04 -08:00
timeless
156f8d111d bdiff: (pure) support array.array arrays (issue5130) 2016-03-08 17:26:12 +00:00
Matt Harbison
3fb00b6ab7 files: don't recurse into subrepos without a path or -S (issue5127)
The 'm.always()' check was needed for when a path to 'sub1' is given, and 'sub1'
contains a subrepo itself.  But that also caused the automatic recursion when no
path was given.  Instead, force -S when printing a subrepo if the subpath is an
exact match (which will unconditionally recurse once in the nested subrepo).
2016-03-06 14:30:34 -05:00
Gregory Szorc
5b47f5a7bd hg: obtain lock when creating share from pooled repo (issue5104)
There are race conditions between clients performing a shared clone
to pooled storage:

1) Clients race to create the new shared repo in the pool directory
2) 1 client is seeding the repo in the pool directory and another goes
   to share it before it is fully cloned

We prevent these race conditions by obtaining a lock in the pool
directory that is derived from the name of the repo we will be
accessing.

To test this, a simple generic "lockdelay" extension has been added.
The extension inserts an optional, configurable delay before or after
lock acquisition. In the test, we delay 2 seconds after lock acquisition
in the first process and 1 second before lock acquisition in the 2nd
process. This means the first process has 1s to obtain the lock. There
is a race condition here. If we encounter it in the wild, we could
change the dummy extension to wait on the lock file to appear instead
of relying on timing. But that's more complicated. Let's see what
happens first.
2016-02-27 18:22:49 -08:00
FUJIWARA Katsunori
4a0bc54a73 doc: remove deprecated option from synopsis of command help
Before this patch, deprecated options below are used in synopsis of
command help, even though they aren't listed up as available options
by default. These might confuse readers.

  - -n (no-op, now) of strip
  - -a/--active of branches
  - -f/--force of merge
2016-03-01 03:28:46 +09:00
Yuya Nishihara
5b1b6151af log: fix order of revisions filtered by multiple OR options (issue5100)
This is the simplest workaround for the issue of the ordering of revset, which
is that the expression "x or y" takes over the ordering specified by the input
set (or the left-hand-side expression.) For example, the following expression

  A & (x | y)

will be evaluated as if

  (A & x) | (A & y)

That's wrong because revset has ordering. I'm going to fix this problem in
the revset module, but that wouldn't fit to stable. So, this patch just works
around the common log cases.

Since this change might have some impact on performance, it is enabled only
if the expression built from log options has ' or ' operation.
2016-02-15 22:46:07 +09:00
Gregory Szorc
038daf0c4c demandimport: add _imp to ignore list
Mozilla is seeing an issue with demand importing of _imp
failing in pkg_resources/__init__.py:fixup_namespace_packages.
It strangely only reproduces when using a modern version of
setuptools/pip in certain scenarios. Adding _imp to the demand import
ignore list seems to make the problem go away.
2016-02-25 22:35:11 -08:00
Pierre-Yves David
c93d28cfa7 unionrepo: properly handle hidden linkrev in revlog (issue5070)
The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. That logic was done from a repoview and
obsolescence marker affecting bundled changeset could lead to a crash. We now
ensure we operate on unfiltered repository.
2016-02-22 23:36:04 +01:00
Pierre-Yves David
55efb3cd6d bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 23:34:54 +01:00
Pierre-Yves David
7443f70cc2 bundlerepo: properly handle hidden linkrev in filelog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundlerepo filerev. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 18:35:40 +01:00
Pierre-Yves David
afc2550500 revert: properly revert to ancestor of p2 during merge (issue5052)
During merge, added (from one perspective) file can be reported as "modified".
To work around that, revert was testing if modified file were present in the
parent manifest and marking them as "added" in this case. However, we should be
checking against the target revision manifest instead. Otherwise see file as
"newly added" even if they exist in the target revision.

That revert behavior regressed in 3657ae7519b7.
2016-02-23 11:41:47 +01:00
Thomas Arendsen Hein
cd14774b5e help: hg.intevation.de is new primary name of hg.intevation.de (and new cert)
Adjust the examples (prefix and hostfingerprints) in help/config.txt

https://hg.intevation.de/ is now served with a new certificate that is signed
by a commercial CA, so all nearly all browsers will accept it automatically.

Listing both names, hg.intevation.de and hg.intevation.org, in the section
[hostfingerprints] allows using both without configuring web.cacerts and
without changing existing https URLs in the [paths] section.
2016-02-01 12:36:28 +01:00
Rainer Woitok
da96edeb0a doc: correct example concerning "hg purge" alias in man page "hgrc.5"
The "hg purge" alias as currently described in "hgrc.5" only works, if
the caller's current working directory is identical to the repository's
root directory.

This patch slightly modifies the example by adding an empty pattern as a
file argument to the "hg status" command, thus forcing this command to
list the affected files relative to the current directory.
2016-02-20 17:32:26 +01:00
Matt Harbison
0fa9e4d8ca fileset: fix copy/paste in eol() error message 2016-02-18 22:32:18 -05:00
Yuya Nishihara
ec5b4c4575 help: update template examples to use reST literal syntax
This should prevent processing backslashes as reST syntax elements. Before
this patch, '\' was lost in HTML and man pages.
2016-02-05 23:17:07 +09:00
Yuya Nishihara
02e214117d ui: fix crash by non-interactive prompt echo for user name
Since we've dropped a str cast at write() by 7dbd3db608c5, ui.prompt() should
convert default to '' if it is None. Otherwise, write() would fail with
"TypeError: object of type 'NoneType' has no len()".

This patch includes the tests for both interactive and non-interactive cases
because "ui.askusername" was never tested.
2016-02-06 20:43:20 +09:00
Yuya Nishihara
6b8c99a6d3 revset: flatten chained 'list' operations (aka function args) (issue5072)
Internal _matchfiles() function can take bunch of arguments, which would
lead to a maximum recursion depth error. This patch avoids the excessive
stack use by flattening 'list' nodes beforehand.

Since getlist() no longer takes a nested 'list' nodes, _parsealiasdecl()
also needs to flatten argument list, "aliasname($1, $2, ...)".
2016-02-02 23:49:49 +09:00
André Sintzoff
7d205ba10a help: fix typo in backgroundclose documentation 2016-02-05 19:40:57 +01:00
Siddharth Agarwal
08f24f1f67 graft: don't preserve most extra fields
This backs out changeset 9aa13e9feec8.

See the previous patch for why we're doing this.
2016-02-03 09:06:52 -08:00
Siddharth Agarwal
c8ebb66630 amend: don't preserve most extra fields
This backs out changeset fd794e885a9e9.

There are some extra fields that absolutely should not be preserved, like the
convert_revision field introduced by the convert and hgsubversion extensions.
The problem with extensions blacklisting certain extra fields is that they
might not be enabled at the time the amend is performed.

In the long run we probably want separately marked transferable and
non-transferable extra fields, but for now restore the old Mercurial 3.6
behavior.
2016-02-03 08:59:46 -08:00
Yuya Nishihara
9d11e83caf osutil: do not abort loading pure module just because libc has no recvmsg()
On Solaris, recvmsg() is provided by libsocket.so. We could try hard to look
for the library which provides 'recvmsg' symbol, but it would make little sense
now since recvfds() won't work anyway on Solaris. So this patch just disables
_recvmsg() on such platforms.

Thanks to FUJIWARA Katsunori for spotting this problem.
2016-02-03 22:47:27 +09:00
Yuya Nishihara
ce2c3d9c16 osutil: disable compilation of recvfds() on unsupported platforms
It appears that Solaris doesn't provide CMSG_LEN(), msg_control, etc. As
recvfds() is only necessary for chg, this patch just drops it if CMSG_LEN
isn't defined, which is the same workaround as Python 3.x.

https://hg.python.org/cpython/rev/c64216addd7f#l7.33
2016-02-02 20:56:48 +09:00
Martin von Zweigbergk
80df9c6505 verify: recover lost freeing of memory
In 0413f674179e (verify: move file cross checking to its own function,
2016-01-05), "mflinkrevs = None" was moved into function, so the
reference was cleared there, but the calling function now held on to
the variable. The point of clearing it was presumably to free up
memory, so let's move the clearing to the calling function where it
makes a difference. Also change "mflinkrevs = None" to "del
mflinkrevs", since the comment about scope now surely is obsolete.
2016-01-31 00:31:55 -08:00
FUJIWARA Katsunori
127b880d6a doc: itemize text blocks to increase readability in HTML format
Before this patch, text blocks changed in this patch are shown as just
continuous text blocks like below in HTML format.

    Global configuration like the username setting is typically put into:

    %USERPROFILE%\mercurial.ini
    $HOME/.hgrc

This patch itemizes these text blocks to increase readability in HTML
format.

    Global configuration like the username setting is typically put into:

    - %USERPROFILE%\mercurial.ini (on Windows)
    - $HOME/.hgrc (on Unix, Plan9)

Like as other platform sensitive container-ed text blocks, this patch
also adds explicit "on PLATFORM" information to each items for
readability in HTML format, even though output of "hg help config" on
command line seems a little redundant. For example, on Unix:

    Global configuration like the username setting is typically put into:

    - "$HOME/.hgrc" (on Unix, Plan9)
2016-02-01 22:14:06 +09:00
Yuya Nishihara
c24eb61d0c backout: disable --merge with --no-commit (issue4874)
Because "backout --merge" have to make a commit before merging, it doesn't
work with --no-commit. We could change "backout --merge" to make a merge
commit automatically, and --no-commit to bypass a merge commit, but that
change would be undesirable because:

 a) it's hard to fix bad merges in general
 b) two commits would be created with the same --message

So, this patch simply disables "--merge --no-commit".
2016-01-30 18:00:11 +09:00
Martin von Zweigbergk
86ca76bafe changegroup: fix pulling to treemanifest repo from flat repo (issue5066)
In b89de5ee5b31 (changegroup: don't support versions 01 and 02 with
treemanifests, 2016-01-19), I stopped supporting use of cg1 and cg2
with treemanifest repos. What I had not considered was that it's
perfectly safe to pull *to* a treemanifest repo using any changegroup
version. As reported in issue5066, I therefore broke pull from old
repos into a treemanifest repo. It was not covered by the test case,
because that pulled from a local repo while enabling treemanifests,
which enabled treemanifests on the source repo as well. After
switching to pulling via HTTP, it breaks.

Fix by splitting up changegroup.supportedversions() into
supportedincomingversions() and supportedoutgoingversions().
2016-01-27 09:07:28 -08:00
Siddharth Agarwal
bfbbb007c7 merge: don't try to merge subrepos twice (issue4988)
In my patch series ending with rev c3f2eede6938 I switched most change/delete
conflicts to be handled at the resolve layer. .hgsubstate was the one file that
we weren't able to handle, so we kept the old code path around for it.

The old code path added .hgsubstate to one of the other lists as the user
specifies, including possibly the 'g' list.

Now since we did this check after converting the actions from being keyed by
file to being keyed by action type, there was nothing that actually removed
.hgsubstate from the 'cd' or 'dc' lists. This meant that the file would
eventually make its way into the 'mergeactions' list, now freshly augmented
with 'cd' and 'dc' actions.

We call subrepo.submerge for both 'g' actions and merge actions.

This means that if the resolution to an .hgsubstate change/delete conflict was
to add it to the 'g' list, subrepo.submerge would be called twice. It turns out
that this doesn't cause any adverse effects on Linux due to caching, but
apparently breaks on other operating systems including Windows.

The fix here moves this to before we convert the actions over. This ensures
that it .hgsubstate doesn't make its way into multiple lists.

The real fix here is going to be:
(1) move .hgsubstate conflict resolution into the resolve layer, and
(2) use a real data structure for the actions rather than shuffling data around
    between lists and dictionaries: we need a hash (or prefix-based) index by
    file and a list index by action type.

There's a very tiny behavior change here: collision detection on
case-insensitive systems will happen after this is resolved, not before. I think
this is the right change -- .hgsubstate could theoretically collide with other
files -- but in any case it makes no practical difference.

Thanks to Yuya Nishihara for investigating this.
2016-01-29 14:19:29 -08:00
Nathan Goldbaum
2d19c5b8f4 bookmarks: improve documentation for --rev option 2016-01-27 16:16:38 -06:00
Siddharth Agarwal
baf8fd47c7 merge: undocument checkunknown and checkignored configs for 3.7
We've discovered an issue with this flag during certain kinds of rebases. When:

(1) we're rebasing while currently on the destination commit, and
(2) an untracked or ignored file F is currently in the working copy, and
(3) the same file F is in a source commit, and
(4) F has different contents in the source commit,

then we'll try to merge the file rather than overwrite it.

An earlier patch I sent honored the options for these situations as well.
Unfortunately, rebases go through the same flow as the old, deprecated 'hg
merge --force'. We'd rather not make any changes to 'hg merge --force'
behavior, and there's no way from this point in the code to figure out whether
we're in 'hg rebase' or 'hg merge --force'.

Pierre-Yves David and I came up with the idea to split the 'force' flag up into
'force' for rebases, and 'forcemerge' for merge. Since this is a very
disruptive change and we're in freeze mode, simply undocument the options for
this release so that our hands aren't tied by BC concerns. We'll redocument
them in the next release.
2016-01-27 12:33:07 -08:00