Commit Graph

32631 Commits

Author SHA1 Message Date
Matt Harbison
402bd4d6c2 test-hardlinks: stabilize for Windows
This broke in db26e1073a5f, which breaks hardlinks when the executable bit is
toggled.
2017-06-10 00:06:57 -04:00
Kevin Bullock
37a82e2a00 Added signature for changeset 28e02e510eac 2017-06-04 08:16:37 -05:00
Rishabh Madan
085efcbf00 releasenotes: add more tests for formatting and merging of release notes 2017-06-04 00:16:45 +02:00
Siddharth Agarwal
41dae969eb status: don't crash if a lookup file disappears
This can happen if another process (even another hg process!) comes along and
removes the file at that time.

This partly resolves issue5584, but not completely -- a bogus dirstate update
can still happen. However, the full fix is too involved for stable.
2017-06-02 22:27:52 -07:00
Gregory Szorc
f086e3d59e releasenotes: command to manage release notes files
Per discussion on the mailing list, we want better release notes
for Mercurial.

This patch introduces an extension that provides a command for
producing release notes files. Functionality is implemented
as an extension because it could be useful outside of the
Mercurial project and because there is some code (like rst
parsing) that already exists in Mercurial and it doesn't make
sense to reinvent the wheel.

The general idea with the extension is that changeset authors
declare release notes in commit messages using rst directives.
Periodically (such as at publishing or release time), a project
maintainer runs `hg releasenotes` to extract release notes
fragments from commit messages and format them to an auto-generated
release notes file. More details are explained inline in docstrings.

There are several things that need addressed before this is ready
for prime time:

* Moar tests
* Interactive merge mode
* Implement similarity detection for individual notes items
* Support customizing section names/titles
* Parsing improvements for bullet lists and paragraphs
* Document which rst primitives can be parsed
* Retain arbitrary content (e.g. header section/paragraphs)
  from existing release notes file
* Better error messages (line numbers, hints, etc)
2017-06-02 23:33:30 +02:00
Toshi MARUYAMA
8227d06f8d packagelib: use LANGUAGE=C for "hg version"
If "hg version" does not contain "version" (e.g. Japanese),
$hgversion was empty and rpmbuild failed.
2017-06-12 03:23:58 +09:00
Toshi MARUYAMA
ea4c5fa07c rpms: add hgdemandimport in files 2017-06-12 03:23:56 +09:00
Toshi MARUYAMA
905b1512b3 rpms: remove '%if "%{?pythonver}" != "2.4"'
Mercurial requires python >= 2.7.
2017-06-12 03:22:45 +09:00
Jun Wu
db8bfa3842 obsstore: do not load all markers to detect duplication
This will make duplication detection something like O(newmarkers) instead of
O(obsstore).
2017-06-02 20:49:42 -07:00
Gregory Szorc
1f0f04ac82 clonebundles: reference correct config option
This option is no longer experimental.
2017-06-10 11:33:57 -07:00
Siddharth Agarwal
e0e3b8e4ce filestat: move __init__ to frompath constructor
We're going to add a `fromfp` constructor soon, and this also allows a filestat
object for a non-existent file to be created.
2017-06-10 14:09:54 -07:00
Siddharth Agarwal
6e165aa389 test-dirstate-race: ensure that a isn't in the lookup set at the end
We're going to rely on this in upcoming patches.
2017-06-10 14:07:31 -07:00
Siddharth Agarwal
1d32a76696 hghave: add test for whether fsmonitor is enabled
This uses the HGFSMONITOR_TESTS environment variable that
fsmonitor-run-tests.py adds.
2017-06-10 14:07:31 -07:00
Siddharth Agarwal
a90fb2f356 tests: add a wrapper to run fsmonitor tests
This script does a bunch of non-trivial configuration work: in particular, it
sets up an isolated instance of Watchman which isn't affected by global state
and can be torn down on completion.

This script also sets the HGFSMONITOR_TESTS environment variable, which hghave
will use in the next patch to allow gating on whether fsmonitor is enabled.

With fsmonitor enabled, there appear to be a number of failures in the test
suite. It's not yet clear to me why they're happening, but if someone would
like to jump in and fix some of them I hope this will be helpful for that.
2017-06-10 14:07:30 -07:00
Pierre-Yves David
c82b13f1cf setdiscovery: improves logged message
The 'srvheads' list contains all server heads including the common ones. We
adjust 'ui.log' message to provide more useful information about server heads
locally unknown. The performance impact of turning the list to set is
negligible (about 1e-4s) compared to the rest of the discovery cost, so I'm
taking the easy path.
2017-06-10 18:47:09 +01:00
Augie Fackler
e82e3401a1 tests: handle variation between pure and normal output in annotate --skip
I'm pretty sure that both results are valid, depending on how you
slice the edits.
2017-06-10 10:46:06 -04:00
Brandon McCaig
0309412bc4 bisect: improve option validation message 2017-06-09 20:12:39 -04:00
Sean Farley
1221c3301c context: inline makememctx (API)
I have always thought it weird that we have a helper method instead of
just using __init__. So, I ripped it out.
2017-06-10 10:24:33 -04:00
Sean Farley
e67eb8ee09 context: add convenience method for returning a memfilectx from a patch
This is mostly a copy of what makememctx does but refactored to make it
behave more like our other convenience methods.
2017-06-09 13:39:13 -07:00
Sean Farley
90b054fc18 memctx: refactor inline getfilectx into convenience method
No actual logic is changing, just moving code so __init__ is easier to
read.
2017-06-09 13:25:02 -07:00
Gregory Szorc
fa21f12af8 hgweb: refresh styling of gitweb's search form
gitweb was missing the hint hover box. So that was added.

Also, the positioning of the form was absolute and it didn't
vertically align on all pages. The element has been moved inline
with the navigation links (which now are contained in a div) and
flexbox is used to obtain sane alignment of the navigation links
and search form. For those new to flexbox,
"justify-content: space-between" basically says to maximize space
elements. You can use it to easily get left and right justified
containers without having to worry about width, floating, etc.
"align-items: center" centers all items in a cross-axis. I've
literally wasted hours trying to figure out both these problems
before flexbox. Flexbox is amazing.

Flexbox has been supported by Chrome and Firefox for a few years.
But it is only supported by IE 11. I'm willing to wager that
people using this either won't be using IE or will be using IE 11.
So I'm willing to be a bit aggressive in adopting flexbox because
it makes CSS alignment so much easier.
2017-06-09 13:55:51 -07:00
Gregory Szorc
1e2e56cc41 hgweb: consistently add search form to all gitweb pages
Paper has it on all pages. Not sure why gitweb doesn't. I think it
should be everywhere because it is a useful feature.

Also, we weren't consistently adding the HTML in the same place. This
was OK since the element is absolutely positioned. But this bothered
me a bit, so I went ahead and fixed it.
2017-06-09 13:45:36 -07:00
Gregory Szorc
4d72365e92 hgweb: consolidate search form for gitweb 2017-06-09 13:42:38 -07:00
Gregory Szorc
734d5b7555 hgweb: consolidate search form for monoblue
Same deal as for paper.
2017-06-09 13:41:10 -07:00
Gregory Szorc
3816d83a29 hgweb: consolidate search form for paper
AFAICT this was mostly a bunch of copy pasta. The only variation is
some pages defined a "value" attribute. The "query" variable will
just be empty on pages that don't accept it. So let's consolidate
the template and remove the redundancy.
2017-06-09 13:59:13 -07:00
Matt Harbison
10ea5ea0de test-extension: fix load path for Windows
The previous code was trying to load the extension from /tmp/hgtests.xxx/...,
but the actual path for tests is C:\Users\...\Temp\hgtests.xxx\...  I assume
that the former is an MSYS path that maps somewhere under C:\MinGW.
2017-06-09 23:56:50 -04:00
Matt Harbison
71414924c3 test-setdiscovery: stabilize for Windows
Windows wants double quotes here.
2017-06-10 00:11:54 -04:00
Matt Harbison
5eb7c3a833 convert: correct the documentation about whitespace in branchmap branches
Might as well let the users know they can get rid of branch names with spaces.
2017-06-10 02:20:14 -04:00
Pulkit Goyal
8f8ec8b0ec py3: use pycompat.bytestr() instead of str() 2017-06-08 00:51:46 +05:30
Pulkit Goyal
228f493dac py3: convert bool variables to bytes 2017-06-02 16:57:21 +05:30
FUJIWARA Katsunori
457ca6840f context: avoid writing outdated dirstate out (issue5584)
Before this patch, workingctx.status() may cause writing outdated
dirstate out, if:

  - .hg/dirstate is changed simultaneously after last loading it,
  - there is any file, which should be dirstate.normal()-ed

Typical issue case is:

  - the working directory is updated by "hg update"
  - .hg/dirstate is updated in background (e.g. fsmonitor)

This patch compares identities of dirstate before and after
acquisition of wlock, and avoids writing outdated dirstate out, if
change of .hg/dirstate is detected.
2017-06-09 13:07:49 +09:00
FUJIWARA Katsunori
72d07d2573 tests: factor external procedures out for portability
Fortunately, "&&" is treated as "execute next, if previous doesn't
fail" both on POSIX and Windows. But keeping portability of
"dirstaterace.command" manually is troublesome.

This patch factors external procedures out as a shell script for
portability. "sh SCRIPT" always allows scripting in POSIX style.

This change is also for convenience. Fixed script name can reduce
command line arguments.

"r" prefix is needed for "sh '$TESTTMP/dirstaterace.sh'", because
$TESTTMP contains backslash on Windows.
2017-06-09 13:07:49 +09:00
FUJIWARA Katsunori
a3a205cf6c dirstate: add identity information to detect simultaneous changing in storage
This identity is used to examine whether dirstate is simultaneously
changed in storage after previous caching (see issue5584 for detail).

util.cachestat can't be used for this purpose, because it has no
valuable information on Windows.

On the other hand, util.filestat can detect changing dirstate in
storage certainly, regardless of platforms.

    https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan

Strictly speaking, if underlying filesystem doesn't support
ctime/mtime, util.filestat can't detect simultaneous changing in
storage as expected. But simultaneous changing on such (very rare)
platform can't be detected regardless of this patch series.

Therefore, util.filestat should be reasonable identity for almost all
usecases.
2017-06-09 13:07:48 +09:00
FUJIWARA Katsunori
f010ae3777 util: make filestat.__eq__ return True if both of self and old have None stat
For convenience to compare two filestat objects regardless of
None-ness of stat field.
2017-06-09 13:07:48 +09:00
FUJIWARA Katsunori
534d75d626 vfs: create copy at renaming to avoid file stat ambiguity if needed
In order to fix issue5418, 0d920bcb0fd1 made vfs.rename(checkambig=True)
omit advancing mtime of renamed file, if renamed file is owned by
another (EPERM is raised in this case).

But this omission causes rewinding mtime at restoration in such
situation, and makes avoiding file stat ambiguity difficult, because
ExactCacheValidationPlan assumes that mtime should be advanced, if a
file is changed in same ctime.

    https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan

Ambiguity of file stat also requires issue5584 to be fixed with other
than file stat, but "hash of file", "generation ID" and so on were
already rejected ideas (please see original RFC linked from "Outline
of issue" in ExactCacheValidationPlan page).

This omission occurs:

  - only for non append-only files (dirstate, bookmarks, and phaseroots), and
  - only if previous transaction is rollbacked by another user

The latter means "sharing a repository clone via group permission".
This is reasonable usecase, but not ordinary for many users, IMHO.
"hg rollback" itself has been deprecated since Mercurial 2.7, too.

Therefore, increasing the cost at rollbacking previous transaction
executed by another a little seems reasonable, for avoidance of file
stat ambiguity.

This patch does:

  - create copy of (already renamed) source file, if advancing mtime
    fails for EPERM
  - rename from copied file to destination file, and
  - advance mtime of renamed file, which is now owned by current user

This patch also factors "self.join(src)" out to reduce redundancy.
2017-06-09 12:58:18 +09:00
FUJIWARA Katsunori
f7f00ec91e vfs: factor out "rename and avoid ambiguity" to reuse
This makes subsequent patch simple.
2017-06-09 12:58:18 +09:00
FUJIWARA Katsunori
49b9b7a367 util: make filestat.avoidambig() return whether ambiguity is avoided or not 2017-06-09 12:58:17 +09:00
Gregory Szorc
c8a15a9f84 debugcommands: issue warning when repo has secret changesets (issue5589)
This seems like a prudent thing to do. As the inline comment says,
we may want to make this abort once the functionality is stabilized
as part of `hg bundle`. Let's save that debate for another day.
2017-06-09 10:42:19 -07:00
Gregory Szorc
bc8582fc01 streamclone: consider secret changesets (BC) (issue5589)
Previously, a repo containing secret changesets would be served via
stream clone, transferring those secret changesets. While secret
changesets aren't meant to imply strong security (if you really
want to keep them secret, others shouldn't have read access to the
repo), we should at least make an effort to protect secret changesets
when possible.

After this commit, we no longer serve stream clones for repos
containing secret changesets by default. This is backwards
incompatible behavior. In case anyone is relying on the behavior,
we provide a config option to opt into the old behavior.

Note that this defense is only beneficial for remote repos
accessed via the wire protocol: if a client has access to the
files backing a repo, they can get to the raw data and see secret
revisions.
2017-06-09 10:41:13 -07:00
Yuya Nishihara
91bdea4c9e json: pass formatting options recursively
This bug was introduced in 469914605447. It's okay to escape <>, but is
unnecessary for command output.
2017-06-09 21:33:15 +09:00
Xavier Lepaul
a75e0dc064 help: clarify the choice of pager
This follows the change made in 4fba4efc2e2e to use environment variables
between system and user configuration.
2017-06-02 10:44:40 +02:00
Wagner Bruna
66a53a8e31 i18n-pt_BR: fix syntax error on translation 2017-06-02 20:50:46 -03:00
Wagner Bruna
2d3ddc9080 i18n-pt_BR: synchronized with 98315436ecec 2017-06-01 20:06:02 -03:00
Kevin Bullock
f750e29306 merge with i18n 2017-06-01 12:24:16 -05:00
Wagner Bruna
6d75e48bdf i18n-pt_BR: synchronized with b0ea8556414f 2017-05-31 20:42:58 -03:00
Rodrigo Damazio Bovendorp
3a507184d3 debian: add less as a build dependency
For builds that run on hermetic environments, it's possible that the "less"
package is not installed by default, yet it's needed for tests to pass after
revision ca1519568a93 (which sets less as the fallback pager).
2017-05-26 19:33:20 -07:00
Kyle Lippincott
8175ca534f zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.

With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.

Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:

    The convention for autoloaded functions used in completion is that they
    start with an underscore

This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead.  If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.

I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
2017-05-26 13:24:07 -07:00
Augie Fackler
8e4d9f1f1d osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:

     --filter filter-expression
                 By default, --root will include the entire contents of the
                 given root-path in the package payload, except for any .svn
                 or CVS directories, and any .DS_Store files. You can override
                 these default filters by specifying one or more --filter
                 options. Each filter-expression is an re_format(7)
                 ``extended'' expression: any path in the root which matches
                 any of the given expressions will be excluded from the pack-
                 age payload. (Note that specifying even one --filter inhibits
                 the default filters, so you must respecify the default fil-
                 ters if you still want them to be used.)

It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression?  That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.

Bug filed with Apple for this as rdar://problem/32437369, mentioning
both the gap in documentation and the wrong defaults.
2017-05-26 20:03:05 -04:00
Wagner Bruna
8d9192e033 bugzilla: fix typo in help text 2017-05-31 19:24:00 -03:00
Wagner Bruna
d0831e7086 help: fix typos 2017-05-31 19:23:23 -03:00