Commit Graph

6403 Commits

Author SHA1 Message Date
Boris Feld
5aa999bedd configitems: register the 'commands.show.aliasprefix' config 2017-10-08 20:16:09 +02:00
Boris Feld
7aa1eb1de7 configitems: register the 'blackbox.track' config 2017-10-08 20:11:34 +02:00
Pulkit Goyal
8cf2ab1237 py3: fix keyword arguments handling in mq
This patch fixes the handling of keyword arguments to functions on Python 3. On
python3, the keys of keyword arguments need to str which is unicode. So any
keyword argument will get will have str keys and any dictionary we pass as
kwargs must have all the keys as str.

This patch uses pycompat.(strkwargs|byteskwargs) to do so conversion between
bytes keys and str keys and use r'' if there are very less uses and conversion
can be prevented.

Differential Revision: https://phab.mercurial-scm.org/D972
2017-10-02 04:46:17 +05:30
Boris Feld
4a1873b535 configitems: register the 'convert.p4.encoding' config 2017-06-30 03:36:10 +02:00
Boris Feld
5fb986dcec configitems: register the 'gpg.key' config 2017-06-30 03:42:34 +02:00
Boris Feld
7f0ad7dd52 configitems: register the 'gpg.cmd' config 2017-06-30 03:42:33 +02:00
Boris Feld
64d1b101d3 configitems: register the 'keywordset.svn' config 2017-06-30 03:42:50 +02:00
Boris Feld
22ea1c5ccd configitems: register the 'hgk.path' config 2017-06-30 03:42:35 +02:00
Boris Feld
846857f96b configitems: register the 'share.poolnaming' config 2017-06-30 03:44:18 +02:00
Boris Feld
324e2e48c4 configitems: register the 'share.pool' config 2017-06-30 03:44:17 +02:00
Boris Feld
d1938932c9 configitems: register the 'shelve.maxbackups' config 2017-06-30 03:44:19 +02:00
Boris Feld
db25c9b563 configitems: register the 'pager.attend' config 2017-06-30 03:43:33 +02:00
Boris Feld
a37fa16d39 configitems: register the 'commands.rebase.requiredest' config 2017-06-30 03:32:25 +02:00
Boris Feld
529a966468 configitems: register the 'experimental.rebaseskipobsolete' config 2017-06-30 03:42:06 +02:00
Saurabh Singh
ffc1ad2f09 histedit: removing the experimental config 'histeditng'
This config has been around for about 2 years now. So, it can be
assumed to be stable. Therefore, I am removing the config. This also makes the
test 'test-histedit-base.t' compatible with chg.

Test Plan:
 - Ran the test 'test-histedit-base.t' with and without '--chg' option.
 - Ran all the other tests without '--chg' option.
 - Checked the output of 'hg help histedit'.

Differential Revision: https://phab.mercurial-scm.org/D942
2017-10-05 21:56:25 +00:00
Saurabh Singh
abf69172aa convert: fix the RevisionSpec import in the bzr module
This import was failing (because its invalid) which was resulting in
the following tests failing with chg running:

 - test-convert-bzr.t
 - test-convert-bzr-directories.t
 - test-convert-bzr-ghosts.t
 - test-convert-bzr-treeroot.t
 - test-convert-bzr-114.t
 - test-convert-bzr-merges.t

This commit fixes the import which in turn fixes the tests.

Test Plan:
Ran the aforementioned tests with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D936
2017-10-05 00:48:44 +00:00
Boris Feld
e2c066c1d2 configitems: register the 'experimental.histeditng' config 2017-06-30 03:41:23 +02:00
Boris Feld
c5961e53a9 configitems: register the 'experimental.histedit.autoverb' config 2017-06-30 03:41:19 +02:00
Boris Feld
3511ff1228 configitems: register the 'histedit.singletransaction' config 2017-06-30 03:42:40 +02:00
Boris Feld
232028d78c configitems: register the 'histedit.linelen' config 2017-06-30 03:42:39 +02:00
Boris Feld
320e358126 configitems: register the 'histedit.dropmissing' config 2017-06-30 03:42:38 +02:00
Boris Feld
c8792151c9 configitems: register the 'histedit.defaultrev' config 2017-06-30 03:42:37 +02:00
Boris Feld
d5b4ab79b8 configitems: register the 'transplant.log' config 2017-06-30 03:44:30 +02:00
Boris Feld
4c15dbe270 configitems: register the 'transplant.filter' config 2017-06-30 03:44:29 +02:00
Gregory Szorc
38e83867e1 fsmonitor: use configitem
We might as well get this out of the way.

Differential Revision: https://phab.mercurial-scm.org/D893
2017-10-01 22:26:24 +01:00
Gregory Szorc
e554f0b9a9 fsmonitor: access copymap in new location
fsmonitor has been busted since 00d68e462d1d due to moving
self._copymap. Fix it.

Differential Revision: https://phab.mercurial-scm.org/D892
2017-10-01 23:47:16 +01:00
Jun Wu
02fcca0577 zeroconf: do not crash if socket being read is closed by another thread
In zeroconf/__init__.py, there is:

    server = Zeroconf.Zeroconf(ip)
    l = listener()
    Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l)
    time.sleep(1)
    server.close()

`server.close()` closes the underlying socket while the `ServiceBrowser` may
still have a background thread reading the socket. There could be a race
condition where the reading thread reads the closed socket, resulting in
EBADF crash. This patch catches the exception.

This makes test-paths.t pass with chg.

Differential Revision: https://phab.mercurial-scm.org/D919
2017-10-02 20:23:25 -07:00
Rishabh Madan
1fad4ceba7 releasenotes: display release notes when no filename is specified
If the filename is not specified while using --rev, the notes for the specified
revs will just be displayed on screen.

Differential Revision: https://phab.mercurial-scm.org/D877
2017-10-01 14:37:50 +01:00
Augie Fackler
0dc7200e8a convert: remove superfluous pass statements 2017-09-30 07:42:47 -04:00
Augie Fackler
ea46df853d bugzilla: remove superfluous pass statements 2017-09-29 11:55:26 -04:00
Martin von Zweigbergk
25360ba00c merge with stable 2017-09-30 07:52:48 -07:00
Yuya Nishihara
c94105ba63 py3: replace str(None) with literal in convcmd.py 2017-09-27 19:08:23 +09:00
Martin von Zweigbergk
22ecef9ff9 dirstate: use keyword arguments to clarify status()'s callers
The arguments are especially non-obvious because the order is
different from dirstate.walk().

Differential Revision: https://phab.mercurial-scm.org/D847
2017-09-29 14:49:05 -07:00
Martin von Zweigbergk
38828a858a dirstate: use keyword arguments to clarify walk()'s callers
The arguments are especially non-obvious because the order is
different from dirstate.status().

Differential Revision: https://phab.mercurial-scm.org/D846
2017-09-29 14:19:36 -07:00
Jun Wu
4129970972 rebase: move bookmarks with --keep (issue5682)
This is a regression caused by 80d53a39fbcc. We have documented the behavior
in rebase help:

    Rebase will destroy original commits unless you use "--keep". It will
    also move your bookmarks (even if you do).

So let's restore the old behavior.

It is done by changing `scmutil.cleanupnodes` to accept more information so
a node could have different "movement destination" from "successors". It
also helps simplifying the callsite as a side effect - the special bookmark
movement logic in rebase is removed.

Differential Revision: https://phab.mercurial-scm.org/D727
2017-09-18 10:54:00 -07:00
Mads Kiilerich
3676051d80 mq: create non-lossy patches, also with custom global diff configuration
Users with custom [diff] configuration most certainly didn't intend it to make
mq lose changes. It could:

 * git is handled perfectly fine.

 * nobinary could make mq leave some files out from the patches.

 * noprefix could make mq itself (and probably also other tools) fail to apply
   patches without the usual a/b prefix.

 * ignorews, ignorewsamount, or ignoreblanklines could create patches with
   missing whitespace that could fail to apply correctly.

Thus, when refreshing patches, use patch.difffeatureopts, optionally with git
as before, but without the config options for whitespace and format changing
that most likely will cause loss or problems.

(patch.diffopts is just patch.difffeatureopts with all options enabled and can
be replaced with that.)
2017-09-11 00:42:24 +02:00
Rishabh Madan
96bdfe0f46 releasenotes: update docstrings with information on additional flags
This patch adds documentation related to the two new flags --check and
--list for releasenotes extension.

Differential Revision: https://phab.mercurial-scm.org/D544
2017-08-29 00:21:25 +05:30
Rishabh Madan
91787f1c2b releasenotes: raise error on simultaneous usage of flags
The releasenotes command is supposed to raise an error when --list and
--rev/--check flags are used together. This patch adds the above functionality.

Differential Revision: https://phab.mercurial-scm.org/D831
2017-09-28 13:22:58 +05:30
Yuya Nishihara
ba69ca47d4 pathauditor: disable cache of audited paths by default (issue5628)
The initial attempt was to discard cache when appropriate, but it appears
to be error prone. We had to carefully inspect all places where audit() is
called e.g. without actually updating filesystem, before removing files and
directories, etc.

So, this patch disables the cache of audited paths by default, and enables
it only for the following cases:

 - short-lived auditor objects
 - repo.vfs, repo.svfs, and repo.cachevfs, which are managed directories
   and considered sort of append-only (a file/directory would never be
   replaced with a symlink)

There would be more cacheable vfs objects (e.g. mq.queue.opener), but I
decided not to inspect all of them in this patch. We can make them cached
later.

Benchmark result:

- using old clone of http://selenic.com/repo/linux-2.6/ (38319 files)
- on tmpfs
- run HGRCPATH=/dev/null hg up -q --time tip && hg up -q null
- try 4 times and take the last three results

original:
real 7.480 secs (user 1.140+22.760 sys 0.150+1.690)
real 8.010 secs (user 1.070+22.280 sys 0.170+2.120)
real 7.470 secs (user 1.120+22.390 sys 0.120+1.910)

clearcache (the other series):
real 7.680 secs (user 1.120+23.420 sys 0.140+1.970)
real 7.670 secs (user 1.110+23.620 sys 0.130+1.810)
real 7.740 secs (user 1.090+23.510 sys 0.160+1.940)

enable cache only for vfs and svfs (this series):
real 8.730 secs (user 1.500+25.190 sys 0.260+2.260)
real 8.750 secs (user 1.490+25.170 sys 0.250+2.340)
real 9.010 secs (user 1.680+25.340 sys 0.280+2.540)

remove cache function at all (for reference):
real 9.620 secs (user 1.440+27.120 sys 0.250+2.980)
real 9.420 secs (user 1.400+26.940 sys 0.320+3.130)
real 9.760 secs (user 1.530+27.270 sys 0.250+2.970)
2017-07-26 22:10:15 +09:00
Yuya Nishihara
4be878f7d2 rebase: sort collapsed revisions in commit message (issue5643)
This fixes the test instability.
2017-08-02 21:52:22 +09:00
Pulkit Goyal
6940437f39 commitextras: make sure keys are not empty
Thanks to Yuya for catching this.
2017-07-30 12:19:46 +05:30
Pulkit Goyal
f30e209b89 commitextras: make sure keys contains ascii letters, numbers, '_' and '-' only 2017-07-28 07:42:55 +05:30
Jun Wu
a3005e76f2 rebase: move bookmark to destination for commits becoming empty (issue5627)
When rebasing a changeset X and that changeset becomes empty, we should move
the bookmark on X to rebase destination.

This is a regression caused by the scmutil.cleanupnodes refactoring for
rebase.

The `adjustdest` function calculates the destination of bookmark movement.
It was back-ported from https://phab.mercurial-scm.org/D21. It might be
slightly more powerful than the minimal requirement to solve this issue.
For example, it's impossible for a merge changeset to become empty while any
of its ancestors does not become empty, but the code could handle that case.
Since the code is reasonably short and clean, and helps the upcoming D21
series, I'd like to check-in `adjustdest` now.

Thanks Martin von Zweigbergk for spotting corner cases (-k and descendant
with bookmarks) in this area!
2017-07-24 23:52:56 -07:00
Rishabh Madan
923d0c8971 releasenotes: add custom admonitions support for release notes
By default, the extension has default sections like fix, feature, perf etc.. This
patch allow user to add support for custom admonition. In order to add a custom
admonition, one needs to have a .hgreleasenotes file inside the repository. All the
custom directive with name specified under the tag [sections] will be
usable by the extension. One important thing to keep in mind is if there exists any
custom admonitions with same key as default then they will override the default ones.
2017-07-18 23:04:08 +05:30
Durham Goode
7ab951502c rebase: add config to move rebase into a single transaction
This was previously landed as 507f16f4aa51 but backed out in a5abaa81fa because
it broke hook mid rebase and caused conflict resolution data loss in the event
of unexpected exceptions. This new version adds the behavior back but behind a
config flag, since the performance improvement is notable in large repositories.

The next patch adds a test covering this config.

The old commit message was:

Previously, rebasing would open several transaction over the course of rebasing
several commits. Opening a transaction can have notable overhead (like copying
the dirstate) which can add up when rebasing many commits.

This patch adds a single large transaction around the actual commit rebase
operation, with a catch for intervention which serializes the current state if
we need to drop back to the terminal for user intervention. Amazingly, almost
all the tests seem to pass.

On large repos with large working copies, this can speed up rebasing 7 commits
by 25%. I'd expect the percentage to be a bit larger for rebasing even more
commits.

There are minor test changes because we're rolling back the entire transaction
during unexpected exceptions instead of just stopping mid-rebase, so there's no
more backup bundle. It also leave an unknown file in the working copy, since our
clean up 'hg update' doesn't delete unknown files.
(grafted from cca36c7f35261b0e31beb226bf361067ef0e06ab)
(grafted from dc497d8705b71503e32e07bd33925c1e42cf9c9a)

Differential Revision: https://phab.mercurial-scm.org/D134
2017-07-18 07:47:28 -07:00
Pulkit Goyal
4d367c3543 commitextras: mark the extension as ADVANCED 2017-07-18 00:10:44 +05:30
Gregory Szorc
fde2177334 sparse: require [section] in sparse config files (BC)
Previously, [include] was implicit and pattern lines before a
[section] were added to includes.

Because the format may change in the future and explicit behavior,
well, more explicit, this commit changes the config parser to
reject pattern lines that don't occur in a [section].

Differential Revision: https://phab.mercurial-scm.org/D96
2017-07-15 13:21:23 -07:00
Pulkit Goyal
262b010c09 commitextras: check the format of the arguments and no internal key is used
This patch adds check to make the arguments are passed as KEY=VALUE and no key
which is used internally is passed.

This patch also adds test for the extension.
2017-07-12 16:10:10 +05:30
Pulkit Goyal
90d68a27f9 commitextras: move fb extension to core which add extras to a commit
This patch moves the Facebook extension to add extra fields to a commit to a
in-core extension.
2017-07-12 00:23:45 +05:30
Boris Feld
d46e1b04e2 color: drop the now useless color extension
all the extension features are provided by core since 4.2.
2017-07-15 14:17:35 +02:00