Commit Graph

20344 Commits

Author SHA1 Message Date
Pulkit Goyal
4a3c34a274 py3: handle keyword arguments correctly in help.py
Differential Revision: https://phab.mercurial-scm.org/D1632
2017-12-10 04:46:39 +05:30
Pulkit Goyal
ca041d8604 py3: handle keyword arguments correctly in exchange.py
Differential Revision: https://phab.mercurial-scm.org/D1631
2017-12-10 04:46:25 +05:30
Pulkit Goyal
616684d4c9 py3: handle keyword arguments correctly in dispatch.py
Differential Revision: https://phab.mercurial-scm.org/D1630
2017-12-10 04:46:13 +05:30
Pulkit Goyal
56f56fc9fd py3: handle keyword arguments correctly in context.py
Differential Revision: https://phab.mercurial-scm.org/D1629
2017-12-10 04:45:56 +05:30
Pulkit Goyal
b642a8adf8 py3: handle keyword arguments correctly in commands.py
Differential Revision: https://phab.mercurial-scm.org/D1628
2017-12-10 04:45:41 +05:30
Pulkit Goyal
cb53297841 py3: handle keyword arguments correctly in color.py
Differential Revision: https://phab.mercurial-scm.org/D1627
2017-12-10 04:45:27 +05:30
Pulkit Goyal
217c0c34ad py3: handle keyword arguments correctly in cmdutil.py
Differential Revision: https://phab.mercurial-scm.org/D1626
2017-12-10 04:45:10 +05:30
Pulkit Goyal
2e95019c37 py3: handle keyword arguments correctly in archival.py
Differential Revision: https://phab.mercurial-scm.org/D1625
2017-12-10 04:43:41 +05:30
Pulkit Goyal
b53f06128c remotenames: rename related file and storage dir to logexchange
This patch renames remotenames.py to logexchange.py, test-remotenames.t to
test-logexchange.t. Also this patch renames the directory in which the data is
stored from remotenames to logexchange. After this patch, data about bookmarks
and branches from a server we pull is stored in
`.hg/logexchange/(bookmarks|branches)` files.

Thanks to smf for the suggestion.

Differential Revision: https://phab.mercurial-scm.org/D1607
2017-12-07 00:26:45 +05:30
Boris Feld
d8aa8e36d8 upgrade: add a 'redeltafullall' mode
We add a new mode for delta recomputation, when selected, each full text will
go through the full "addrevision" mechanism again. This is slower than
"redeltaall" but this gives the opportunity for extensions to trigger special
logic. For example, the lfs extensions can decide to promote some revision to
lfs storage during the upgrade.
2017-12-07 20:27:03 +01:00
Boris Feld
84c9e6582a upgrade: use actual filelog to convert filelog
Extensions can add extra logic related to the config, so we must use the actual
class. The path used needs minimal transformation for this to work.
2017-12-07 22:37:18 +01:00
Boris Feld
b70b33bf91 upgrade: more standard creation of the temporary repository
By using the standard path to create a repository we fill some hole in the
current initialization process. The one who triggered this changeset was the
lack of extensions initialization.
2017-12-07 18:56:10 +01:00
Boris Feld
826e838aa1 upgrade: use the repository 'ui' as the base for the new repository
The `repo.baseui` contains all the configuration but the one specific to the
repository (so it can be used when dealing with local peer and sub-
repository). However, we need the repository config to be taken into account
when doing the upgrade. Otherwise, the upgrade related config that exists in
the repository config won't be taken into account when performing the update.
A buggy and surprising behavior.

We had to work around protection set around `repo.ui.copy` since we are an
uncommon case.
2017-12-07 18:55:35 +01:00
Boris Feld
9f250d48c5 upgrade: register compression as a format variants
Compression is a promising vector for speedup, let us make it easier to check
the compression used and upgrade existing repository.
2017-12-07 16:50:48 +01:00
Boris Feld
25342bccd7 debugformat: handle non-boolean value for variant 2017-12-07 16:49:24 +01:00
Boris Feld
c2382c14ab debugformat: update label depending on value difference
The new label highlight areas where the repo format differs from current
config or default. This should help people spot area where a repository
mismatch with the expected state.
2017-12-07 16:12:32 +01:00
Boris Feld
5ef878754c debugformat: add data about the config when verbose
In verbose mode, the command also displays the current configuration choice
for the variant and the global Mercurial default for it.
2017-12-07 16:05:20 +01:00
Boris Feld
3b270be25b debugformat: add a 'debugformat' command
The command displays basic data about all format variants registered for repo
upgrades. This gives a quick way to peek into a repository format.

The 'fm.write()' calls are very independent because more data will be added in
later changeset. Having more separate call make the later patch clearer.
2017-12-07 16:19:46 +01:00
Boris Feld
dd552bcef6 upgrade: rename 'removecldeltachain' to 'plain-cl-delta'
The new naming is more descriptive of a "state" while the older one was more
about "action". I'm looking into command exposing more of data about the state
of the repository so "state" oriented work better there.

The key has not been made public anywhere outside the debug area so it is fine
to update it.
2017-12-07 15:55:59 +01:00
Pulkit Goyal
3e6a480b54 clone: add support for storing remotenames while cloning
If `experimental.remotenames` is set to True, we store the remotenames in case
of `hg pull`. This patch adds that support to clone command also.

Differential Revision: https://phab.mercurial-scm.org/D1601
2017-12-06 06:40:27 +05:30
Jun Wu
4ca48aa8cc revset: use phasecache.getrevset to calculate public()
Other revsets like secret(), draft(), _nonpublic() are using
phasescache.getrevset already. The latter is more efficient after D1606.
So let's migrate the public() revset function too.

Tested using:

  $ hg debugshell --hidden --cwd hg-committed`
  In [1]: %timeit len(repo.revs('public()'))

* Before D1606: 10 loops, best of 3: 22.5 ms per loop
* Before this change, after D1606: 10 loops, best of 3: 28.6 ms per loop
* After this change: 10 loops, best of 3: 20.2 ms per loop

Therefore `public()` revset becomes even slightly faster after the data
structure change by D1606. A similar performance win could also be observed
on a large repo.

A side effect is `phasecache.getrevset` needs to take a `subset` parameter.
That was added with a default value so it won't cause BC issues.

Differential Revision: https://phab.mercurial-scm.org/D1620
2017-12-08 14:20:34 -08:00
Matthieu Laneuville
eb58359793 patch: move part of tabsplitter logic in _inlinediff
It cannot be entirely moved within _inlinediff as long as worddiff is
experimental (when turned off, matches is always an empty dict).
2017-12-08 17:20:11 +09:00
Phil Cohen
8364d14980 overlayworkingctx: invalidate the manifest cache when changing parents
This fixes problems noticeable when rebasing several commits into one
destination commit using ``--collapse``. The manifest cache needs to be cleared
each time.

Differential Revision: https://phab.mercurial-scm.org/D1244
2017-12-07 16:07:06 -08:00
Phil Cohen
4a5355ea73 overlayworkingctx: add _compact()
Alas, presence of a key in the cache isn't sufficient evidence that the file
is actually dirty.

Differential Revision: https://phab.mercurial-scm.org/D1243
2017-12-07 16:07:06 -08:00
Phil Cohen
b5b63f89d9 overlayworkingctx: add `tomemctx()`
Differential Revision: https://phab.mercurial-scm.org/D1242
2017-12-07 22:26:07 -08:00
Phil Cohen
bea2c78914 overlayworkingctx: add _auditconflicts to write()
Alas, part of Mercurial's conflict detection (for file<->folder conflicts,
for example) depends on the filesystem. We don't have the filesystem with IMM,
so we have to run these checks ourselves.

Differential Revision: https://phab.mercurial-scm.org/D1241
2017-12-07 16:07:06 -08:00
Phil Cohen
2ec2189e8b overlayworkingctx: inherit from committablectx instead of workingctx
We should find a better name for this context at some point. (mutablememctx?)

Differential Revision: https://phab.mercurial-scm.org/D1240
2017-12-07 16:07:06 -08:00
Phil Cohen
d5ed058435 overlayworkingctx: add a no-op `clearunknown()`
We no longer inherit ``workingctx``'s version, but we also don't need to do
anything anymore.

Differential Revision: https://phab.mercurial-scm.org/D1239
2017-12-07 16:07:06 -08:00
Phil Cohen
b24f3aaa75 overlayworkingctx: add _manifest, files(), added(), removed(), modified()
Differential Revision: https://phab.mercurial-scm.org/D1238
2017-12-07 16:07:06 -08:00
Phil Cohen
993b6df471 rebase: add concludememorynode(), and call it when rebasing in-memory
Differential Revision: https://phab.mercurial-scm.org/D1248
2017-12-07 22:35:43 -08:00
Anton Shestakov
80d803c705 hgweb: rewrite template = A and B or C to be a proper ternary operator 2017-12-08 22:27:14 +08:00
Matthieu Laneuville
b5b163535f patch: catch unexpected case in _inlinediff
If operation is neither 'diff.inserted' or 'diff.deleted', label and token won't
be define. This patch explicitely catches that exception.
2017-12-08 16:54:59 +09:00
Matthieu Laneuville
9b54f9af3b patch: reverse _inlinediff output for consistency 2017-12-08 16:47:18 +09:00
Joerg Sonnenberger
b1f2bd10ac phases: drop the list with phase of each rev, always comput phase sets
Change the C implementation of phasecache.loadphaserevs to provide only
the sets for draft and secret phase as well as the number of revisions
seen.

Change the pure Python implementation of the same functino to compute
the sets instead of the list of phases for each revision.

Change phasecache.phase to check the phase sets and assume public if the
revision is in neither draft nor secret set. This is computationally
slightly more expensive.

Change phasecache.getrevset for public() based queries to compute the
set of non-matching revisions and return the result as filtered
fullreposet. A shortcut is taken when no draft or secret revision
exists.

Bump the module version for the changed interface contract.

Overall, this saves around 16 Bytes per revision whenever the phasecache
is used, for the test case in issue5691 it is around 3MB. getrevset()
for a large repository is around 13% slower here, that seems an
acceptable trade off. Performance impact for phase() should be similar.

Differential Revision: https://phab.mercurial-scm.org/D1606
2017-12-06 15:46:41 +01:00
Joerg Sonnenberger
9c25f296a4 transaction: build changes['revs'] as range instead of a set
Revisions are added consecutively, so a range can easily represent them
in the changes list. This saves around 45 Bytes / revision on 64bit
platforms and reduces the memory footprint of issue5691 by 15MB.

Don't copy changes['revs'] in getobsoleted. Ranges have a very efficient
contains implementation already.

Differential Revision: https://phab.mercurial-scm.org/D1615
2017-12-08 01:23:34 +01:00
Augie Fackler
b3191ab441 ui: add diff.showfunc to tweakdefaults
This is a little risky, as I think we can have some encoding weirdness
crop up. showfunc also isn't the most robust feature, but it's still
often useful context...

Differential Revision: https://phab.mercurial-scm.org/D1610
2017-12-06 16:43:07 -05:00
Augie Fackler
0cf992efc2 ui: add curses interface to tweakdefaults
This was part of the original proposal, and while *I* don't like the
curses interface, most users anecdotally seem to greatly prefer it to
plain text interfaces.

Differential Revision: https://phab.mercurial-scm.org/D1609
2017-12-06 16:42:24 -05:00
Boris Feld
8fc5e92851 push: restrict common discovery to the pushed set
This changeset make use of the ability of the set discovery to only search
common changeset for a subset of the repository. Restricting that search to the
pushed set avoid potential waste of time finding out the status of many
unrelated related revision.

Repository with many heads were especially badly affected by this. Here is an
example of findcommonhead discovery for pushing 11 outgoing changeset on a
repository with tens of thousand of unrelated heads. (discovery run over a ssh
link to localhost).

Before:
    queries: 92
    time:    44.1996s

After:
    queries: 3
    time:    0.6938s

A x63 speedup even with a network link without latency.
2017-12-06 23:33:01 +01:00
Boris Feld
cc076020d2 setdiscover: allow to ignore part of the local graph
Currently, the push discovery first determines the full set of common nodes
before looking into what changesets are outgoing. When pushing a specific
subset, this can lead to pathological situations where we search for the status
of thousand of local heads that are unrelated to the requested pushes.

To fix this, we need to teach the discovery to ignores part of the graph. Most
of the necessary pieces were already in place. This changeset just makes them
available to higher level API and tests them.

Change actually impacting pushes are coming in a later changeset.
2017-12-06 22:44:51 +01:00
Boris Feld
8a1502d6d0 upgraderepo: allow extension to register preserved requirements
Some requirement does not directly result from config and needs more advanced
logic to be preserved. The current example is 'largefiles'. We add a hook
point in the upgrade code so that extensions can handle these cases.

The 'largefiles' extension will use it in the next changeset.
2017-12-07 01:51:54 +01:00
Yuya Nishihara
1d02a603e8 help: do not abort topicmatch() because of unimportable extensions
This is alternative workaround to D1198, originally spotted by the earlier
version of the releasenotes extension.
2017-08-05 23:15:37 +09:00
Yuya Nishihara
6e8c1d0f1a configitems: register 'email.to' and 'patchbomb.to' 2017-10-20 22:25:09 +09:00
Boris Feld
87151ab0b0 exchange: propagate the subfunctions return
The parts generator can return a callback to handle server reply. We should
propagate the return for correctness.
2017-10-19 21:50:14 +02:00
Denis Laxalde
6a72a6393c log: add an assertion about fctx not being None in patch.diff()
As noted in the comment, this should not happen as removed files (the cause of
fctx2 being None) are caught earlier.
2017-10-19 15:06:33 +02:00
Denis Laxalde
daa0a6c266 log: handle removed files with --line-range patterns
I.e. abort when the pattern corresponds to a removed file, as done with bare
file patterns.
2017-10-19 14:55:10 +02:00
Denis Laxalde
40359bfd01 log: disable bare file patterns with --line-range
Currently, specifying both a line-range pattern and a bare file pattern
results in an AND operation whereas we probably want an OR so that bare file
patterns are like a line-range pattern with all lines specified.

So, until this works as expected, we disable this.
2017-10-19 14:12:49 +02:00
Denis Laxalde
21cd66f96c log: switch to FROMLINE:TOLINE syntax for -L/--line-range
This is more consistent with the followlines() revset.
2017-10-19 12:37:26 +02:00
Denis Laxalde
7b3941db14 log: handle binary files in --line-range patterns
When a file is binary patch.trydiff() would yield None for 'hunkrange'. Handle
this case in the hunksfilter() callback.
Add tests with and without diff.git option as binary handling differs
depending on this option's value.
2017-10-18 19:00:33 +02:00
Boris Feld
bd26fb4ef0 config: also gather effect-flags on experimental.evolution
Effect-flags config was in flight while the previous evolve config renaming
was written. Now that both landed, gather effect-flags in
experimental.evolution like the others evolve-related configurations.

Differential Revision: https://phab.mercurial-scm.org/D1197
2017-10-19 17:50:20 +02:00
Boris Feld
b2b964dde1 obsfate: rename obsfate into obsolete in default mapfile
Like the previous patch, replace obsfate by obsolete in default mapfile.

Differential Revision: https://phab.mercurial-scm.org/D1190
2017-10-19 12:33:53 +02:00
Boris Feld
540b37e2a9 obsfate: rename obsfate into obsolete in changeset_printer
Yuja's comment on the original obsfate about how we would translate obsfate
and the recent discussions about exposing users to new concepts and names lead
have led me to think that 'obsfate' should be treated as internal jargon. End-
users should not be aware of obsfate, so we replace 'obsfate' by 'obsolete' in
changeset_printer.

It will be easier to understand for end-users, easier to translate and closer
to the original Evolve obsfate output.

I'm aware it's extremely late in the cycle but I think it's an UX improvement
for the end-users.

Differential Revision: https://phab.mercurial-scm.org/D1189
2017-10-19 12:32:42 +02:00
Paul Morelle
80d72dfb5f sparse-read: ignore trailing empty revs in each read chunk
An empty entry in the revlog may happen for two reasons:
- when the file is empty, and the revlog stores a snapshot;
- when there is a merge and both parents were identical.

`hg debugindex -m | awk '$3=="0"{print}' | wc -l` gives 1917 of such entries
in my clone of pypy, and 113 on my clone of mercurial.

These empty revision may be located at the end of a sparse chain, and in some
special cases may lead to read relatively large amounts of data for nothing.
2017-10-18 15:28:19 +02:00
Martin von Zweigbergk
745cf248e6 registrar: don't i18n ProgrammingError message
Differential Revision: https://phab.mercurial-scm.org/D1188
2017-10-18 22:10:08 -07:00
Martin von Zweigbergk
0975261d97 registrar: move "constant" possiblecmdtypes to class level
While at it, switch to set literal syntax.

Differential Revision: https://phab.mercurial-scm.org/D1187
2017-10-18 22:07:53 -07:00
Augie Fackler
28d451ef21 cmdutil: fix status tersing on Python 3
Differential Revision: https://phab.mercurial-scm.org/D1183
2017-10-18 18:30:02 -04:00
Augie Fackler
a0c006361b configitems: make all regular expressions bytes and not native str
Fixes many tests on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1181
2017-10-18 18:29:00 -04:00
Jun Wu
c0323e0c94 show: move configitems to core
chgserver.py is also checking the config and will get:

  devel-warn: accessing unregistered config item:
  'commands.show.aliasprefix' at:
  mercurial/chgserver.py:109

if the config is not registered.

Differential Revision: https://phab.mercurial-scm.org/D1178
2017-10-18 15:05:03 -07:00
Jun Wu
d0d741d8a7 chgserver: do not treat HG as sensitive environ when CHGHG is set
When `$CHGHG` is set, `$HG` is ignored by the chg client. Removing it from
chg's sensitive environment list would avoid starting up servers
unnecessarily when `$CHGHG` is the same while `$HG` is different.

Differential Revision: https://phab.mercurial-scm.org/D1177
2017-10-18 14:55:39 -07:00
Gregory Szorc
35538a441a fsmonitor: warn when fsmonitor could be used
fsmonitor can significantly speed up operations on large working
directories. But fsmonitor isn't enabled by default, so naive users
may not realize there is a potential to make Mercurial faster.

This commit introduces a warning to working directory updates when
fsmonitor could be used.

The following conditions must be met:

* Working directory is previously empty
* New working directory adds >= N files (currently 50,000)
* Running on Linux or MacOS
* fsmonitor not enabled
* Warning not disabled via config override

Because of the empty working directory restriction, most users will
only see this warning during `hg clone` (assuming very few users
actually do an `hg up null`).

The addition of a warning may be considered a BC change. However, clone
has printed warnings before. Until recently, Mercurial printed a warning
with the server's certificate fingerprint when it wasn't explicitly
trusted for example. The warning goes to stderr. So it shouldn't
interfere with scripts parsing meaningful output.

The OS restriction was on the advice of Facebook engineers, who only
feel confident with watchman's stability on the supported platforms.

.. feature::

   Print warning when fsmonitor isn't being used on a large repository

Differential Revision: https://phab.mercurial-scm.org/D894
2017-10-18 22:57:15 +02:00
Saurabh Singh
8e631c99b7 ui: move request exit handlers to global state
Since the ui objects can be created with the 'load' class method, it
is possible to lose the exit handlers information from the old ui instance. For
example, running 'test-bad-extension.t' leads to this situation where chg
creates a new ui instance which does not copy the exit handlers from the
earlier ui instance. For exit handlers, which are special cases anyways, it
probably makes sense to have a global state of the handlers. This would ensure
that the exit handlers registered once are definitely executed at the end of
the request.

Test Plan:
Ran all the tests without '--chg' option. This also fixes the
'test-bad-extension.t' with the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D1166
2017-10-17 13:20:25 -07:00
Paul Morelle
942b4f2e1a sparse-read: skip gaps too small to be worth splitting
Splitting at too small gaps might not be worthwhile. With this changeset,
we stop considering splitting on too small gaps. The threshold is configurable.
We arbitrarily pick 256K as a default value because it seems "okay".
Further testing on various repositories and setups will be needed to tune it.

The option name is 'experimental.sparse-read.min-gap-size`, and replaces
`experimental.sparse-read.min-block-size` which is not used any more.
2017-10-18 09:07:48 +02:00
Boris Feld
b5ee1a86a9 sparse-read: move from a recursive-based approach to a heap-based one
The previous recursive approach was trying to optimise each read slice to have
a good density. It had the tendency to over-optimize smaller slices while
leaving larger hole in others.

The new approach focuses on improving the combined density of all the reads,
instead of the individual slices. It slices at the largest gaps first, as they
reduce the total amount of read data the most efficiently.

Another benefit of this approach is that we iterate over the delta chain only
once, reducing the overhead of slicing long delta chains.

On the repository we use for tests, the new approach shows similar or faster
performance than the current default linear full read.

The repository contains about 450,000 revisions with many concurrent
topological branches. Tests have been run on two versions of the repository:
one built with the current delta constraint, and the other with an unlimited
delta span (using 'experimental.maxdeltachainspan=0')

Below are timings for building 1% of all the revision in the manifest log using
'hg perfrevlogrevisions -m'. Times are given in seconds. They include the new
couple of follow-up changeset in this series.

delta-span  standard    unlimited
linear-read     922s         632s
sparse-read     814s         566s
2017-10-18 12:53:00 +02:00
Matt Harbison
4856e00f46 subrepo: implement 'unshare' for Mercurial subrepos
I think there's a slight hole here in that a subrepo could be shared, removed
from .hgsub, and then it's not part of context.substate (so not iterated over).
But the push command has the same hole IIRC, and I think removing a subrepo is
an edge case.

The import hack is a copy/paste of subrepo.subrepo().
2017-10-17 22:55:33 -04:00
Matt Harbison
ae7841b944 share: move the implementation of 'unshare' to the 'hg' module
This will be used to setup unsharing subrepos.  Usually cmdutil is used for
this purpose.  But the implementation needs hg.copystore(), and the hg module
already imports cmdutil.
2017-10-17 21:48:56 -04:00
Denis Laxalde
13f0a4a653 show: use labelcset() template alias for work (and stack) views
By reusing labelcset() template alias from map-cmdline.default we can now
display obsolescence information in `hg show work/stack`.
2017-10-17 20:25:43 +02:00
Kevin Bullock
d9bf33fad2 phases: pass phase names to hooks instead of internal values 2017-10-18 12:19:53 -05:00
Boris Feld
aab8c43439 configitems: document the choice of using 'match' instead of 'search' 2017-10-18 12:36:23 +02:00
Boris Feld
ad198e9760 configitems: do not directly match generic items
Before this changesets, a literal '.*:foo$' config would match a registered
'.*:foo$' generic. This is wrong since generic should be matched through
regular exception only. This changeset fixes this problem.

Thanks for to Yuya Nishihara for spotting the issue.
2017-10-18 12:26:08 +02:00
Boris Feld
3df0c5d74a obsfate: fix obsfate_printer with empty date list
When the list of dates is empty, `min` and `max` would raises a ValueError.
Protect against this case by checking that the date list is not empty.

I didn't add a test because I couldn't find a reproducing test case.
2017-10-18 15:38:51 +02:00
Boris Feld
4b2916f625 config: gather allowdivergence under the evolution namespace
Grouping all evolution related-config under the experimental.evolution
namespace would helps the future migration outside [experimental].

Differential Revision: https://phab.mercurial-scm.org/D1155
2017-10-17 16:54:31 +02:00
Boris Feld
03a11d7666 config: remove stabilization.* aliases
Stabilization config items were never part of a release, remove them now that
we cleaned up the evolution related configuration.

Differential Revision: https://phab.mercurial-scm.org/D1154
2017-10-17 15:57:56 +02:00
Boris Feld
5f77fdf0f1 config: update evolution-related config
Update the evolution helpers function to support both old-style configuration and
new-style configuration:

    experimental.evolution=all is renamed into experimental.evolution=true

    experimental.evolution=createmarkers is renamed into
    experimental.evolution.createmarkers=true

    experimental.evolution=allowunstable is renamed into
    experimental.evolution.allowunstable=true

    experimental.evolution=exchange is renamed into
    experimental.evolution.exchange=true

We choose to not rename individual config options; keeping the same names
would easy the transition for users but it's something that could be easily
done in the future.

Differential Revision: https://phab.mercurial-scm.org/D1147
2017-10-16 17:14:47 +02:00
Boris Feld
35adc999b8 config: invert evolution-related configuration aliases
We want to split the evolution-related configuration and back-out the renaming
from evolution.* to stabilization.*.

First invert the configuration and aliases, so next changesets will be
cleaner.

Differential Revision: https://phab.mercurial-scm.org/D1146
2017-10-16 17:14:32 +02:00
Augie Fackler
7ca1f09f81 parsers: allow clang-format here
# skip-blame because parsers.c is mechanically rewritten by
clang-format with no semantic change.

Differential Revision: https://phab.mercurial-scm.org/D1170
2017-10-16 14:53:57 -04:00
Augie Fackler
90df42e97c cext: add /* header */ comment to all PyVarObject_HEAD_INIT() calls
This gives clang-format the right notion about formatting these struct
initializers, therefore allowing us to automatically format several
additional files.

# skip-blame because this is just a content-free comment addition

Differential Revision: https://phab.mercurial-scm.org/D1169
2017-10-16 14:49:35 -04:00
Yuya Nishihara
5db2725c37 revset: make follow() accept empty startrev
This is the same behavior as ancestors(emptyset).
2016-09-22 19:41:42 +09:00
Yuya Nishihara
85d4b98f53 revset: alias follow(startrev=rev) to ancestors(rev)
This seems natural given 'log -frREV' (with no file pattern) is equivalent
to 'log -frREV *'.
2016-09-22 19:40:07 +09:00
Yuya Nishihara
08c3b37347 revset: make follow() accept keyword arguments
Also renamed the argument from 'pattern' to 'file' conforming to
followlines().
2016-09-22 19:35:36 +09:00
Yuya Nishihara
3142b0e7d7 revset: make follow() accept multiple startrevs
The diff might look slightly complicated, but the initial "c = repo['.']" was
effective if rev = None.
2016-09-22 19:11:26 +09:00
Yuya Nishihara
d7842061cc dagop: use heap to compute max rev in filectxancestors() 2016-09-22 18:41:51 +09:00
Yuya Nishihara
e49a4312a9 dagop: add smartset interface to filectxancestors()
The original filectx API is kept public since we'll need it to walk ancestor
(rev, match) pairs efficiently. The current implementation scans ancestors
twice for 'hg log -fp FILE'.
2017-10-22 18:57:42 +09:00
Phil Cohen
e206413cfc overlayworkingctx: add _checkexist(path)
This is in preparation to switch this class to inheriting (and being based off
a) `commitctx` instead of a `workingctx`. `filectx` has no `exists` function,
so this is how we'll fall back in that case.

Differential Revision: https://phab.mercurial-scm.org/D1237
2017-12-07 13:20:47 -08:00
Phil Cohen
4cb0fafe39 overlayworkingctx: fix a bad reference to self._path
Differential Revision: https://phab.mercurial-scm.org/D1236
2017-12-07 13:20:47 -08:00
Phil Cohen
4dc892f75b overlayworkingctx: track copy information in the context
We can no longer do so in the dirstate, so add the functions to do so here.

Differential Revision: https://phab.mercurial-scm.org/D1235
2017-12-07 13:20:47 -08:00
Phil Cohen
8024806695 overlayworkingctx: move _wrappedctx out of the constructor
With rebase, we will be setting the _wrappedctx at a different point from the
wctx construction (somewhat later, and possibly several times). Move it to a
public function.

Differential Revision: https://phab.mercurial-scm.org/D1231
2017-12-07 13:20:47 -08:00
Phil Cohen
d99691c52d merge: don't check for unknown files in IMM
Differential Revision: https://phab.mercurial-scm.org/D1214
2017-12-07 13:20:47 -08:00
Jun Wu
e7d2ff6ac8 rebase: enable multidest by default
This was intended to be done by D470. But there was a minor documentation
issue. The feature is quite usable now so it gets formally documented and
enabled.

There is no behavior change for people not using the `SRC` or `ALLSRC` in
rebase destination revset.

.. feature:: Rebase with different destination per source revision

  Previously, rebase only supports one unique destination. Now ``SRC`` and
  ``ALLSRC`` can be used in rebase destination revset to precisely define
  destination per each individual source revision.

  For example, the following command could move some orphaned changesets to
  reasonable new places so they become no longer orphaned::

    hg rebase
      -r 'orphan()-obsolete()'
      -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)'

Differential Revision: https://phab.mercurial-scm.org/D1063
2017-10-13 14:08:14 -07:00
Phil Cohen
b85e71bd61 overlayworkingctx: make clean() public
It will be called directly by rebase after concluding a node.

Differential Revision: https://phab.mercurial-scm.org/D1230
2017-12-01 00:07:23 -08:00
Phil Cohen
635c6eaf7f overlayworkingctx: remove flushall()
Differential Revision: https://phab.mercurial-scm.org/D1216
2017-12-01 00:07:23 -08:00
Phil Cohen
da19a4a9f4 merge: skip subrepo state, update hooks, and updating the dirstate in IMM
Differential Revision: https://phab.mercurial-scm.org/D1215
2017-12-01 00:07:23 -08:00
Phil Cohen
d0b4ef96b4 merge: remove calls to flushall()
Since D1105, these are unnecessary since IMM will now never use workers.

Differential Revision: https://phab.mercurial-scm.org/D1213
2017-12-01 00:07:23 -08:00
Phil Cohen
cb5bf40a81 filemerge: raise InMemoryMergeConflictsError if we hit merge conflicts in IMM
Merge conflicts might be supported in the future, but for now are kept out of
scope.

Any places where we used to call `flushall()` should be replaced with some kind
of exception. At this point, IMM M1 is no longer supported.

Differential Revision: https://phab.mercurial-scm.org/D1212
2017-12-01 00:07:23 -08:00
Phil Cohen
5992e0fe48 context: switch ctx() use to changectx()
I added `ctx()` to `overlayworkingfilectx`, (and before that, `absentfilectx`),
because `absentfilectx` had reference to this function in its `cmp()` function.

But the standard is actually `changectx()`, and no other class implements
`ctx()`. So let's use the standard name.

(As a result, I'm not sure that part of the `absentfilectx` comparator ever
worked! It was written before I added either function.)

This will be necessary in the next patch.

Differential Revision: https://phab.mercurial-scm.org/D1211
2017-12-01 00:07:23 -08:00
Matthieu Laneuville
14498f2bf5 patch: add within-line color diff capacity
The `diff' command usually writes deletion in red and insertions in green. This
patch adds within-line colors, to highlight which part of the lines differ.
Lines to compare are decided based on their similarity ratio, as computed by
difflib SequenceMatcher, with an arbitrary threshold (0.7) to decide at which
point two lines are considered entirely different (therefore no inline-diff
required).

The current implementation is kept behind an experimental flag in order to test
the effect on performance. In order to activate it, set inline-color-diff to
true in [experimental].
2017-10-26 00:13:38 +09:00
Yuya Nishihara
4c0e4dc497 dagop: extend filectxancestors() to walk multiple files 2016-09-22 18:23:58 +09:00
Yuya Nishihara
b05b96f608 dagop: put start fctx into visit dict of filectxancestors()
Prepares for multiple start revisions/files.
2016-09-22 18:18:56 +09:00
Yuya Nishihara
09a49f4137 dagop: change visit dict of filectxancestors() indexed solely by rev
In future patches, a max heap will be used to compute the next revision
to visit.
2016-09-22 18:11:37 +09:00
Yuya Nishihara
a17c36ca23 dagop: use fctx.rev() consistently in filectxancestors()
We can't use fctx.linkrev() to sort fctxs coming from multiple files.
This was changed at a5b8b1052ef6 due to performance issue, but we know
we evaluate parent.rev() in revset anyway.
2016-09-22 18:01:55 +09:00
Yuya Nishihara
70940bffa0 dagop: yield intro filectx by filectxancestors()
This is the convention of dagop.*ancestors() functions.
2016-09-22 17:48:46 +09:00
Yuya Nishihara
6245084744 filectx: extract helper method to obtain filectx pointing to its introrev 2017-10-22 17:23:34 +09:00
Yuya Nishihara
f55866843d dagop: copy basefilectx.ancestors() to free function
The primary goal of this series is to make follow() support multiple start
revisions.

dagop.filectxancestors() will be extended to take multiple filectxs.
basefilectx.ancestors() is not forwarded to this function because doing that
would resurrect the performance issue fixed by a5b8b1052ef6.
2016-09-22 17:16:53 +09:00
Boris Feld
8e35ca84ad pull: retrieve bookmarks through the binary part when possible
This makes pull consistent with the part used by push and provide us with a
more compact representation of bookmarks.

In addition, this opens the way for smarter bookmark exchanges (e.g. filtering
by names or only sending the bookmark relevant to the pulled set, etc).
2017-10-17 15:27:22 +02:00
Boris Feld
96e2aa3564 getbundle: add support for 'bookmarks' boolean argument
This new argument requests a 'bookmarks' part from the server. It is meant to
be used instead of the "listkeys" request.
2017-10-17 15:27:17 +02:00
Boris Feld
d449bcaec6 bundle2: support a 'records' mode for the 'bookmarks' part
In this mode, the bookmarks changes are record in the 'bundleoperation' records
instead of inflicted to the repository. This is necessary to use the part when
pulling.
2017-10-17 15:26:16 +02:00
Boris Feld
85a28bae65 bundle2: add a 'modes' dictionary to the bundle operation
This new attribute allows the codes requesting an unbundling to pass important
information to individual part handlers. The current target use case is to
allow for receiving 'bookmarks' part without directly updating local
repository, but just recording the received data instead. This is necessary
for pull where the remote bookmarks are processed locally. I expect the
concept to be beneficial to other parts in the future.

To clarify the bookmark behavior on pull, the remote bookmark value are not just
taken -as-is- into the local repository. There is an extra step to detect
bookmark divergence. The remote bookmarks data are stored until this processing
happens.
2017-10-17 15:39:34 +02:00
Boris Feld
12ed35f197 bookmark: use the 'bookmarks' bundle2 part to push bookmark update (issue5165)
We use the new binary parts we introduced earlier to exchange bookmark. The
payload is a bit more compact since we use binary and the length of bookmarks
is no longer constrained to 255.

.. fix:: Issue 5165

   Bookmark, whose name is longer than 255, can again be exchanged again
   between 4.4+ client and servers.
2017-10-17 12:38:13 +02:00
Boris Feld
f4af02531c push: move bundle2-pushkey based bookmarks exchange in its own function
We are about to introduce an alternative way to push bookmark over bundle2.
2017-10-15 19:22:56 +02:00
Boris Feld
fa6d2b1849 bookmark: add pushkey hook compatiblity to the bundle2 part
Currently, pushing a bookmark update triggers a pushkey hooks. It is likely
that users in the wild use such hooks to control bookmark movement. Using a non
push-key mechanism to exchange bookmark means these hooks are no longer called,
possibly breaking existing users setup. So we add explicit call to the pushkey
hooks in the handling of the bundle2 part. This behavior can be disabled with a
new config knob: 'server.bookmarks-pushkey-compat'.
2017-10-17 12:07:24 +02:00
Boris Feld
b1c5929fec bookmark: introduce a 'bookmarks' part
This part can carry and apply bookmarks information. We start with adding the
core behavior of the part. In its current form, the part is only suitable for
push since it plain update the bookmark without consideration for the local
state. Support of the behavior needed for pulling will be added in later
changesets.
2017-10-15 18:02:11 +02:00
Boris Feld
e7031fe580 push: include a 'check:bookmarks' part when possible
Before updating the actual bookmark update, we can start with updating the way
we check for push race. Checking bookmarks state earlier is useful even if we
still use pushkey. Aborting before the changegroup is added can save a lot of
time.
2017-11-13 04:22:45 +01:00
Boris Feld
02c4c0f0cf bookmark: add a 'check:bookmarks' bundle2 part
This part checks that bookmarks are still at the node they are expected to be.
This allows a pushing client to detect push race where the repository was
updated between the time it discovered the server state and the time it managed
to finish its push.

Such checking already exists when pushing bookmark through pushkey. This new
part can be inserted at the beginning of the bundle, triggering abort earlier.
In addition, we would like to move away from pushey to push bookmark. A step
useful to solve issue5165.
2017-10-15 15:01:03 +02:00
Boris Feld
5028c90eec bookmark: add methods to binary encode and decode bookmark values
Coming new bundle2 parts related to bookmark will use a binary encoding. It
encodes a series of '(bookmark, node)' pairs. Bookmark name has a high enough
size limit to not be affected by issue5165. (64K length, we are well covered)
2017-10-15 14:59:55 +02:00
Anton Shestakov
631928e009 hgweb: move common vertex code to Graph.prototype
Just to give some context to the return values: vertex() needs to return two
HTML elements as strings, <li> to be used as a background and a <li> to be
shown in foreground. The latter was made obsolete recently when changesets
started to be rendered server-side, but background elements are still useful
for now.
2017-12-06 12:10:16 +08:00
Anton Shestakov
a4d9f6f538 hgweb: create Graph methods using a prototype
This way it's possible to call the original methods even if they were
overridden.
2017-12-06 12:01:07 +08:00
Anton Shestakov
01742a7db5 hgweb: remove unused Graph.cur property
It was introduced in 083571f47ff6, but was already unused. I missed it in
ba4409377a9f.
2017-12-06 11:59:19 +08:00
Yuya Nishihara
fc1b1c7965 repoview: include filter name in repr for debugging 2017-12-05 21:56:48 +09:00
Yuya Nishihara
11b6b464d8 repoview: extract a factory function of proxy class
This makes sure that dynamically-created class objects are isolated from
local binding of repo instances. The type cache is moved to module level
as it isn't tied to each instance.
2017-12-05 21:50:33 +09:00
Yuya Nishihara
570f399d52 repoview: do not include filter name in name of proxy class
The type object is shared across all filters. I'll add __repr__() instead.
2017-12-05 21:37:30 +09:00
Yuya Nishihara
655da40532 thirdparty: move selectors2 module to where it should be 2017-11-30 22:43:03 +09:00
Pulkit Goyal
a0250b29d4 rewriteutil: use precheck() in uncommit and amend commands
Differential Revision: https://phab.mercurial-scm.org/D1526
2017-11-28 05:50:45 +05:30
Pulkit Goyal
4f214eeba8 rewriteutil: add a precheck function to check if revs can be rewritten
The precheck function is intended to be used before we start rewritting
changesets.

Differential Revision: https://phab.mercurial-scm.org/D1503
2017-11-24 03:44:50 +05:30
Pulkit Goyal
579e1d7f54 rewriteutil: add utility function to check if we can create new unstable cset
This patch adds a new file which will contain utility functions related to
rewritting changesets. It also adds a utility function to check if the
rewritting operation creates new unstable changesets and are we allowed to
create them.

This rewriteutil.py introduced in this patch and the utility functions added in
the upcoming patches exists in the evolve extension are being ported from there.

Differential Revision: https://phab.mercurial-scm.org/D1502
2017-11-24 03:40:33 +05:30
Pulkit Goyal
bc6c76e6f1 remotenames: consider existing data while storing newer data
Previously reviewed as D1357.

Differential Revision: https://phab.mercurial-scm.org/D1551
2017-11-09 12:10:03 +05:30
Pulkit Goyal
db8a9589fd remotenames: add functions to read remotenames data from .hg/remotenames/
This patch functions which can be used to read remotenames data from
.hg/remotenames/. The logic for the function which reads the remotenames file is
taken from the remotenames extension.

Previously reviewed as D940.

Differential Revision: https://phab.mercurial-scm.org/D1550
2017-10-05 01:31:53 +05:30
Pulkit Goyal
d680032136 remotenames: add functionality to store remotenames under .hg/hgremotenames/
This patch moves the functionality from remotenames extension to store
remotenames to core.

Storage format used by remotenames extension:

A single file `.hg/remotenames` with an entry in each line where each line is of
format:
`node nametype remotepath/name`
where nametype is either 'bookmarks' or 'branches'.

This was not the best way to store data, so while moving to core the storage
format was changed but yet not the final format. The storage format used by core
after this patch will be:

* A file for each type of name i.e. bookmarks and branches in .hg/remotenames/
  directory
* A version number on the top of the file. The version for current format is 0.
* An entry in each line where each line is of the format
`node\0remotepath\0name`

The logic to sync with existing remotenames file and saving journals and other
related things will be moved to core in next patches incrementally.

Thanks to Ryan, Augie and Durham for suggestions on storage format.

Previously reviewed as D939.

Differential Revision: https://phab.mercurial-scm.org/D1548
2017-10-05 00:44:38 +05:30
Pulkit Goyal
c2ca736b6e remotenames: move function to pull remotenames from the remoterepo to core
This patch is the first patch of the series moving functionality from
hgremotenames extension to core.

There are lot of functionality in the extension which in the end enables us to
store branch heads and bookmarks location on a server from which we are pulling
or cloning from. This will help us in creating a better bookmark workflow where
we can show user that a certain server has this bookmarks at this node. It will
also introduce namespaces related to remote bookmarks and remote branches.

This patch moves the functionality to pull branches and bookmarks from a
server from which we are pulling to core behind config option
`experimental.remotenames`.

This patch adds a test which helps us to analyse whether things are working or
not. We are currently writing things to ui, we will write information to files
in upcoming patches.

Previously reviewed as D937.

Differential Revision: https://phab.mercurial-scm.org/D1547
2017-10-05 00:02:02 +05:30
Yuya Nishihara
9bf6236a83 fancyopts: fix handling of "--" value in earlygetopt() 2017-11-25 17:30:50 +09:00
Yuya Nishihara
502549c773 fancyopts: use getopt.gnu_getopt()
The issue described in the docstring has been fixed since Python 20ab2260dc93,
which is in 2.7.

https://hg.python.org/cpython/rev/20ab2260dc93
https://bugs.python.org/issue4458

This fixes the handling of '--' value.
2017-11-24 01:09:00 +09:00
Yuya Nishihara
86043c7487 dispatch: replace _earlygetopt(strip=True) with new parser
The execution order in cmdalias.__init__() is adjusted to set stripped args
to self.givenargs, which is no longer updated in place.
2017-11-23 23:18:56 +09:00
Yuya Nishihara
c2c866a852 dispatch: replace _earlyreq*() with new fancyopts-based parser 2017-11-23 22:23:59 +09:00
Yuya Nishihara
2e53122de6 dispatch: alias --repo to --repository while parsing early options
This prepares for replacing old _early*opt() functions. My initial attempt
was to extend options table to support 'repository|repo' syntax. It worked,
but seemed too invasive. So I decided to add an optional argument to
fancyopts() instead.

This also changes the nevernegate dict to be keyed by a canonical_name,
not by an option-name for clarity.
2017-11-25 17:03:52 +09:00
Anton Shestakov
7187e609f7 spartan: render changesets server-side on /graph page 2017-12-04 19:08:41 +08:00
Anton Shestakov
7a357f1cf9 monoblue: render changesets server-side on /graph page 2017-12-04 18:26:54 +08:00
Anton Shestakov
55006fdcc2 gitweb: render changesets server-side on /graph page 2017-12-04 17:43:45 +08:00
Anton Shestakov
3c2de0ad20 paper: render changesets server-side on /graph page 2017-12-04 16:21:15 +08:00
Anton Shestakov
364b5723c5 hgweb: only include graph-related data in jsdata variable on /graph pages (BC)
Historically, client-side graph code was not only rendering the graph itself,
but it was also adding all of the changeset information to the page as well.
It meant that JavaScript code needed to construct valid HTML as a string
(although proper escaping was done server-side). It wasn't too clunky, even
though it meant that a lot of server-side things were duplicated client-side
for no good reason, but the worst thing about it was the data format it used.
It was somewhat future-proof, but not human-friendly, because it was just a
tuple: it was possible to append things to it (as was done in e.g.
4d7cfa1867b5), but you'd then have to remember the indices and reading the
resulting JS code wasn't easy, because cur[8] is not descriptive at all.

So what would need to happen for graph to have more features, such as more
changeset information or a different vertex style (branch-closing, obsolete)?
First you'd need to take some property, process it (e.g. escape and pass
through templatefilters function, and mind the encoding too), append it to
jsdata and remember its index, then go add nearly identical JavaScript code to
4 different hgweb themes that use jsdata to render HTML, and finally try and
forget how brittle it all felt. Oh yeah, and the indices go to double digits if
we add 2 more items, say phase and obsolescence, and there are more to come.
Rendering vertex in a different style would need another property (say,
character "o", "_", or "x"), except if you want to be backwards-compatible, it
would need to go after tags and bookmarks, and that just doesn't feel right.

So here I'm trying to fix both the duplication of code and the data format:

- changesets will be rendered by hgweb templates the same way as changelog and
  other such pages, so jsdata won't need any information that's not needed for
  rendering the graph itself

- jsdata will be a dict, or an Object in JS, which is a lot nicer to humans and
  is a lot more future-proof in the long run, because it doesn't use numeric
  indices

What about hgweb themes? Obviously, this will break all hgweb themes that
render graph in JavaScript, including 3rd-party custom ones. But this will also
reduce the size of client-side code and make it more uniform, so that it can be
shared across hgweb themes, further reducing its size. The next few patches
demonstrate that it's not hard to adapt a theme to these changes. And in a
later series, I'm planning to move duplicate JS code from */graph.tmpl to
mercurial.js and leave only 4 lines of code embedded in those <script>
elements, and even that would be just to allow redefining graph.vertex
function. So adapting a custom 3rd-party theme to these changes would mean:

- creating or copying graphnode.tmpl and adding it to the map file (if a theme
  doesn't already use __base__)

- modifying one line in graph.tmpl and simply removing the bigger part of
  JavaScript code from there

Making these changes in this patch and not updating every hgweb theme that uses
jsdata at the same time is a bit of a cheat to make this series more
manageable: /graph pages that use jsdata are broken by this patch, but since
there are no tests that would detect this, bisect works fine; and themes are
updated separately, in the next 4 patches of this series to ease reviewing.
2017-12-01 16:00:40 +08:00
Anton Shestakov
43f716d8d5 hgweb: adopt child nodes in ajaxScrollInit on /graph pages too
ajaxScrollInit is a function that loads more elements (e.g. changelog entries)
when browser window is scrolled down to the bottom of the page. It basically
fetches the next page from the server as HTML, finds container element in that
document and "adopts" (essentially, moves) all its child nodes to the container
in the current document.

Currently, hgweb doesn't render any changesets on /graph page (everything is
done in JavaScript), so there are no children to adopt. But there will be soon,
so let's create a reusable function that does it.

Hardcoding #graphnodes selector is suboptimal, but graph code already does this
in two other places.
2017-12-01 14:17:20 +08:00
Yuya Nishihara
2c811cd701 log: translate column labels at once (issue5750)
This makes sure that all columns are aligned. getlogcolumns() is hosted by
templatekw so the namespaces module can see it.

i18n/de.po is updated so test-log.t passes with no error. "obsolete:" and
"instability:" are kept untranslated.
2017-12-02 16:29:49 +09:00
Yuya Nishihara
9d926f0131 log: remove temporary variable 'date' used only once 2017-12-02 16:08:24 +09:00
Boris Feld
6fefecff91 lock: allow to configure when the lock messages are displayed
We add a new 'ui.timeout.warn' config to set a grace period before we display
lock related warning:

    waiting for lock on PATH held by PROCESS

The config is based on 'ui.timeout' and expresses a number of seconds before
the warning is displayed. Negative values disable the warning altogether.

The messages go to the debug output to help people trouble-shooting deadlocks.
2017-11-29 20:39:59 -05:00
Boris Feld
87115045d0 lock: add a trylock method handling the timeout and messaging logic
We are about to make the messages around lock more flexible. We move all the
currently logic into a function in the lock module. We'll update the message
scheme in the next changeset.
2017-11-29 20:36:29 -05:00
Boris Feld
ce5945f52a lock: use configint for 'ui.timeout' config
The ui object can do the conversion itself.
2017-11-29 21:00:02 -05:00
Boris Feld
d4021aee4f scmutil: improve format pattern used in nodesummaries
As spotted by Yuya Nishihara, that value is an integer.
2017-12-04 09:39:37 +01:00
Pulkit Goyal
174b204536 py3: use encoding.strtolocal() to convert string to bytes
Differential Revision: https://phab.mercurial-scm.org/D1557
2017-11-29 08:40:25 +05:30
Pulkit Goyal
4aa252d4b0 py3: use pycompat.bytestr() or '%d' in place of str()
Differential Revision: https://phab.mercurial-scm.org/D1556
2017-11-29 08:39:48 +05:30
James May
12adeba8fa archive: pass thru mtime for directory archives, like other archive types do
Without this files in the output archive directory have their mtimes set to
whatever time they were written their.  This is in this inconsistent with
the other archivers, eg. zip, which use exactly the same time for all files.

Works on my machine (Windows), but I don't have a *nix box available to run
anything more thorough, unfortunately.
2017-12-01 17:39:21 +11:00
Anton Shestakov
41e5f7f794 hgweb: remove negative top from .info line in graph
"top: -Xpx" shifts a block up by X pixels, which can be used to visually
compress two lines of text to have less space between them, in this case it's
used for the changesets on /graph page. But not only it's not needed there
(both lines fit fine into their allowed vertical space), but it would also look
better (not as crammed, more vertically centered) without these negative
values.

"position: relative" is needed solely for the "top" property to have effect on
the element, no children of the .info element rely on it, so let's remove it as
well.
2017-12-01 20:33:02 +08:00
Pulkit Goyal
6d1ddd1aef py3: use bytes in place of basestring
All strings in mercurial must be bytes so we can easily replace basestring with
bytes.

Differential Revision: https://phab.mercurial-scm.org/D1555
2017-12-01 16:53:55 +05:30
Martin von Zweigbergk
9ca0e39e98 amend: make a copy of "extra" to avoid mutating an input
I don't know of any problems this has caused, it just seems less
surprising.

Differential Revision: https://phab.mercurial-scm.org/D1575
2017-12-01 14:13:55 -08:00
Gregory Szorc
32815ee95d py3: define __next__ in patch.py
This needed to appease Python 3's iterator protocol.

This is crasher #5 in Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1480
2017-11-20 23:13:09 -08:00